Download PHD Comics,XKCD and DogHouseDiaries for Offline Viewing (E-book Reader)
If you are like me who wants to read comics on kindle then this is the script for you. You can download all the comics to read it in a kindle. So here is how you do you do it. Download all the comics into 3 different folder s for each comic set by running the following scripts.
Batch Insert/Update for Mysql in Java
Large inserts/Updates are a costly operation. One foolish way that I used to do is to run each update or insert query one at a time. Its incredibly slow. With most of the systems currently the latency is what is killing the performance not the CPU. Hence latency per query is really really slow. One way to speed it up is to use the Batch query in Java. It gives you the advantages of prepared statements and more over sends batch of query to mysql and there by making it incredibly fast. How fast? One by one query insert takes around 3 hours for a 8 million inserts, while batch inserts with a batch of 1000 gets done in less than 5mins. Here is the a sample code to it.
More than 100% CPU in top in Linux/Mac
If you are power linux/mac user you should have noticed at least once that top shows more than 100% CPU for a process. I also have seen this multiple times but always wondered how it can be. Here is an example of how my top looked when I started my java and was doing some number crunching.
Enable Multiple Login in Same Account in Gmail
Gmail recently started merging its App accounts to Gmail. Hence you wont be able to login into both the accounts in the same browser now. Here is a way on which you can still do it. This can be done for people who have multiple gmail accounts and want to be able to switch between each of that in same browser.
Auto Backup using Dropbox in Linux/Mac
Posted by Srijith R in linux, shell scripting on November 9, 2011
I had some folders on my disk which I wanted to keep a copy online as a backup and for viewing from other places. Its not always possible to save all the essentials in the drop box folder itself to be auto backed up. Thus I wrote a very small script which does this for me. All it does is read all the folders which needs to be backed up from the text file “dropboxFolders.txt” and copy them to dropbox folder. The rest is done by dropbox scripts. Hence I expect the dropbox program to be running always in the background. So here is the script:
User Level Threads
Posted by Srijith R in Assginment, C, linux on October 9, 2011
User level threads is created for light weight threads. It needs to be controlled, context switched and swapped by the process. To the Operating System it is only one process without any threads. Here is one implementation of it:
Cron a Django Program
One of the issue I faced while developing a website in Django was I always had a script which collects or data which is to be in the cron. But Django usually needs a lot of configurations and settings for the environment to run. So after some searches I got that django has an undocumented API of settings which we would use of the same. So here is a file which you could include for any file you would like to run as cron and this file would do the rest.
Service Engineer/System Administrator Interview Questions
Posted by Srijith R in interview, linux, shell scripting on October 1, 2011
This is not my code alone. It was the group effort of Vivek Ram, Cijo George, Sandeep Unni and mine during our epic preparation for Yahoo!. I am just putting it open for others who would be looking for this information. Read the rest of this entry »
Recent Comments