Monthly Archives: February 2009

How To Get Yesterday's Date using BASH Shell Scripting

The new short way: $ date -d ’1 day ago’ +’%Y/%m/%d’ 2009/07/21 Or the longer way: Yesterday in epoch seconds $ yesterday=$((`date +’%s’` – 86400)) Get default formatted yesterday’s date $ date -d “1970-01-01 $yesterday sec” Tue Feb 17 01:27:32 … Continue reading

Posted in Bash, Linux | 2 Comments

How To Centralize Bookmarks using Firefox and Google Bookmarks

Create a label in Google Bookmarks with all the bookmarks you want to centralize. Then, create a live bookmark in Firefox with the following URL, replacing the label name with the one you created: http://www.google.com/bookmarks/lookup?hl=en&sort=title&output=rss&q=label:live Copy and paste this link … Continue reading

Posted in Firefox | Leave a comment

How to Quickly Add Multiple Indexes to a MySQL Table

Instead of: ALTER TABLE my_table ADD KEY `key1` (`apple`); ALTER TABLE my_table ADD KEY `key2` (`banana`); do this: ALTER TABLE my_table ADD KEY `key1` (`apple`), ADD KEY `key2` (`banana`);

Posted in MySQL | Leave a comment

ssh_exchange_identification: Connection closed by remote host

On the destination server, remove the known_hosts file: rm ~/.ssh/known_hosts Remove any relevant entries in your /etc/hosts.deny file: /etc/hosts.deny: # DenyHosts: Fri Jun 25 16:10:25 2010 | sshd: xxx.xxx.xxx.xxx sshd: xxx.xxx.xxx.xxx Also, try this in your /etc/hosts.allow file /etc/hosts.allow: SSHD: … Continue reading

Posted in Linux, SSH, Troubleshooting | Leave a comment