Comment/Uncomment all cron tab entries in one shot

Comment :
sed -i -e ‘/^[ ]*[0-9]/ s/^/#/g’ /var/spool/cron/mysql
Uncomment :
sed -i -e ‘/^#*[ ]*[0-9]/ s/^#*[ ]*//g’ /var/spool/cron/mysql

Commenting and Uncommeting read-only in my.cnf across multiple servers

For commenting the following snippets can be used :
sudo perl -i -p -e ‘ print “#” . ” ” if !/^#/ && /^read-only/; ‘ /etc/my.cnf
sed -i -e ’s/^read-only/#&/g’ cnf
For uncommenting you can use the following snippets :
sudo perl -i -p -e ’s/^#// if /^#/ && /read-only/; ‘ /etc/my.cnf

sed -i -e ’s/^#*read-only/read-only/g’ cnf

Maiden Bangalore Architects off site

Architects off site kicked of the Bangalore Architects group. The day was full of fun activities and discussions related to the career of an Architect. It was a great forum to meet lots of like minded folks. There were Architect aspirants and veterans. The whole group was split into smaller groups and the groups [...]

hardware trouble

No no not my laptop or my computer, back wheel and mud guard in my two wheeler got stuck. Tried brute force attack didn’t help, hence borrowed a spanner removed the connecting bolt and brute forced , boom it came off.
Though there was a garage, they were not willing to look into my problem since [...]

mysql timezone patching

Generate the timezone tables using the following command :
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql
This needs to be done only after the OS level timezone patch is applied. Incase you dont have the timezone info, it can be downloaded @ http://dev.mysql.com/downloads/timezones.html
To check if your timezone patching is good, run the following sql and both the [...]

reading off index is slow

Today the development team posted an interesting problem in staging. The table in question had 2 million records. There was an index on the column referred in the where clause. It was a range lookup. Now here is the problem ,
Query using index took 15 secs.
Query without the index took 3 secs.
Now given the background [...]