March 9th in Linux/Unix by .

Difference between /etc/hosts and /etc/hostname

I have often found myself in difficult situations without knowing what exactly is the difference between host and hostname

/etc/hostname -> Assigns a name to local machine and you can set the name of the machine by editing this file. It can be a FQDN eg. vps.example.com. You will also need …

March 8th in Linux/Unix by .

How to run FTP server on different port!

linftp

Most FTP servers use a common port number 21 by default. However using default port are subjected to many brute force attacks including many breakin attempts. It is a good idea to move FTP  port to any other random number above 1024 because ports 1-1024 are reserved ports. It is …

March 4th in Linux/Unix by .

Protection against Pureftpd Brute force attacks in Cpanel

cphulks

I have spotted kind of brute force guessing attacks in my logs attempted against my ftp server. The attacks come from different IPs and the failed login attempts are of combination of username and passwords.I did run AFP + BFD (brute force detection) but BFD isnt working on my linux …

February 7th in Linux/Unix by .

MySQL delete is very slow and takes long time!

mysql

I recently had an issue with mysql database and the datbase has grown too large about 200k records and i was needing to delete all junk and needless data of approx 50k rows in my table. As soon as i hit delete sql query using WHERE clause, it almost took …

January 29th in Linux/Unix by .

How to install a local copy and configure WordPress on Ubuntu

ubuntu

Compatibility is one of the most important issues when it comes to WordPress. If you want to install a a copy on your local machine, then you have to follow some simple steps.

First, download the archive on wordpress.org. For the purpose of this tutorial we are going to use wordpress-2.9.tar.gz …

January 9th in Linux/Unix, PHP Scripts by .

How to import text data in mysql with spaces?

mysql

Lets say you have to import a large text file to mysql and fields are totally irregular but only separated by spaces. For example.  Since it is only text file and highly irregular data you have to use other methods to import data to database.

17876           …

January 9th in Linux/Unix, PHP Scripts by .

How to use LOAD DATA INFILE to import fixed width data in MySQL

It is very easy to import fixed width CSV data into your mysql database and LOAD DATA INFILE is the fastest method i have seen. If you are on shared hosting be sure you first upload the csv file to your hosting server and specify LOCAL if not you will …

January 8th in Linux/Unix by .

MySQL database without primary key is too slow!

I cant believe how slow the performance of mysql was, assuming that  i had a large database table of over 100k record. I technically directly imported to mysql from csv and there was no primary key in the database. Infact i never used a auto incrementing primary key.

The performance was …

January 8th in Linux/Unix, PHP Scripts by .

Fix -> MySQL LOAD DATA Infile – Access Denied using password YES

I was on shared hosting and thought i could import a CSV file using PHP to mySQL database and whe

LOAD DATA INFILE ‘/home7/topbestg/OFFICES2_ALL.CSV’
REPLACE INTO TABLE `tbl`
FIELDS TERMINATED BY ‘,’ ENCLOSED BY ‘\”‘
LINES TERMINATED BY ‘\n’
IGNORE 1 LINES;

i was thrown this error

Access Denied user@localhost using password …

November 15th in Internet, Linux/Unix by .

Easy way to setup CRON jobs in CPanel without Email output

cpanel

i have been looking everywhere for one easy command to setup CRON job in cpanel.  My requirement was i wanted to send a simple invoice for my client every month and i dont want want cron outputs to sent as junk to my email.

Here is this one command which worked …