MySQL: How do I import individual table dump files in to MySQL using shell script?

After I wrote the post: How do I dump all tables in a database into separate files? I got emails from couple people asking how to import the individual table files back in to MySQL. First way to import each sql file created by the post is to import each file individually by [...]

Read the full article...

Mcache: Install and configure mcache (msession) to be used for session caching in PHP.

Installing mcache, previously known as msession, on CentOS 32 bit system.
If you are on 64 bit system, you will get errors, lots of them.  I went through and fixed “some” errors by modifying code but it was just taking too much time so I decided not to go 64 bit route.  But below are the [...]

Read the full article...

TIP: How do I rename multiple files to another extension?

Let us say that you want to rename all of your “.php3″ files to “.php” files. How you do this with minimal effort? Answer lies in for loop.
for old in *.php3; do cp $old `basename $old .php3`.php; done
Thats all there is to it. Let us say you need to rename index.php3 [...]

Read the full article...

/bin/rm: Argument list too long

You type: rm * -f
You get: /bin/rm: Argument list too long
Reason: in shell when you do * after rm and get Argument list too long, your shell actually expands that * and puts all the filenames after rm and since length of the command line is limited, you end up getting [...]

Read the full article...

Linux time - Daylight saving time (DST)

Its that time of the year again when time changes and we have to make sure our servers are using the right zone with right time. Out of many servers I admin, I found 3 servers which had wrong time displaying. All of them had one thing in common, Fedora Core 4. [...]

Read the full article...