How to loop through days (dates) in bash and force two digits (zerofill)

May 20th, 2011 No comments

Often with bash, I need to run a script and pass in a date. It helps to be able to use a bash loop to do it all at once. Here’s how you do it, and make sure the day is two digits. Note the use of the println command.

for day in {1..31}; do php some_script.php 2011-05-`printf "%02d" $day`; done

Bookmark this page
[del.icio.us] [Digg] [Facebook] [Google] [Reddit] [Slashdot] [StumbleUpon]
Categories: Bash, Linux Tags:

How to have htop save configuration on exit

April 3rd, 2011 No comments

htop is awesome. I use it all the time to monitor all the servers I use. It was only until recently that I noticed it has some great configuration options, namely the "Tree View." This allows you to see a hierarchy of processes, which can be really helpful in finding out why certain processes are running.

I quickly realized it would be a pain to have to constantly hit F5 every time I opened the program, until I realized there was a way to make htop remember your last configuration.

What you want to do is make sure you close out of htop with F10 instead of Ctrl+C, which I normally use. You only need to use F10 when you want to save the settings, and can subsequently close out how you normally do!

Bookmark this page
[del.icio.us] [Digg] [Facebook] [Google] [Reddit] [Slashdot] [StumbleUpon]
Categories: How To's, Linux Tags:

How to Hide Digsby Ads

December 13th, 2010 1 comment

I use Digsby as my instant messenger client. A couple minutes ago, I received an update which set ads to display in the conversation windows by default. I immediately decided I'd try to figure out how to remove the ads, or switch back to Pidgin, the free open source client. Turns out it was simple to turn off the ads. When you're done, you'll need to reopen your conversation windows to see the changes.

From the Buddy List window:

  1. Tools -> Preferences
  2. Conversations
  3. Uncheck "Support Digsby development by showing an ad in the IM window"

Bookmark this page
[del.icio.us] [Digg] [Facebook] [Google] [Reddit] [Slashdot] [StumbleUpon]
Categories: How To's, Tools Tags: