January 29, 2007

Does Firefox use all your CPU?

Is your computer very slow because Firefox uses a lot of CPU even if it's not actively doing anything? For the past few days my computer was slow in general, and Firefox was horribly slow. The reason was that Firefox was using more than 70% of CPU all the time -- even when Firefox was idle. A quick Google search took me to the solution:
If you encounter problems with sites do not just complain that FF is not working but post the site address here for other people to check. No one doubts that you have problems but to decide if it is a FF problem or something with your system we must be able to check these sites.
I closed a few tabs (which I had open for the past few days), and my machine was back to normal :-)

January 08, 2007

Renaming files in a jiffy

Want to rename a bunch of files in a directory? If you are using a *nix operating system, it can be done with a single command. A set of files I downloaded from a website had filenames of this pattern: sitename.com_someprefix_filename.txt. If at all I had been using a Windows box, that would have been a nightmare -- I could not do it without writing a Python program. Fortunately, I am using a Kubuntu Linux box; so I can rename all the files with a single command:
for i in *.txt
do
   mv $i "`echo $i | sed 's/TheWebSite.com_[^_][^_]*_//'`"
done 
If I put this in a shell script, I won't even have to type this long command again and again. Now I realise why Windows is not for power users (like me).