Quick bash command to mass rename files in numbered sequence

Just a quick bash command to rename all files in a directory in a numbered sequence. d=0; for i in *.jpg ; do d=$((d+1)); mv {“$i”,”$d.jpg”} ; done This is going to rename all jpg files in the directory to 1.jpg, 2.jpg, 3.jpg and so on.

How to Reset the Root Password of MySql in Linux

I am posting this for my future reference. Also it my help passers by. If you are using CentOS 6 (maybe others too). To reset the root password use the following steps:- sudo service mysqld stop sudo service mysqld startsos mysql -u root Now you will be at mysql prompt. Here type:- UPDATE mysql.user SET […]

Script that notifies via email when your server has updates

If you are the administrator of a server then you definitely understand the importance of keeping your system updated always. The following script will send you a mail whenever your server needs an update. The content of the mail will list out all the available updates. The script Notes: This script has been tested on […]

Access Ext3/Ext2 file system on Mac OSX Lion (10.7)

On Mac if you want to access ext3/etx2 filesystems, which are used by Linux systems, you will find lots of links on net but all are pretty outdate and they don’t work for Lion. So, here is the updated version, which works. At least for me. 😉 You will need two softwares:- OSXFuse – Download […]

Create your own Cyberoam client in Python!

This is a very old post. Reposting it since while migrating it from blogger.com to here it got lost. Found it recently. Not sure how relevant or correct is this now. Cyberthon updated to version 2.5 by Vinit and Siddhartha Sahu:- Get the latest code from https://github.com/siddharthasahu/Cyberthon-enhanced. Cyberthon updated to version 1.2:- Added a new […]

Migrate from Apache to Nginx: The new guide

If you are here then most probably, like me you too want to migrate from Apache to Nginx. Well I have already migrated and I am loving it! You can get a quick recap of Apache vs Nginx comparison here. Via this blog post I will share and explain my Nginx conf, in the hope […]