How To Write Infinite Loop in BashNovember 18th, 2007 This is how you create an infinite loop in bash to run a piece of code perpetually at pre-defined intervals.
#!/bin/bash
while [ 1 ]
do
# Your code goes here
# Modify sleep time (in seconds) as needed below
sleep 2
done
For example I used this code to write a bash script to monitor long running mysql queries.
Monitoring MySQL Queries Using Bash ScriptNovember 18th, 2007 Monitoring MySQL queries is a favorite pastime of MySQL administrators especially for performance reasons. Here is a simple bash script to monitor long running MySQL queries in realtime using the ubiquitous 'show processlist'.
How To Backup PmWiki in Subversion (Code)October 8th, 2007 PmWiki is a popular wiki software which uses the file system to store wiki pages. We use for our intranet and to document our processes and systems.
How To Add Functions To Javascript onload Over Third Party Scripts; Playing NiceFebruary 7th, 2007 As a javascript developer using onload often you will find that other script authors too love to use onload. Unfortunately onload accepts a function name and your reassigning will prevent others from using onload.
Subversion: How To Ignore Files From Status DisplayJune 23rd, 2007 In directories under subversion there may be files which you do not want to add to subversion. Normally such files would show in subversion status (svn stat) with ? in front of them.
Algorithm for Talking With TeleMarketerNovember 2nd, 2005 Almost all of us have been pained by telemarketers. You probably have realized by now that they follow a script which guide the conversation and make it one-sided, in their favor and against you.
How To Detect AdBlock PlusNovember 12th, 2007 AdBlock Plus is a controversial Firefox plugin to prevent ads from displaying on web pages. There is a simple procedure to detect (and take appropriate action) AdBlock Plus.
How To Make Friends on MySpace AutomaticallyJune 18th, 2006 This is a simple guide to making friends (as many million as you like) on MySpace automatically (otherwise where is the fun?). Ensure you have perl available on your system.
Tip: What Others Are Reading On This SiteSeptember 5th, 2007 Here is the live feed of visitors from our side. You can also see it on the right sidebar.
How to Speed-up Firefox Significantly with tmpfs!January 5th, 2009 Firefox, statistically the most popular browser in the world has a lot that is to be explored still. Though we have regularly fed you to better your firefox experience, the resource-hungriness of Firefox has always been under question.
How To Fix Buggy PHP strip_tags FunctionDecember 21st, 2007 strip_tags() in PHP has several problems. It doesn't recognize that css within the style tags are not document text.
How To trim() in JavascriptMarch 17th, 2006 Javascript doesn't natively support trim on strings. It is however very easy to implement with regular expressions.
How to Import Winamp Equalizer For Your Linux Audio Players like XMMS, Audacious etcFebruary 16th, 2009 With most of you using Linux players like XMMS, Audacious or BMP desperately miss out equalizer presets of Winamp. For a die-hard music-aficionado who loves to hear Miles Davis' Kind of Blue in pure Jazz can never compromise with an equalizer.
How to Add Twitter Widget to Your Blog in Two StepsJanuary 7th, 2009 Twitter has become phenomenally popular around the world. So if you are an avid blogger and a twitterer yourself, then you must be wondering how to synchronize them both? Here is a simple trick that will add twitter gadget to your blog so that you can be updated on both in a single window.
How to Integrate Subversion, Version Control Software, With Apache ANTNovember 4th, 2005 Subversion is a popular version control software and replacement for CVS, the grand-daddy of all version control software which is still widely used in open source community. Recently I had the necessity to invoke Subversion commands like checkout from Ant, a popular java based build software which replaces make tool.
November 24th, 2008 at 11:21 am
Thanks a lot for the bash tip
It’s really useful.
July 23rd, 2009 at 10:00 am
thanks man, this post saved me a lot of time