Changing the default config editor in Ubuntu

If you are following the articles at Slicehost, then you may notice that PickledOnion uses nano as the default editor. I somehow like vi more than nano (not ready for a debate ;-) ) and was looking for a way to make vi the default config editor. After some googling, I found how to do it.

I am writing it down here so that all I have to remember is that I just need to search my blog if I need to do it again in future.

Okay the command you have to use is (I am assuming that you are not logged in as root, which is the recommended approach)

sudo update-alternatives --config editor

And then press the number corresponding to the editor which you want to use. Below is the screenshot of how it looked in my slice.

Changing default config editor in Ubuntu

Time to strip down again

Like 2006 and 2007, I am going to participate in this year’s CSS Naked day too. This year the date has been changed to April 9th.

If you are wondering what is CSS Naked day, then this is the definition from the official site

The idea behind this event is to promote Web Standards. Plain and simple. This includes proper use of (x)html, semantic markup, a good hierarchy structure, and of course, a good ‘ol play on words. It’s time to show off your <body>.

If even you want to participate then register your site in the official site and then strip the CSS from your site. If you are on WordPress then you can use this plugin.

Happy stripping ;)

WordPress 2.5 is out

The wait is finally over. :) The most waited version of WordPress, Version 2.5 is out. WordPress 2.5 was in the making for nearly 6 months now and it has lot of new features and most importantly, changes to the admin screen. You can also view the screencast discussing the new admin pages from the WordPress development blog.

I am going to update my installation now and this blog might appear clunky while I am doing that. I have installed WordPress using svn so it is just a single shell command for me to update. Thanks to Joost, I converted my installation into a svn installation when WordPress 2.2.2 was released.

By the way this will be my last post using the old admin screens, I will post my experience with the new admin screens in a couple of days. Meanwhile if you have a self-hosted WordPress blog, then I highly recommend you to update to WordPress 2.5. Happy upgrading ;)

Convert MP3 audio books to iPod audio books file format

Recently I got some MP3 audio books from a magazine CD. I wanted to upload them to my iPod so that I can listen to them during my compute to office. But then I found that these were in MP3 format and not in iPod audio book format.

The main feature of the iPod audio book format is that the iPod can remember the last listening position and also we can adjust the reading speed in case, which is not possible if it is in MP3 format.

I started looking for a program to convert MP3 files to iPod audio book format and found an excellent program MP3 to iPod Audio Book Converter. It is free, opensource and the best part is that it works.

Download the program and install it. Once installed start the program from start menu and then click the Add button.

Convert MP3 audio books to iPod audio books file format

Select the MP3 files and then click the Open button. (You can also press shift to select multiple files)

Convert MP3 audio books to iPod audio books file format

Arrange the files in the correct order and then click the Start Conversion button. You can also edit the tags if you want.

Convert MP3 audio books to iPod audio books file format

The program will ask to specify the file name and once given it will start the conversion.
Once the program finishes you can add the file to iTunes and then sync it with iPod. Happy Listening :)

Links:

You can download MP3 to iPod Audio Book Converter from its download page.
You can also get some free Audio book from AudioBooksForFree.com

Other articles in iPod Tips

  1. Uploading Videos into iPod
  2. First aid advice on your iPod
  3. Copy files from iPod to any computer without iTunes
  4. Convert MP3 audio books to iPod audio books file format

No Browse Happy Plugin

There was a thread in the WordPress hackers mailing (wp-hackers) list today discussing about the browse happy logo which is displayed in the footer of WordPress admin screens, when a user views the admin pages using Internet Explorer.

There were lot of arguments for and against the removal of this logo, at least for IE7. I found that there was even a ticket created in trac (WordPress public bug reporting database) for removing it, which was closed by Matt as wontfix. I personally felt it was a very minor thing to argue about and I neither agree nor disagree in removing it.

Someone in the thread suggested that we can create a Plugin which could output some CSS to hide the logo, which let me to create a very small (probably useless) Plugin called No Browse Happy Plugin. This is similar to the No Howdy Plugin by Ozh, very useless in my point of view but might matter a lot for someone.

If you look at the source code you could find that it is nothing fancy but just an echo statement which prints the following CSS code in the header.

#bh {
display: none;
}

In short, I just wasted two minutes to stop someone from wasting hours in arguing about something which is useless (at least in my point of view). :-)

Recommend some books to buy

Even though I was not an avid reader in my childhood, I started cultivating the habit of reading books after college and one of my resolutions for 2008 is to read at least a book every month. I have successfully kept up the resolution for the past two and a half months. :-)

I recently received a gift certificate for Rs 2000 from my office, which I can use to buy either books or cds. I am planning to spend Rs 2000 equally among technical, fiction and non-fiction books and I need your recommendation. For technical, I am planning to buy some books related to Ruby but I don’t have much idea for fiction and non-fiction books. So suggest me some books which I can buy.

Running multiple instances of Google Talk

Ever since I moved my mails from Gmail to Google Apps, I was using my Google Apps email address in Google Talk. But still some of my old friends are added in my Gmail address. So I was searching for a way to run multiple instance of Google Talk in the same machine and found this tip. I thought of noting it here so that I know where to search if I reinstall Google Talk in my system.

To run multiple instances, all you need to do is to pass the parameter nomutex to the Google Talk Exe file.

c:\program files\google\google talk\googletalk.exe" /nomutex

If you want, you can create a new shortcut in your desktop with this parameter.

Rotating Apache log files using Cronolog

I must confess that I am a stats freak. If you are a long time reader of my blog, then you would have known that by now yourself. ;-) This explains the reason why I want to preserve my Apache log files in spite of using a variety of stat services like Google Analytics, WordPress stats, statscounter, performancing metrics (before it was closed).

The default Apache configuration preserves the log files only for the last 10 days, but I wanted to permanently archive this files. After some searches in Google I came across an excellent program called Cronolog. Cronolog is a simple filter program which writes each log entry to a separate log file named after the filename format specified. You can use a variety of parameters like current date, time etc to define the filename template.

First we have to install cronolog, either by using aptitude or by downloading it from its download page. Then you have to change the log file name path in the virtual host file. (In Ubuntu Gusty, the virtual host files are situated in the path /etc/apache2/sites-enabled). I am using the following file format for this blog
# Custom log file locations
LogLevel warn
ErrorLog "|/usr/sbin/cronolog /path/to/logs/%Y/%m/%Y-%m-%d-sudarmuthu.com-error.log"
CustomLog "|/usr/sbin/cronolog /path/to/logs/%Y/%m/%Y-%m-%d-sudarmuthu.com-access.log" combined

which will store my log files in separate folders for each year and for each month, like the below hierarchy
/2007/12/2007-11-01-sudarmuthu.com-access.log
/2007/12/2007-11-02-sudarmuthu.com-access.log
......
/2008/01/2008-01-01-sudarmuthu.com-access.log
/2008/01/2008-01-02-sudarmuthu.com-access.log
......

You can use a variety of modifiers for the filename and I have documented some of them in the below table. You can get more information from its documentation.

Specifier Description
Time fields
%H hour (00..23)
%I hour (01..12)
%p the locale’s AM or PM indicator
%M minute (00..59)
%S second (00..61, which allows for leap seconds)
%X the locale’s time representation (e.g.: “15:12:47″)
%Z time zone (e.g. GMT), or nothing if the time zone cannot be determined
Date fields
%a the locale’s abbreviated weekday name (e.g.: Sun..Sat)
%A the locale’s full weekday name (e.g.: Sunday .. Saturday)
%b the locale’s abbreviated month name (e.g.: Jan .. Dec)
%B the locale’s full month name, (e.g.: January .. December)
%c the locale’s date and time (e.g.: “Sun Dec 15 14:12:47 GMT 1996″)
%d day of month (01 .. 31)
%j day of year (001 .. 366)
%m month (01 .. 12)
%U week of the year with Sunday as first day of week (00..53, where week 1 is the week containing the first Sunday of the year)
%W week of the year with Monday as first day of week (00..53, where week 1 is the week containing the first Monday of the year)
%w day of week (0 .. 6, where 0 corresponds to Sunday)
%x locale’s date representation (e.g. today in Britain: “15/12/96″)
%y year without the century (00 .. 99)
%Y year with the century (1970 .. 2038)

Useful jQuery links

I found lot of useful links related to jQuery while researching for my presentation on jQuery. I thought of sharing them here so that it will be useful for others who are looking to get their feet wet with jQuery.

I am planning to constantly updated this post, so if you have any other links which might be useful do leave a comment and I will add them.

Homepage

References

Tutorial/Articles

jQuery related slides

Some useful Plugins

jQuery Related Books

Back from WebCamp

I attended WebCamp today as planned. It was good and there were talks about web frameworks like Ruby on Rails, Groovy on Grails, Django, Flex etc. Unfortunately I was not able to give my talk about jQuery as planned due to some issues with the timings. I was pretty disappointed at first; since it took me considerable amount of time to prepare for the presentation and added to that I drove for more than two hours to attend the event. Anyway that’s life isn’t? ;-) You will never know what life has for you the next second. If everything goes as planned, then life would be as dull as a recorded circket match. It is uncertainty which gives life to life (wow! I can make a quote too ;-) ).

Anyways to be positive I learned a lot of new things about jQuery when I did my research to prepare for the presentation, even though I have been using it for the past couple of months. Hope you guys also find my slides about jQuery useful.

 

SlideShare | View | Upload your own

I have uploaded the slide to slideshare and you can download it from there. I have also collected lot of links about jQuery during my research and I will post them soon. Update: You can find these links here.

There were some great presentations and I particularly liked the talk on Django by KG (Oops! I forgot to find out whether he has a blog). I also learned lot of good things about Ruby on Rails. More reasons for me to get my hands dirty with Ruby on Rails. ;-)

Special thanks to Prabhu and other organizers for a wonderful event.