<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-12017471</id><updated>2011-11-27T16:20:12.059-08:00</updated><category term='mobile'/><category term='calendar'/><category term='suggestion'/><category term='pspell'/><category term='display'/><category term='gmail app'/><category term='BIS'/><category term='app.yaml'/><category term='v7'/><category term='apache logs'/><category term='average'/><category term='migrate'/><category term='scaling'/><category term='sysad'/><category term='pdo'/><category term='RSA'/><category term='chrome'/><category term='rewrite'/><category term='firefox'/><category term='special characters'/><category term='mail sync'/><category term='custom dictionary'/><category term='static content'/><category term='spam'/><category term='wrt54g'/><category term='Reliance'/><category term='redirect'/><category term='backend'/><category term='mail setup'/><category term='Volume Control'/><category term='c++'/><category term='cruise'/><category term='exchange'/><category term='2008'/><category term='Wireless USB'/><category term='xml'/><category term='rates'/><category term='java'/><category term='mysql'/><category term='lightning'/><category term='slow'/><category term='intersection'/><category term='airtel live'/><category term='website architecture'/><category term='memory'/><category term='filter'/><category term='CRT'/><category term='Ubuntu 10.04'/><category term='thinkpad'/><category term='echo'/><category term='gawk'/><category term='sony ericsson'/><category term='external'/><category term='ubuntu'/><category term='Ubuntu 8.10'/><category term='capture'/><category term='google app engine'/><category term='huge table'/><category term='technology'/><category term='GWT'/><category term='wireless router'/><category term='javascript'/><category term='gparted'/><category term='cache'/><category term='NFC'/><category term='OLED'/><category term='github'/><category term='outlook 2007'/><category term='memcache'/><category term='string'/><category term='handle zombie'/><category term='MTNL'/><category term='frontend'/><category term='browser'/><category term='triband'/><category term='Net_Gearman'/><category term='version 7'/><category term='ext4'/><category term='thunderbird'/><category term='file'/><category term='India'/><category term='google calendar'/><category term='fan error'/><category term='database'/><category term='field separator'/><category term='apache'/><category term='linux'/><category term='php error'/><category term='hibernate'/><category term='tricks'/><category term='C Server'/><category term='boot'/><category term='php'/><category term='broadband'/><category term='virtual hosting'/><category term='IMAP'/><category term='R60'/><category term='size'/><category term='go'/><category term='ascii'/><category term='gae'/><category term='xcache. memory leak'/><category term='time'/><category term='site performance'/><category term='myisam'/><category term='blackberry'/><category term='gearman'/><category term='SSD'/><category term='resize partition'/><category term='xdebug'/><category term='tagging'/><category term='command line'/><category term='clipboard'/><category term='caching'/><category term='gmail'/><category term='password'/><category term='profiling'/><title type='text'>Tech Scraps</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>58</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-12017471.post-6270703934267974481</id><published>2011-06-04T11:12:00.000-07:00</published><updated>2011-06-04T11:12:33.555-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='GWT'/><title type='text'>GWT for client side code</title><content type='html'>Google Web Toolkit(GWT) is a framework which allows you to write client code using Java and compiles it into JavaScript. It also allows you to write server code but you can choose a server side framework of your choice (like  RoR, Spring MVC etc.). If you choose a Java-based framework for the server side, you will have the advantage of using only one language for the entire application (with the exception of CSS of course).&lt;br /&gt;&lt;br /&gt;For thin client application, where only minimal code is executed by the browser, there is not much that you can exploit out of the GWT framework as most of the code will be on the server side. But if you are building a thick client, where some JavaScript execution is expected, GWT is a pretty neat choice.&lt;br /&gt;&lt;br /&gt;Some features/tools which help manage the client code better than using plain JavaScript are:&lt;br /&gt;&lt;br /&gt;1) &lt;a href="http://code.google.com/p/google-gin/"&gt;Gin&lt;/a&gt; for Dependency Injection&lt;br /&gt;2) &lt;a href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.1/com/google/gwt/event/shared/EventBus.html"&gt;EventBus&lt;/a&gt; to manage interaction between various components&lt;br /&gt;3) &lt;a href="http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/junit/client/GWTTestCase.html"&gt;GWTTestCase&lt;/a&gt; to test views (if they have any logic). We should have minimal logic in views but we all know that the views are getting more n more complicated these days ;)&lt;br /&gt;4) &lt;a href="http://code.google.com/webtoolkit/doc/latest/RefWidgetGallery.html"&gt;Widgets&lt;/a&gt; which you can simply plug in&lt;br /&gt;5) Built-in &lt;a href="http://code.google.com/webtoolkit/doc/latest/DevGuideMvpActivitiesAndPlaces.html"&gt;framework&lt;/a&gt; for MVP development&lt;br /&gt;&lt;br /&gt;There are many more reasons for choosing GWT and depending on your requirement, GWT can be a good contender.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-6270703934267974481?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/6270703934267974481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=6270703934267974481' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/6270703934267974481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/6270703934267974481'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2011/06/gwt-for-client-side-code.html' title='GWT for client side code'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-9098919178821432814</id><published>2010-11-09T21:30:00.000-08:00</published><updated>2010-11-09T21:44:05.951-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><category scheme='http://www.blogger.com/atom/ns#' term='Wireless USB'/><title type='text'>Sharing Internet Connection with Others using Ubuntu</title><content type='html'>We were recently at a client's location where the internet access was restricted. We had a single USB Mobile Broadband device which had to be exchanged periodically so that we can go online.&lt;br /&gt;&lt;br /&gt;This was a pain and wasted a lot of time. The 'Create New Wireless Connection' feature of Ubuntu came to the rescue. Here's how it works:&lt;br /&gt;&lt;br /&gt;1) Enable wireless on your laptop&lt;br /&gt;2) Click on the network icon at the top-right corner&lt;br /&gt;3) Select 'Create New Wireless Connection'&lt;br /&gt;4) Enter the Network Name, Wireless Security (I used None) and a Key&lt;br /&gt;5) Ubuntu will try to immediately connect to this local Wireless network&lt;br /&gt;6) Your friends should now be able to connect to this newly created wireless network like they normally connect to any wireless network&lt;br /&gt;7) Connect to the internet the way you normally do (I connected using the USB device)&lt;br /&gt;&lt;br /&gt;That's it, using these simple steps multiple machines can use the same internet connection.&lt;br /&gt;&lt;br /&gt;Note: I used Ubuntu 10.10 with the default (Gnome) desktop environment.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-9098919178821432814?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/9098919178821432814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=9098919178821432814' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/9098919178821432814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/9098919178821432814'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2010/11/sharing-internet-connection-with-others.html' title='Sharing Internet Connection with Others using Ubuntu'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-1360279297670155323</id><published>2010-09-20T10:38:00.000-07:00</published><updated>2010-10-04T07:35:34.057-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RSA'/><category scheme='http://www.blogger.com/atom/ns#' term='blackberry'/><title type='text'>Using RSA Software Token with Blackberry</title><content type='html'>If you need to use RSA SecurID Software Token on your Blackberry phone, follow these steps:&lt;br /&gt;&lt;br /&gt;1) Download bb350.zip from ftp://ftp.rsasecurity.com/pub/agents/bb350.zip&lt;br /&gt;2) After unzipping, open the SecurIDTokenBlackBerry350_quickstart PDF document (under bb350\doc\English).&lt;br /&gt;3) Goto the section 'Use the Application Loader to Perform the Installation'. This method of installation worked for me.&lt;br /&gt;4) Once the installation completes. E-mail the sdtid (Token) provided to you by the administrator. Before mailing, prefix x-RIMDevicetoken to the filename (eg. x-RIMDevicetokenfilename.sdtid).&lt;br /&gt;5) Goto the attachment on your phone (do not open attachment) and select the "Import SecudID Token" option. Enter the password provided for the token.&lt;br /&gt;&lt;br /&gt;Thats it. When you start the RSA Application, it will automatically ask for the PIN and then display the OTP.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-1360279297670155323?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/1360279297670155323/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=1360279297670155323' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/1360279297670155323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/1360279297670155323'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2010/09/using-rsa-software-token-with.html' title='Using RSA Software Token with Blackberry'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-2723378937550585401</id><published>2010-09-09T22:48:00.000-07:00</published><updated>2010-09-09T22:59:21.154-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu 10.04'/><category scheme='http://www.blogger.com/atom/ns#' term='Volume Control'/><title type='text'>Adding Volume Conrol Icon to the Panel - Ubuntu 10.04</title><content type='html'>After upgrading to Ubuntu 10.04, the Volume control icon disappeared from the Panel (Gnome).&lt;br /&gt;&lt;br /&gt;To add it back, do the following:&lt;br /&gt;&lt;br /&gt;1) Goto System &gt; Preferences &gt; Startup Applications&lt;br /&gt;2) Click Add Button&lt;br /&gt;3) Enter "/usr/bin/gnome-volume-control-applet" as the Command&lt;br /&gt;4) Enter "Volume Control" (or whatever you like) as the name&lt;br /&gt;5) Click Add&lt;br /&gt;&lt;br /&gt;That's it. Next time you start Ubuntu, the Volume Control will start appearing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-2723378937550585401?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/2723378937550585401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=2723378937550585401' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/2723378937550585401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/2723378937550585401'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2010/09/adding-volume-conrol-icon-to-panel.html' title='Adding Volume Conrol Icon to the Panel - Ubuntu 10.04'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-7844696797450720616</id><published>2010-08-04T09:41:00.001-07:00</published><updated>2010-08-04T10:09:19.699-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='site performance'/><category scheme='http://www.blogger.com/atom/ns#' term='sysad'/><category scheme='http://www.blogger.com/atom/ns#' term='backend'/><title type='text'>Website Performance: Choose Data Center Carefully</title><content type='html'>Data center which hosts servers for a website plays a significant role in the performance of the website. There are few things which should be kept in mind before choosing a data center:&lt;br /&gt;&lt;br /&gt;1) Measuring distance in terms of hops is not the best approach. Latency is the accurate measure of speed on the internet and should be considered over the physical distance (hops). Thus, a data center closest to your customer might not be the fastest. Check latency of multiple data centers before choosing one. Latency can be tested by simply performing ping/traceroute tests to any server already hosted on the data center.&lt;br /&gt;&lt;br /&gt;2) Check latency from regions which represent majority of the website's audience locations. So, if your site will cater to a specific region (like a city or state) then measure latency from only that region. If your site caters to a distributed audience (throughout the country or across continents) then test the latency from regions where you expect the maximum traffic.&lt;br /&gt;&lt;br /&gt;3) Choose a ISP neutral data center. Data centers run by an ISP will perform really well with clients using the same ISP but might not be great when connecting with other ISPs.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-7844696797450720616?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/7844696797450720616/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=7844696797450720616' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/7844696797450720616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/7844696797450720616'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2010/08/website-performance-choose-data-center.html' title='Website Performance: Choose Data Center Carefully'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-6696885570085118492</id><published>2010-08-04T09:19:00.000-07:00</published><updated>2010-08-04T09:37:21.910-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='site performance'/><category scheme='http://www.blogger.com/atom/ns#' term='sysad'/><category scheme='http://www.blogger.com/atom/ns#' term='backend'/><title type='text'>Website Performance: Reverse Proxy for Spoon Feeding</title><content type='html'>When clients with slow internet connection request a page, the server holds on to the thread/process till the complete response is transferred. This results in resources holding up for longer than in cases where clients use fast connections.&lt;br /&gt;&lt;br /&gt;To handle this, a &lt;a href="http://en.wikipedia.org/wiki/Reverse_proxy"&gt;reverse proxy&lt;/a&gt; (like squid, nginx etc.) can be used in front of the web server. The web server will simply need to transfer content to the reverse proxy (which is super fast as they are on the same network).&lt;br /&gt;&lt;br /&gt;The reverse proxy takes the burden of transferring the response slowly and frees the web server immediately.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-6696885570085118492?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/6696885570085118492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=6696885570085118492' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/6696885570085118492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/6696885570085118492'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2010/08/website-performance-reverse-proxy-for.html' title='Website Performance: Reverse Proxy for Spoon Feeding'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-1827499818439300841</id><published>2010-08-04T09:04:00.000-07:00</published><updated>2010-08-04T09:16:44.590-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='site performance'/><category scheme='http://www.blogger.com/atom/ns#' term='sysad'/><category scheme='http://www.blogger.com/atom/ns#' term='backend'/><title type='text'>Website Performance: Web Server for Static Content</title><content type='html'>This approach is useful if you are not using a CDN to render static content (like js,css and images).&lt;br /&gt;&lt;br /&gt;Servers which are used for the application (like Apache or Tomcat) are great for requests which require execution of some code before rendering the page.&lt;br /&gt;&lt;br /&gt;There are a bunch of light weight web servers (like lighttpd, varnish and nginx) which are tuned to render static content really fast.&lt;br /&gt;&lt;br /&gt;There are a &lt;a href="http://www.joeandmotorboat.com/2008/02/28/apache-vs-nginx-web-server-performance-deathmatch/"&gt;bunch &lt;/a&gt;of benchmarking results out &lt;a href="http://www.howtoforge.com/benchmark-apache2-vs-lighttpd-static-html-files"&gt;there&lt;/a&gt;. You will see clear benefits when a page with multiple static objects is rendered with any of these light weight web servers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-1827499818439300841?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/1827499818439300841/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=1827499818439300841' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/1827499818439300841'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/1827499818439300841'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2010/08/website-performance-web-server-for.html' title='Website Performance: Web Server for Static Content'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-8067793674324080243</id><published>2010-08-04T08:40:00.000-07:00</published><updated>2010-08-04T08:59:15.106-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='site performance'/><category scheme='http://www.blogger.com/atom/ns#' term='backend'/><title type='text'>Website Performance: Delay Processing</title><content type='html'>When a page is requested from the server, process only what is necessary to generate the required output.&lt;br /&gt;&lt;br /&gt;Any additional processing that might be necessary can be delayed or performed asynchronously.&lt;br /&gt;&lt;br /&gt;Stuff like sending a an acknowledgement mail or logging are good candidates for delayed processing.&lt;br /&gt;&lt;br /&gt;One tool which helps you achieve this is &lt;a href="http://www.danga.com/gearman/"&gt;Gearman&lt;/a&gt;. Gearmand is a simple server which allows worker threads to register themselves for certain defined processes and clients can send processing requests to the Gearmand server. The Gearmand server queues up thsee requests and dispatches them to worker threads. Client and worker code can be in different languages. For delayed processing, use the asynchronous (do_background) call.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-8067793674324080243?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/8067793674324080243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=8067793674324080243' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/8067793674324080243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/8067793674324080243'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2010/08/website-performance-delay-processing.html' title='Website Performance: Delay Processing'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-5246062310854724294</id><published>2010-08-03T10:29:00.000-07:00</published><updated>2010-08-03T10:42:26.334-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='site performance'/><category scheme='http://www.blogger.com/atom/ns#' term='sysad'/><category scheme='http://www.blogger.com/atom/ns#' term='backend'/><title type='text'>Website Performance: Use CDN Effectively</title><content type='html'>In most cases, we consider using a CDN (like Akamai) for static content like images stylesheets and JavaScript whereas ignore it for the HTML content.&lt;br /&gt;&lt;br /&gt;Certain HTML might be cacheable. For example, if a certain HTML page changes every hour, for one hour it remains constant. It will be great if this page can be cached by the CDN somehow so that the first request from a region enables the CDN to cache it for the whole region.&lt;br /&gt;&lt;br /&gt;The CDN is configurable for your site. Once you access the configuration, there should be options like:&lt;br /&gt;1) Cache content on the edge server basis the cache headers sent by origin OR&lt;br /&gt;2) Cache certain file/folder/url for X minutes/hours&lt;br /&gt;&lt;br /&gt;It's imperative to understand and configure the CDN for optimal performance.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-5246062310854724294?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/5246062310854724294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=5246062310854724294' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/5246062310854724294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/5246062310854724294'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2010/08/website-performance-use-cdn-effectively.html' title='Website Performance: Use CDN Effectively'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-2378196048820651814</id><published>2010-08-03T04:40:00.000-07:00</published><updated>2010-08-03T10:24:40.404-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='caching'/><category scheme='http://www.blogger.com/atom/ns#' term='site performance'/><category scheme='http://www.blogger.com/atom/ns#' term='backend'/><title type='text'>Website Performance: Memory as the primary storage</title><content type='html'>We normally use databases/filesystems as the primary source of storage and add caching (Memory/RAM) to improve performance of the application.&lt;br /&gt;&lt;br /&gt;Consider the opposite approach. Use Memory  as the primary storage and file-system as a recovery source. So, perform all read and write operations directly in memory but log inserts/updates in file-system. The writes to file-system can be asynchronous (delayed inserts) and thus never become a bottleneck.&lt;br /&gt;&lt;br /&gt;This is a risky proposition and should be considered only if:&lt;br /&gt;1) The database operations are becoming a bottleneck and you have tried all possible optimizations. Only the problematic data sets should be considered for this approach.&lt;br /&gt;2) The data is non-critical i.e. it is acceptable even if the data is not available for certain time period. The time duration that this data will be unavailable will at least equal the recovery time from file-system.&lt;br /&gt;3) Typical database constraints (unique, foreign key etc.) do not apply to the data.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-2378196048820651814?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/2378196048820651814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=2378196048820651814' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/2378196048820651814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/2378196048820651814'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2010/08/website-performance-memory-as-primary.html' title='Website Performance: Memory as the primary storage'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-7013193142621619739</id><published>2010-08-02T09:50:00.000-07:00</published><updated>2010-08-02T10:10:36.847-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='caching'/><category scheme='http://www.blogger.com/atom/ns#' term='site performance'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><category scheme='http://www.blogger.com/atom/ns#' term='backend'/><title type='text'>Website Performance: Cache Database Query Results</title><content type='html'>Querying the database is an expensive operation and should be kept to a minimal.&lt;br /&gt;&lt;br /&gt;Certain databases provide query caching capabilities. MySQL's query cache is great for tables which are used primarily for read operations Any insert/update query clears the complete query cache for the table. Thus, query caching cannot be leveraged for tables requiring regular insert/update operations.&lt;br /&gt;&lt;br /&gt;Adding caching capabilities above the database layer can help boost performance. Before passing a read request to the database, an additional layer can check for appropriate content in the cache. If content is not available in the cache, request can be forwarded to the database and the cache populated before returning the result to application.&lt;br /&gt;&lt;br /&gt;The caching layer can also trap any insert/update operation so that the cache is up-to-date.&lt;br /&gt;&lt;br /&gt;If you are using Hibernate to persist your objects, the second level cache (and query cache) should be considered. They help achieve the same performance benefits using application level caching.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-7013193142621619739?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/7013193142621619739/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=7013193142621619739' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/7013193142621619739'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/7013193142621619739'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2010/08/website-performance-cache-database.html' title='Website Performance: Cache Database Query Results'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-1979782517344738582</id><published>2010-08-02T09:19:00.001-07:00</published><updated>2010-08-02T09:43:58.353-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='caching'/><category scheme='http://www.blogger.com/atom/ns#' term='site performance'/><category scheme='http://www.blogger.com/atom/ns#' term='backend'/><title type='text'>Website Performance: Cache HTML when possible</title><content type='html'>HTML content for a dynamic page is generated for each request made to the server. Though the page is dynamic (as it changes from time to time) there are 2 things which should be looked at:&lt;br /&gt;&lt;br /&gt;1) What is the frequency of change. Does the content change with each request or does it remain constant for some duration (15,30 mins?).&lt;br /&gt;2) If it remains constant for certain time-period, how much requests are made for the same content within that duration.&lt;br /&gt;&lt;br /&gt;Using a combination of this, caching the content (on server side) might be feasible.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;1) If the content is constant for 15 mins and only 2-3 requests are made for the same content within 15 mins, then caching is not of much benefit.&lt;br /&gt;2) If content is constant for even 5 mins, and 10 requests will be made for the same content in that time, caching will certainly be beneficial.&lt;br /&gt;&lt;br /&gt;Caching complete HTML can be expensive and if you do not have sufficient memory (RAM) to hold this data, it might be feasible to keep this data cached on the disk as well. If disk is chosen, then caching is beneficial only if the read operation from the disk is cheaper than actually generating the content dynamically :)&lt;br /&gt;&lt;br /&gt;When caching HTML, an appropriate cache clearing mechanism will have to be built so that stale content is never shown.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-1979782517344738582?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/1979782517344738582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=1979782517344738582' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/1979782517344738582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/1979782517344738582'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2010/08/website-performance-cache-html-when.html' title='Website Performance: Cache HTML when possible'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-6892541262588852639</id><published>2010-08-02T08:44:00.000-07:00</published><updated>2010-08-02T09:13:10.140-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='caching'/><category scheme='http://www.blogger.com/atom/ns#' term='site performance'/><category scheme='http://www.blogger.com/atom/ns#' term='memcache'/><category scheme='http://www.blogger.com/atom/ns#' term='backend'/><title type='text'>Website Performance: Choose Appropriate Cache</title><content type='html'>Caching plays a key role in speeding up a web application. Before looking at what and when to cache, some consideration should be given to the appropriate cache which is suitable for your environment.&lt;br /&gt;&lt;br /&gt;In case your application is deployed on a single server, then caching content on that server itself will suffice.&lt;br /&gt;&lt;br /&gt;For distributed architecture (application deployed on multiple servers), distributed cache should be used.&lt;br /&gt;&lt;br /&gt;Usually, the argument against a distributed cache is that it will involve accessing a remote machine which is expensive.&lt;br /&gt;&lt;br /&gt;Let's look at how expensive this operation is.&lt;br /&gt;&lt;br /&gt;Following are few interesting numbers picked from a presentation by Jedd Dean (from Google):&lt;br /&gt;&lt;br /&gt;Time taken to read 1 MB sequentially from memory - 250,000 ns (thats nano seconds)&lt;br /&gt;Time taken for round trip within the same data center - 500,000 ns&lt;br /&gt;&lt;br /&gt;So, reading 1 MB from a remote server's memory should take roughly 750,000 ns (0.75 ms).&lt;br /&gt;&lt;br /&gt;Considering that 1 second page load time is good enough, this is less than 1/1000th of the time. Thus, when we talk about web applications, reading from a remote server's memory will not degrade performance by any noticeable amount.&lt;br /&gt;&lt;br /&gt;When using a distributed cache, it's advisable to use a bit more than what is required. This ensures that failure of a single server does not overload the application.&lt;br /&gt;&lt;br /&gt;Example: If you need 4 GB of memory and you are using 4 servers (with 1 GB cache on each), add another (5th) server with 1 GB of memory for caching. This way, when 1 server goes down, the application performance will not get impacted much.&lt;br /&gt;&lt;br /&gt;One of the most popular distributed cache implementation is &lt;a href="http://memcached.org/"&gt;Memcached&lt;/a&gt;. It's used by companies like Wikipedia, Flickr, YouTube and Twitter.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-6892541262588852639?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/6892541262588852639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=6892541262588852639' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/6892541262588852639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/6892541262588852639'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2010/08/website-performancechoose-appropriate.html' title='Website Performance: Choose Appropriate Cache'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-2425154136301115473</id><published>2010-08-01T03:38:00.000-07:00</published><updated>2010-08-02T08:39:49.722-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='frontend'/><category scheme='http://www.blogger.com/atom/ns#' term='site performance'/><title type='text'>Website Performance: Don’t Let Third Parties Slow You Down</title><content type='html'>Recently a presentation was made by 2 Googlers (Arvind Jain and Michael Kleber) @ &lt;a href="http://en.oreilly.com/velocity2010"&gt;Velocity 2010&lt;/a&gt; where they talked abnout how &lt;a href="http://en.oreilly.com/velocity2010/public/schedule/detail/15412"&gt;third party code can slow a website&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Third party code (like Google ads, Digg widget etc.) usually includes an external script. Since browsers block rendering while fetching JavaScript, this third party code also blocks rendering of your page.&lt;br /&gt;&lt;br /&gt;Analyse your page with and without this third party component to understand the impact that it has on your site. &lt;br /&gt;&lt;br /&gt;If you have an option to choose from multiple vendors, then choose the one which has least impact on your page.&lt;br /&gt;&lt;br /&gt;Example: The new Google Analytics code loads JavaScript asynchronously to ensure minimal impact on page loading.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-2425154136301115473?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/2425154136301115473/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=2425154136301115473' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/2425154136301115473'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/2425154136301115473'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2010/08/dont-let-third-parties-slow-you-down.html' title='Website Performance: Don’t Let Third Parties Slow You Down'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-6139329613625105762</id><published>2010-08-01T01:22:00.001-07:00</published><updated>2010-08-01T02:05:57.963-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='frontend'/><category scheme='http://www.blogger.com/atom/ns#' term='caching'/><category scheme='http://www.blogger.com/atom/ns#' term='site performance'/><title type='text'>Website Performance: Separate Static from Dynamic</title><content type='html'>A dynamic page is one which can potentially change with each request to the server. But in most cases, there is also some content within these pages which does not change. This content remains static even when the dynamic elements change.&lt;br /&gt;&lt;br /&gt;Such static content within a dynamic page varies from application to application but mostly it's stuff like the header, footer, drop-down values (like city, state and country) etc.&lt;br /&gt;&lt;br /&gt;Analyse the dynamic page from this angle and come up with a list of static elements on it. If the static elements are considerable (like 30% of the content on a page) then consider separation. There are various techniques which can be used to cache the static elements on the browser.&lt;br /&gt;&lt;br /&gt;This approach is useful only when rendering similar layout repeatedly. So, if the same static content (header footer etc.) will be shown for multiple page requests, then separation of static from dynamic is feasible. Whereas, if the static portion changes for each request, there is not much to gain by separation, rather you will end up slowing the existing pages.&lt;br /&gt;&lt;br /&gt;Some of the techniques which can be used once the static and dynamic elements are separated:&lt;br /&gt;1) Ajax: A popular and commonly used technique for search result pages. The ajax request is made and only the results are updated whereas the layout remains constant.&lt;br /&gt;2) XSLT (XML+XSL): While requesting for a page, the static elements are embedded in the xsl file and the dynamic elements are fetched using a xml. The xsl can have cache headers defined so that the browser caches it. This is beneficial to the Ajax approach in cases where a new page request is to be made and the user leaves the current page to get content of a new dynamic page. Google for "Browser side XSLT" to get more details on this.&lt;br /&gt;3) HTML in JavaScript as string: This is a simple approach to add html snippets within JavaScript as string so that they can be rendered (inner html) wherever necessary. Not a particularly good design as you will need to add html (view) within the code (javascript).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-6139329613625105762?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/6139329613625105762/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=6139329613625105762' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/6139329613625105762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/6139329613625105762'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2010/08/website-performance-separate-static.html' title='Website Performance: Separate Static from Dynamic'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-6818121815923105796</id><published>2010-08-01T00:47:00.000-07:00</published><updated>2010-08-01T01:24:53.244-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='frontend'/><category scheme='http://www.blogger.com/atom/ns#' term='caching'/><category scheme='http://www.blogger.com/atom/ns#' term='site performance'/><title type='text'>Website Performance: Utilize Browser's Idle Time</title><content type='html'>Once the page loads completely, the user spends few seconds on the page before moving to the next one. The browser is idle during this time and can be used to speed performance of subsequent pages on the website.&lt;br /&gt;&lt;br /&gt;For example, in case of search results, it's highly likely that the user will move the the next page once he completes viewing results on the current page. Thus, developers can use intelligent javascript to pre-fetch content of the next page when the browser is idle. This will help the next page load much faster.&lt;br /&gt;&lt;br /&gt;Another condition for pre-fetching could be before launching a new version of the site.&lt;br /&gt;&lt;br /&gt;New version of a website usually has new static content (javascript, style sheets and images). When a regular user of the site opens this new version for the first time, he will find the site extremely slow. Thus, initially many customers complain about performance.&lt;br /&gt;&lt;br /&gt;If we start fetching the static content in the background couple of days before the launch of the new version, customers will not face the slowness and find the performance to be much better. Of course, care has to taken so that there is no clash in names of classes (CSS) and functions (JS).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-6818121815923105796?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/6818121815923105796/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=6818121815923105796' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/6818121815923105796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/6818121815923105796'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2010/08/utilize-browsers-idle-time.html' title='Website Performance: Utilize Browser&apos;s Idle Time'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-187325376634172670</id><published>2010-08-01T00:15:00.000-07:00</published><updated>2010-08-01T03:36:18.875-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='frontend'/><category scheme='http://www.blogger.com/atom/ns#' term='caching'/><category scheme='http://www.blogger.com/atom/ns#' term='site performance'/><title type='text'>Website Performance: Hosted JavaScript Libraries</title><content type='html'>Most web applications these days make use of Libraries like jQuery.&lt;br /&gt;&lt;br /&gt;These libraries offer significant advantages, but increase the initial page load time to a certain extent.&lt;br /&gt;&lt;br /&gt;Most popular libraries are widely hosted by companies like &lt;a href="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;Google &lt;/a&gt; and &lt;a href="http://ajax.microsoft.com/ajax/jquery/jquery-1.3.2.min.js"&gt;Microsoft&lt;/a&gt;. Instead of hosting these libraries yourself, it is feasible to include these libraries from  such common locations.&lt;br /&gt;&lt;br /&gt;When using the common location, chances are that the Browser has already cached the same URL and need not re-fetch the library for your site.&lt;br /&gt;&lt;br /&gt;All in all, it's a win-win situation for you:&lt;br /&gt;1) Saves bandwidth as you need not refer to your hosted library. In some cases this may save you some money.&lt;br /&gt;2) Page loads faster as browsers might already have the libraries cached.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://code.google.com/apis/libraries/"&gt;Google Libraries API&lt;/a&gt; provides a wrapper around the well known and widely used libraries (jQuery, Dojo, prototype, YUI etc.). Once included, you can directly load any popular library with a simple function call (example: google.load("jquery", "1.4.2"))&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-187325376634172670?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/187325376634172670/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=187325376634172670' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/187325376634172670'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/187325376634172670'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2010/08/hosted-javascript-libraries.html' title='Website Performance: Hosted JavaScript Libraries'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-9217277676088675029</id><published>2010-07-27T07:55:00.000-07:00</published><updated>2010-07-27T08:03:12.245-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='github'/><category scheme='http://www.blogger.com/atom/ns#' term='go'/><category scheme='http://www.blogger.com/atom/ns#' term='cruise'/><title type='text'>Setting up Go/Cruise 2 with github</title><content type='html'>I recently installed Cruise(now known as Go) Server to setup Continuation Integration for a project.&lt;br /&gt;&lt;br /&gt;I ran into some minor problems while configuring git as the VCS. Following are few tips to ensure that you don't face the same issues:&lt;br /&gt;&lt;br /&gt;1) Assuming that Git is installed under the default folder (C:\Program Files\Git), add C:\Program Files\Git\bin to System PATH (C:\Program Files\Git\cmd was already added but bin was not).&lt;br /&gt;2) Restart Cruise Server&lt;br /&gt;3) Use Git Read-Only URL (git://github.com/bagheera/getin.git). Initially I tried with SSH (git@github.com:bagheera/getin.git) which failed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-9217277676088675029?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/9217277676088675029/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=9217277676088675029' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/9217277676088675029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/9217277676088675029'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2010/07/setting-up-gocruise-2-with-github.html' title='Setting up Go/Cruise 2 with github'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-255047705731525084</id><published>2010-01-06T08:12:00.001-08:00</published><updated>2010-01-06T08:15:09.665-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='ext4'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>ext4 with Ubuntu 9.10</title><content type='html'>I was using Ubuntu 8.10 with ext3 as the file system type. The system performance was somewhat not up to the mark so I decided to install Ubuntu 9.10 with ext4 as the fs type. The overall system performance improved significantly after the installation.&lt;br /&gt;&lt;br /&gt;For example: The HUGE folders in thunderbird are now opening much faster than with Ubunti 8.10 + ext3.&lt;br /&gt;&lt;br /&gt;Till now i'm impressed with ext4 :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-255047705731525084?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/255047705731525084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=255047705731525084' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/255047705731525084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/255047705731525084'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2010/01/ext4-with-ubuntu-910.html' title='ext4 with Ubuntu 9.10'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-8704332867280476386</id><published>2009-09-14T22:07:00.000-07:00</published><updated>2009-09-14T22:25:51.718-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mail sync'/><category scheme='http://www.blogger.com/atom/ns#' term='exchange'/><category scheme='http://www.blogger.com/atom/ns#' term='thunderbird'/><category scheme='http://www.blogger.com/atom/ns#' term='IMAP'/><title type='text'>Syncing Thunderbird 2.0 mailbox with Blackberry for an Exchange account</title><content type='html'>My organization uses Microsoft Exchange as the Mail Server and a BES server to sync mails on my blackberry.&lt;br /&gt;&lt;br /&gt;The mailbox on server is allowed only 50 MB of space and thus I need to continuously delete mails on the server. Previously I used POP to fetch mails from Exchange to Thunderbird mail client but this had sync issues (mails were downloaded multiple times, the read/unread information was different on mobile and desktop) once I configured my Blackberry using BES.&lt;br /&gt;&lt;br /&gt;I recently shifted from POP to IMAP (had to get IMAP enabled from the administrator) and this has solved a number of problems.&lt;br /&gt;&lt;br /&gt;I've created filters which automatically shift few mails to the local folders and I manually move emails to local folders whenever required. The move operation does not automatically compact (delete emails on mailbox which were moved/deleted locally) folders but the following will make that happen:&lt;br /&gt;&lt;br /&gt;Goto Edit -&gt; Preferences -&gt; Advanced -&gt; General -&gt; Config Editor and then make the mail.imap.expunge_after_delete option as 'true'. Restart Thunderbird to use this config.&lt;br /&gt;&lt;br /&gt;Secondly, I wanted the sent mails to be saved on the 'Sent Items' folder on the Exchange Server's mailbox. This can be achieved by subscribing to the 'Sent Items' folder and placing a copy of send messages in the 'Sent Items' folder. To achieve this:&lt;br /&gt;&lt;br /&gt;1) Right click on the 'Inbox' for the IMAP account and click 'Subscribe'. Select the 'Sent Items' folder. You should now see the folder next to Inbox on the left panel.&lt;br /&gt;&lt;br /&gt;2) Goto Edit -&gt; Account Settings -&gt; Copies &amp; Folders and select 'Sent Items' as the Other folder under 'when sending messages, automatically' -&gt; 'Place a copy in'.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-8704332867280476386?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/8704332867280476386/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=8704332867280476386' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/8704332867280476386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/8704332867280476386'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2009/09/syncing-thunderbird-20-mailbox-with.html' title='Syncing Thunderbird 2.0 mailbox with Blackberry for an Exchange account'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-252605733688883542</id><published>2009-09-05T20:08:00.000-07:00</published><updated>2009-09-05T20:33:48.321-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mail setup'/><category scheme='http://www.blogger.com/atom/ns#' term='blackberry'/><category scheme='http://www.blogger.com/atom/ns#' term='BIS'/><title type='text'>Setting up your mail using BIS (Blackberry Internet Service)</title><content type='html'>Once you've opted for blackberry services, the provider will setup an account on blackberry.com for you. For example, I'm using an Airtel connection and I access my account on http://www.airtel.blackberry.com/.&lt;br /&gt;&lt;br /&gt;Once you log in, you'd probably want to add your official and personal e-mail. Setting up the email account is simple if you have a gmail account. Just enter your email address and password, it'll start delivering mails in minutes.&lt;br /&gt;&lt;br /&gt;For your official id (for non Blackberry Enterprise Server users), blackberry will first try to automatically get the settings after you enter the e-mail/password and if it succeeds, you won't have to enter any more detail. But this could be troublesome for some, as in my case I wanted to setup using OWA (Outlook Web Access) and it picked the POP settings. A workaround is to enter the right e-mail id and a wrong password, this will throw up the settings page where you can manually select which protocol you want to use.&lt;br /&gt;&lt;br /&gt;Lastly, I've noticed that mails sent to my gmail address are delivered instantly (using Push I guess) but mails sent to a POP or OWA account takes a few minutes to reach my phone. I guess if you are using Google for your official mails (http://www.google.com/apps/intl/en/business/index.html) then the delivery would be instant.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-252605733688883542?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/252605733688883542/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=252605733688883542' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/252605733688883542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/252605733688883542'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2009/09/setting-up-your-mail-using-bis.html' title='Setting up your mail using BIS (Blackberry Internet Service)'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-2078524837328313309</id><published>2009-08-26T05:47:00.000-07:00</published><updated>2009-08-26T05:49:37.044-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='php error'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>PHP Error after updating to 5.2.6 (Ubuntu 9.04)</title><content type='html'>After updating to PHP 5.2.6 using the update manager, I got the following error:&lt;br /&gt;&lt;br /&gt;php: symbol lookup error: /usr/lib/php5/20060613+lfs/pdo_mysql.so: undefined symbol: php_pdo_declare_long_constant&lt;br /&gt;&lt;br /&gt;To fix, I simply installed the php5-mysql package using Synaptic Package Manager.&lt;br /&gt;&lt;br /&gt;Reference: https://lists.ubuntu.com/archives/ubuntu-server-bugs/2009-February/009968.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-2078524837328313309?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/2078524837328313309/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=2078524837328313309' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/2078524837328313309'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/2078524837328313309'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2009/08/php-error-after-updating-to-526-ubuntu.html' title='PHP Error after updating to 5.2.6 (Ubuntu 9.04)'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-1686677773591665828</id><published>2009-07-19T00:25:00.000-07:00</published><updated>2009-07-19T00:45:11.989-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='migrate'/><category scheme='http://www.blogger.com/atom/ns#' term='thunderbird'/><category scheme='http://www.blogger.com/atom/ns#' term='outlook 2007'/><title type='text'>Migrating from Outlook 2007 to Thunderbird on Linux</title><content type='html'>I recently migrated to Thunderbird on Linux from Microsoft Outlook 2007 (on Windows XP).&lt;br /&gt;&lt;br /&gt;Following are the steps (should work for Outlook Express and older Outlook versions as well):&lt;br /&gt;&lt;br /&gt;1) Install Thunderbird on Windows (Yes! On Windows first).&lt;br /&gt;2) After installation go to 'Tools-&gt;Import'. Select Mails and then Outlook. This process might take some time and you should ensure that there is sufficient disk space available. Refer to http://kb.mozillazine.org/Moving_your_mail_storage_location_(Thunderbird) , if you want to change the location of Local Folders on Thunderbird.&lt;br /&gt;3) Note the location where Thunderbird keeps it's folders (Tools-&gt;Account Settings-&gt;Local Folders will show the location). Copy Local Folders to a USB/External Drive (if the current location is not accessible from Linux).&lt;br /&gt;4) On Linux, Install Thunderbird. Start Thunderbird. Configure your E-mail Account. Note the location where your local folders are located.&lt;br /&gt;5) Create a 'New Folder' under 'Local Folders'(say 'Import'). Create another sub-folder inside 'Import'.&lt;br /&gt;6) Go to the location where you can find the local folders. You should be able to locate the Import.sbd folder inside it.&lt;br /&gt;7) From the original location where you imported the Outlook mails using Windows Thunderbird, copy contents of the Outlook.sbd folder to the Import.sbd on linux.&lt;br /&gt;8) Ensure that the owner and permissions of all content under Import.sbd is appropriate (refer to the Inbox/Import folder/file permissions).&lt;br /&gt;9) Start Thunderburd.&lt;br /&gt;&lt;br /&gt;You should be able to see all your Outlook 2007 mails under the Import Folder. Initially they will all appear as un-read.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-1686677773591665828?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/1686677773591665828/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=1686677773591665828' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/1686677773591665828'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/1686677773591665828'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2009/07/migrating-from-outlook-2007-to.html' title='Migrating from Outlook 2007 to Thunderbird on Linux'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-5333512459973649332</id><published>2009-06-18T21:28:00.000-07:00</published><updated>2009-06-18T21:36:53.726-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='xcache. memory leak'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Memory leak in xcache extension of PHP</title><content type='html'>I recently encountered memory leak while using the xcache extension (version 1.2) with PHP 5.2.6.&lt;br /&gt;&lt;br /&gt;The following code confirms the memory leak:&lt;br /&gt;&lt;br /&gt;$data = "data";&lt;br /&gt;xcache_set("key",$data);&lt;br /&gt;while(1) {&lt;br /&gt;  $a = xcache_get("key");&lt;br /&gt;  echo "Memory Usage :".memory_get_usage()."\n";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This seems like a known issue and a worksround is suggested by oli at http://xcache.lighttpd.net/ticket/95 . Simply type-cast the data to a string while using xcache_set. The following works without any memory leak:&lt;br /&gt;&lt;br /&gt;$data = "data";&lt;br /&gt;xcache_set("key",(string)$data);&lt;br /&gt;while(1) {&lt;br /&gt;  $a = xcache_get("key");&lt;br /&gt;  echo "Memory Usage :".memory_get_usage()."\n";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Don't know the root cause of this issue but the workaround helped.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-5333512459973649332?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/5333512459973649332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=5333512459973649332' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/5333512459973649332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/5333512459973649332'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2009/06/memory-leak-in-xcache-extension-of-php.html' title='Memory leak in xcache extension of PHP'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-9219059863611055050</id><published>2009-06-09T10:42:00.001-07:00</published><updated>2009-06-09T10:55:02.344-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='firefox'/><category scheme='http://www.blogger.com/atom/ns#' term='chrome'/><category scheme='http://www.blogger.com/atom/ns#' term='browser'/><title type='text'>Browsers are getting faster!!</title><content type='html'>Google Chrome has raised the bar for browser speeds as far as rendering/javascript is concerned. Ever since it's launch, all other browsers are releasing newer and faster versions one by one.&lt;br /&gt;&lt;br /&gt;I recently tried the following browsers:&lt;br /&gt;&lt;br /&gt;1) Opera 9.64&lt;br /&gt;2) Chrome 1.0&lt;br /&gt;3) IE 8&lt;br /&gt;4) Firefox 3.5&lt;br /&gt;5) Safari 4&lt;br /&gt;&lt;br /&gt;Apart from IE 8 (whose javascript processing is awful) all the browsers are amazingly fast compared to their predecessors. I use to think that browsing was slow mainly because of the internet speed but it seems that the browser rendering speed has a major role to play.&lt;br /&gt;&lt;br /&gt;Firefox 3.5 version is beta as of now but the final release should be out soon. I kind of like Firefox because of the add-ons available with it. There's just about any kind of extension that you'd like.&lt;br /&gt;&lt;br /&gt;If given an option where all these browsers perform almost at par in terms of speed (5% here or there does not really matter) i'd use Firefox.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-9219059863611055050?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/9219059863611055050/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=9219059863611055050' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/9219059863611055050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/9219059863611055050'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2009/06/browsers-are-getting-faster.html' title='Browsers are getting faster!!'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-1787248713466649705</id><published>2009-06-03T09:48:00.001-07:00</published><updated>2009-06-03T09:54:56.786-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tagging'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Tagging pattern in an element of XML using PHP</title><content type='html'>Recently I had a requirement to tag a pattern within an element of the provided XML.&lt;br /&gt;&lt;br /&gt;Following code worked:&lt;br /&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;function replaceElementWithTaggedElement($doc, $element, $pattern, $tagNameForPattern)&lt;br /&gt;{&lt;br /&gt;$newElement = $doc-&amp;gt;appendChild(new domelement($element-&amp;gt;nodeName));&lt;br /&gt;&lt;br /&gt;$content = $element-&amp;gt;nodeValue;&lt;br /&gt;while(preg_match($pattern, $content, $matches, PREG_OFFSET_CAPTURE))&lt;br /&gt;{&lt;br /&gt;  $match = $matches[0][0];&lt;br /&gt;  $offset = $matches[0][1];&lt;br /&gt;  $firstPart = substr($content,0,$offset);&lt;br /&gt;  $secondPart = substr($content,$offset+strlen($match));&lt;br /&gt;  $newElement-&amp;gt;appendChild($doc-&amp;gt;createTextNode($firstPart));&lt;br /&gt;&lt;br /&gt;  $taggedElement = $doc-&amp;gt;createElement($tagNameForPattern);&lt;br /&gt;  $taggedElement-&amp;gt;appendChild($doc-&amp;gt;createTextNode($match));&lt;br /&gt;  $newElement-&amp;gt;appendChild($taggedElement);&lt;br /&gt;&lt;br /&gt;  $content = $secondPart;&lt;br /&gt;}&lt;br /&gt;$newElement-&amp;gt;appendChild($doc-&amp;gt;createTextNode($content));&lt;br /&gt;&lt;br /&gt;$element-&amp;gt;parentNode-&amp;gt;replaceChild($newElement, $element);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$doc = new DOMDocument();&lt;br /&gt;$doc-&amp;gt;loadXML(&amp;quot;&amp;lt;root&amp;gt;&amp;lt;one&amp;gt;This is the first text node&amp;lt;/one&amp;gt;&amp;lt;two&amp;gt;This is the second text node and the word to be highlighted is second&amp;lt;/two&amp;gt;&amp;lt;/root&amp;gt;&amp;quot;);&lt;br /&gt;$oldElement = $doc-&amp;gt;getElementsByTagName(&amp;quot;two&amp;quot;)-&amp;gt;item(0);&lt;br /&gt;&lt;br /&gt;replaceElementWithTaggedElement($doc, $oldElement, &amp;quot;/second/&amp;quot;, &amp;quot;tagged&amp;quot;);&lt;br /&gt;&lt;br /&gt;echo $doc-&amp;gt;saveXML();&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;br /&gt;OUTPUT&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;root&amp;gt;&amp;lt;one&amp;gt;This is the first text node&amp;lt;/one&amp;gt;&amp;lt;two&amp;gt;This is the &amp;lt;tagged&amp;gt;second&amp;lt;/tagged&amp;gt; text node and the word to be highlighted is &amp;lt;tagged&amp;gt;second&amp;lt;/tagged&amp;gt;&amp;lt;/two&amp;gt;&amp;lt;/root&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-1787248713466649705?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/1787248713466649705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=1787248713466649705' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/1787248713466649705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/1787248713466649705'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2009/06/tagging-pattern-in-element-of-xml-using.html' title='Tagging pattern in an element of XML using PHP'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-4221886931238949355</id><published>2009-04-18T03:09:00.000-07:00</published><updated>2009-04-18T03:21:27.248-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gearman'/><category scheme='http://www.blogger.com/atom/ns#' term='Net_Gearman'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Gearman Client and Worker with PHP</title><content type='html'>To write the Gearman client or worker in PHP there are 2 options available:&lt;br /&gt;&lt;br /&gt;1) Net_Gearman pear package: http://pear.php.net/package/Net_Gearman/download/0.1.1&lt;br /&gt;2) Gearman PHP Extension: http://www.gearman.org/doku.php?id=download&lt;br /&gt;&lt;br /&gt;As per my experiments, Net_Gearman does not processes all requests when multiple (more than 5) simultaneous clients are sending requests.&lt;br /&gt;&lt;br /&gt;The PHP extension available on gearman.org is better and initial tests are encouraging. &lt;br /&gt;&lt;br /&gt;I encourage using the Gearman server and library available on gearman.org as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-4221886931238949355?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/4221886931238949355/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=4221886931238949355' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/4221886931238949355'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/4221886931238949355'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2009/04/gearman-client-and-worker-with-php.html' title='Gearman Client and Worker with PHP'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-529061945502835789</id><published>2009-03-27T19:17:00.000-07:00</published><updated>2009-03-27T21:06:54.456-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='suggestion'/><category scheme='http://www.blogger.com/atom/ns#' term='pspell'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><category scheme='http://www.blogger.com/atom/ns#' term='custom dictionary'/><title type='text'>Keyword Suggestor in PHP 5</title><content type='html'>To add a feature like Google's Did You Mean in your PHP application a reasonable solution is to use PHP's pspell library.&lt;br /&gt;&lt;br /&gt;This comes bundled with PHP (&lt;a href="http://php.net/pspell"&gt;http://php.net/pspell&lt;/a&gt;). Compile PHP with the '--with-pspell' option but before this ensure that you have aspell (version 0.6 or above) already installed.&lt;br /&gt;&lt;br /&gt;Custom dictionary can also be created for aspell but this will require the aspell-lang package. You can download the same from &lt;a href="ftp://ftp.gnu.org/gnu/aspell/"&gt;here&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;Details on how to create your custom dictionary are available &lt;a href="http://www.indirecthit.com/2007/08/24/google-did-you-mean-on-search-pages-using-php-4/"&gt;here&lt;/a&gt; under the 'Creating a Custom Language Dictionary' section.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-529061945502835789?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/529061945502835789/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=529061945502835789' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/529061945502835789'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/529061945502835789'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2009/03/keyword-suggestor-in-php-5.html' title='Keyword Suggestor in PHP 5'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-9176658477842967250</id><published>2009-02-21T07:37:00.000-08:00</published><updated>2009-02-21T07:44:47.610-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gawk'/><category scheme='http://www.blogger.com/atom/ns#' term='field separator'/><title type='text'>Using multiple field separators with gawk</title><content type='html'>To define multiple field separators with gawk, set the FS variable with the appropriate regex. &lt;br /&gt;&lt;br /&gt;For example, to use comma(,), colon(:) and equal-to (=) as field separators, following can be used&lt;br /&gt;&lt;br /&gt;cat file.txt | gawk '{FS = "[:,=]+"} {print $3" "$5}' &lt;br /&gt;&lt;br /&gt;The above example also prints the 3rd and 5th field elements.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-9176658477842967250?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/9176658477842967250/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=9176658477842967250' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/9176658477842967250'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/9176658477842967250'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2009/02/using-multiple-field-separators-with.html' title='Using multiple field separators with gawk'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-2094557692367970330</id><published>2009-02-10T00:21:00.000-08:00</published><updated>2009-02-10T00:26:32.272-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='myisam'/><category scheme='http://www.blogger.com/atom/ns#' term='slow'/><category scheme='http://www.blogger.com/atom/ns#' term='huge table'/><title type='text'>Altering a HUGE MyISAM table in MySQL</title><content type='html'>I recently tried to alter a MyISAM table with appx. 300 million records (15 GB MYD size) having unique indexes and it took forever to execute (more than 20 days).&lt;br /&gt;&lt;br /&gt;Then, I came across &lt;a href="http://forum.percona.com/s/m/983/"&gt;this &lt;/a&gt;. The following suggestion simply rocks:&lt;br /&gt;&lt;br /&gt;- You can create table of the same structure without keys, &lt;br /&gt;- load data into it to get correct .MYD, &lt;br /&gt;- Create table with all keys defined and copy over .frm and .MYI files from it,&lt;br /&gt;- followed by FLUSH TABLES. &lt;br /&gt;- Now you can use REPAIR TABLE to rebuild all keys by sort, including UNIQUE keys.&lt;br /&gt;&lt;br /&gt;The alter completed within 5 hours flat. Just incredible!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-2094557692367970330?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/2094557692367970330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=2094557692367970330' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/2094557692367970330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/2094557692367970330'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2009/02/altering-huge-myisam-table-in-mysql.html' title='Altering a HUGE MyISAM table in MySQL'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-7387336108257074765</id><published>2009-02-01T21:04:00.001-08:00</published><updated>2009-02-01T21:11:04.629-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='google calendar'/><title type='text'>Google Calendar - Mobile Setup</title><content type='html'>I recently tried the Mobile Setup provided by Google Calendar and thought of sharing it.&lt;br /&gt;&lt;br /&gt;After you login to Google Calendar (http://calendar.google.com/) click on the Settings-&gt;Mobile Setup Tab. Enter your mobile number and validate your number.&lt;br /&gt;&lt;br /&gt;Once done, you can now ask Google Calendar to send Event Reminders through SMS (For free):&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_IKxN1Y97DHg/SYaASsPe3JI/AAAAAAAABew/dEXm17SQ-KQ/s1600-h/cal.bmp"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 400px; height: 94px;" src="http://1.bp.blogspot.com/_IKxN1Y97DHg/SYaASsPe3JI/AAAAAAAABew/dEXm17SQ-KQ/s400/cal.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5298063070250065042" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This is a fantastic feature and will remind you of calendar events even if you are away from your Desktop and do not have a PDA/Smartphone to sync your calendar.&lt;br /&gt;&lt;br /&gt;For MS Outlook users, Google also provides a Calendar Sync feature (http://www.google.com/support/calendar/bin/answer.py?answer=98563) which will keep your Google and Outlook calendar in sync.&lt;br /&gt;&lt;br /&gt;Thus, you can now get SMS before any personal or official event :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-7387336108257074765?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/7387336108257074765/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=7387336108257074765' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/7387336108257074765'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/7387336108257074765'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2009/02/google-calendar-mobile-setup.html' title='Google Calendar - Mobile Setup'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_IKxN1Y97DHg/SYaASsPe3JI/AAAAAAAABew/dEXm17SQ-KQ/s72-c/cal.bmp' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-8039114321428867717</id><published>2009-02-01T00:21:00.000-08:00</published><updated>2009-02-01T00:41:39.036-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='blackberry'/><title type='text'>Which Blackberry is the best?</title><content type='html'>There are a bunch off new Blackberries in the market these days. I'll take a look at each and give my views:&lt;br /&gt;&lt;br /&gt;* Blackberry Bold (Powerful)&lt;br /&gt;   This is a power-packed Blackberry. It supports almost all the wireless protocols out there including WiFi and 3G. The screen resolution is equivalent to an iPhone even though the screen size is smaller and thus gives a very clear view. The processor and memory of this phone is better than any other blackberry (it will respond faster to your commands compared to other blackberries). The only negative aspect I can think of is the size. It's bigger than the 8900 or the pearl and will need a bigger pocket to go into.&lt;br /&gt;&lt;br /&gt;* Blackberry Storm (Touch Screen)&lt;br /&gt;   After viewing the commercials, I was really exited about this phone. It was suppose to give serious competition to the iPhone as it is a blackberry with the touch screen. But sadly after going through few videos in YouTube it seems that the Storm lacks in power and has a slow response time. Moving through pictures/videos can be a pain. I would not like a smartphone which is slow.&lt;br /&gt;&lt;br /&gt;* Blackberry Pearl Flip&lt;br /&gt;   When the original pearl was launched it was clearly a winner. The blackberry which is not FAT and fits in your hand comfortably. With the Flip, RIM has taken Pearl to the next level. So, if you want a sleek/small blackberry, then this is THE one for you. But you will have to compromise on the performance and screen quality if you settle for this one.&lt;br /&gt;&lt;br /&gt;* Blackberry 8900 (Javelin)&lt;br /&gt;   This one comes really close to the Bold and will probably win if you consider the size. It's smaller than the Bold and has those curves which you will love. It has Wifi but no 3G. If you can compromise a bit on power and are not particular about having a 3G smartphone, then this is the one for you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-8039114321428867717?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/8039114321428867717/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=8039114321428867717' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/8039114321428867717'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/8039114321428867717'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2009/02/which-blackberry-is-best.html' title='Which Blackberry is the best?'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-3925496373736512567</id><published>2009-01-06T20:48:00.000-08:00</published><updated>2009-01-06T20:57:29.183-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C Server'/><category scheme='http://www.blogger.com/atom/ns#' term='handle zombie'/><title type='text'>Sample C Server which handles zombie processes</title><content type='html'>After a bit of googling I managed to create a simple Server (written in C) which accepts connection on port 5000 and spawns a new thread to handle each request:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;#include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;#include &amp;lt;sys/socket.h&amp;gt;&lt;br /&gt;#include &amp;lt;netinet/in.h&amp;gt;&lt;br /&gt;#include &amp;lt;netdb.h&amp;gt;&lt;br /&gt;#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;&lt;br /&gt;#define MAX_CLIENT    10&lt;br /&gt;&lt;br /&gt;void zombie_handler(int iSignal)&lt;br /&gt;{&lt;br /&gt;        signal(SIGCHLD,zombie_handler); //reset handler to catch SIGCHLD for next time;&lt;br /&gt;        int status;&lt;br /&gt;        pid_t pid;&lt;br /&gt;&lt;br /&gt;        pid = wait(&amp;amp;status); //After wait, child is definitely freed.&lt;br /&gt;        printf(&amp;quot;pid = %d , status = %d\n&amp;quot;, pid, status);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main(int argc, char *argv[])&lt;br /&gt;{&lt;br /&gt;        int tcp_sockfd, k, portno=0, tcp_newsockfd, n;&lt;br /&gt;        struct sockaddr_in myServer, myClient;&lt;br /&gt;        char bufferin[256],bufferout[256],ipaddress[20],hostname[50];&lt;br /&gt;        char s[INET6_ADDRSTRLEN];&lt;br /&gt;        struct hostent *host;&lt;br /&gt;        pid_t pid=-1;&lt;br /&gt;&lt;br /&gt;        signal(SIGCHLD,zombie_handler);&lt;br /&gt;&lt;br /&gt;        //////////////////// Create a TCP Socket and get the port number dynamically&lt;br /&gt;&lt;br /&gt;        tcp_sockfd = socket(AF_INET, SOCK_STREAM, 0);&lt;br /&gt;        if (tcp_sockfd &amp;lt; 0)&lt;br /&gt;                error(&amp;quot;ERROR opening TCP socket&amp;quot;);&lt;br /&gt;&lt;br /&gt;        bzero((char *) &amp;amp;myServer, sizeof(myServer));&lt;br /&gt;        myServer.sin_family = AF_INET;&lt;br /&gt;        myServer.sin_addr.s_addr = htonl(INADDR_ANY);&lt;br /&gt;        myServer.sin_port = htons(5000);&lt;br /&gt;        if (bind(tcp_sockfd, (struct sockaddr *) &amp;amp;myServer, sizeof(myServer)) &amp;lt; 0)&lt;br /&gt;                error(&amp;quot;ERROR on binding&amp;quot;);&lt;br /&gt;&lt;br /&gt;        portno = ntohs(myServer.sin_port);&lt;br /&gt;&lt;br /&gt;        if(gethostname(hostname,50) == -1)                                              // get hostname of the chat server machine&lt;br /&gt;                error(&amp;quot;ERROR on gethostname&amp;quot;);&lt;br /&gt;        host = gethostbyname(hostname);                                                 // get host information&lt;br /&gt;        strcpy(ipaddress,(char *)inet_ntoa(*(long*)host-&amp;gt;h_addr_list[0]));              //get IP Address string format&lt;br /&gt;&lt;br /&gt;        printf(&amp;quot;Chat Server IP Address : %s\n&amp;quot;,ipaddress);&lt;br /&gt;        printf(&amp;quot;Chat Server Port Number : %d\n&amp;quot;,portno);&lt;br /&gt;&lt;br /&gt;//////////////////////////////////////// Now wait for connection from Client&lt;br /&gt;        if(listen(tcp_sockfd,MAX_CLIENT) == -1)&lt;br /&gt;                error(&amp;quot;ERROR on listen&amp;quot;);&lt;br /&gt;&lt;br /&gt;        while(1)&lt;br /&gt;        {&lt;br /&gt;                printf(&amp;quot;Waiting for connection...\n&amp;quot;);&lt;br /&gt;                k=sizeof(myClient);&lt;br /&gt;                tcp_newsockfd = accept(tcp_sockfd,(struct sockaddr *)&amp;amp;myClient,&amp;amp;k);&lt;br /&gt;                if (tcp_newsockfd == -1) {&lt;br /&gt;                        printf(&amp;quot;error in accept\n&amp;quot;);&lt;br /&gt;                        continue;&lt;br /&gt;                }&lt;br /&gt;&lt;br /&gt;                if (!fork()) { // this is the child process&lt;br /&gt;                        close(tcp_sockfd); // child doesn't need the listener&lt;br /&gt;                        if (send(tcp_newsockfd, &amp;quot;Hello, world!&amp;quot;, 13, 0) == -1)&lt;br /&gt;                                perror(&amp;quot;send&amp;quot;);&lt;br /&gt;                        close(tcp_newsockfd);&lt;br /&gt;                        exit(0);&lt;br /&gt;                }&lt;br /&gt;                close(tcp_newsockfd);  // parent doesn't need this&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;        close(tcp_sockfd);&lt;br /&gt;&lt;br /&gt;        return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here I simply write a string (Hello World!) to the client. You may perform multiple reads/writes.&lt;br /&gt;&lt;br /&gt;The zombie_handler function ensures that no zombie processes are created once the child exists.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-3925496373736512567?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/3925496373736512567/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=3925496373736512567' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/3925496373736512567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/3925496373736512567'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2009/01/sample-c-server-which-handles-zombie.html' title='Sample C Server which handles zombie processes'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-580794019873260566</id><published>2008-12-05T01:40:00.000-08:00</published><updated>2010-03-05T00:08:53.120-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='lightning'/><category scheme='http://www.blogger.com/atom/ns#' term='calendar'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu 8.10'/><title type='text'>Getting Lightning to work with Ubuntu 8.10</title><content type='html'>The Lightning extension(0.9) of Thunderbird(2.0.0.18) does not work appropriately on Ubuntu 8.10 .&lt;br /&gt;&lt;br /&gt;The primary reason is that Lightning works best with libstdc++5 whereas Ubuntu 8.10 comes with libstdc++6.&lt;br /&gt;&lt;br /&gt;Following steps will help fix this:&lt;br /&gt;&lt;br /&gt;1) sudo apt-get install libstdc++5&lt;br /&gt;2) Un-install the Lightning Extension of Thunderbird&lt;br /&gt;3) Re-install Lightning&lt;br /&gt;&lt;br /&gt;Update: The first step fails with Ubuntu 9.10. Install libstdc++5 using the instructions &lt;a href="http://hsmak.wordpress.com/2009/12/01/how-to-fix-libstdc5-dependency-problem-in-ubuntu-9-10/"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-580794019873260566?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/580794019873260566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=580794019873260566' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/580794019873260566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/580794019873260566'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2008/12/getting-lightning-to-work-with-ubuntu.html' title='Getting Lightning to work with Ubuntu 8.10'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-438017385492709162</id><published>2008-11-04T07:43:00.000-08:00</published><updated>2008-11-04T07:58:25.603-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='resize partition'/><category scheme='http://www.blogger.com/atom/ns#' term='gparted'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Resize ntfs partition to install Ubuntu 8.10</title><content type='html'>I recently tried to upgrade Ubuntu 8.04 to 8.10 on my PC but the installation failed due to insufficient disk space under the /boot partition. 8.10 needs about 120 MB free space but I had only 60 MB free under /boot. &lt;br /&gt;&lt;br /&gt;To expand the /boot (second) partition, I had to shrink the first partition which was (unfortunately) ntfs. The gparted (disk partition tool for linux/ubuntu) installed on 8.04 wasn't of much help as it only supports deletion or formating of ntfs partitions.&lt;br /&gt;&lt;br /&gt;I got a Ubuntu 8.10 installation CD and booted my PC using the same. The gparted utility on 8.10 supports resize of ntfs partitions :) . I successfully shrunk the ntfs partition and expanded the second (/boot) partition.&lt;br /&gt;&lt;br /&gt;After restarting the system with the installed Ubuntu 8.04 version, the upgrade started successfully.&lt;br /&gt;&lt;br /&gt;Note: Before attempting resize of any partition, do backup your critical data.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-438017385492709162?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/438017385492709162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=438017385492709162' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/438017385492709162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/438017385492709162'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2008/11/resize-ntfs-partition-to-install-ubuntu.html' title='Resize ntfs partition to install Ubuntu 8.10'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-412042307052029456</id><published>2008-11-04T07:27:00.000-08:00</published><updated>2008-11-04T07:40:12.856-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fan error'/><category scheme='http://www.blogger.com/atom/ns#' term='R60'/><category scheme='http://www.blogger.com/atom/ns#' term='thinkpad'/><title type='text'>"Fan Error" - ThinkPad</title><content type='html'>My laptop is about 2 years old and it was working perfectly fine till today morning. While booting (after the bios loaded) it displayed "Fan Error" and the system automatically shut down. I started the system a number of times but the same error kept occurring.&lt;br /&gt;&lt;br /&gt;There was some weird sound coming from the Fan. I guess the Fan must've got stuck due to dust or something. I tapped (quite hard) the laptop from the side a couple of times and surprisingly it started working :)&lt;br /&gt;&lt;br /&gt;If you get a similar problem then try this at your OWN risk coz the situation might worsen. Eventually, I guess the fan will have to be replaced but if at all you get it working for once, do take backup of critical data immediately (I did).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-412042307052029456?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/412042307052029456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=412042307052029456' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/412042307052029456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/412042307052029456'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2008/11/fan-error-thinkpad.html' title='&quot;Fan Error&quot; - ThinkPad'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-3653282803233845977</id><published>2008-11-02T20:18:00.000-08:00</published><updated>2008-11-02T20:36:26.668-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='static content'/><category scheme='http://www.blogger.com/atom/ns#' term='app.yaml'/><category scheme='http://www.blogger.com/atom/ns#' term='google app engine'/><category scheme='http://www.blogger.com/atom/ns#' term='gae'/><title type='text'>Configuring app.yaml for static websites</title><content type='html'>In case you want to publish a static website on Google App Engine (http://appengine.google.com/) then the following configuration can be used (app.yaml):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;application: appname&lt;br /&gt;version: 1&lt;br /&gt;api_version: 1&lt;br /&gt;runtime: python&lt;br /&gt;&lt;br /&gt;handlers:&lt;br /&gt;- url: /(.*)&lt;br /&gt;  static_files: static/\1&lt;br /&gt;  upload: static/(.*)&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This assumes the following:&lt;br /&gt;&lt;br /&gt;1) The application name is appname (change it to your registered application name on appengine.google.com)&lt;br /&gt;2) All static pages are under the static directory (appname/static)&lt;br /&gt;&lt;br /&gt;This works fine, but any request to http://appname.appspot.com/ (or another domain in case you are using Google Apps) will not automatically be redirected to http://appname.appspot.com/index.htm (or index.html). In case you want such a behavior, create a python script (like main.py) under the application directory (appname/) with the following content:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import cgi&lt;br /&gt;&lt;br /&gt;from google.appengine.ext import webapp&lt;br /&gt;from google.appengine.ext.webapp.util import run_wsgi_app&lt;br /&gt;&lt;br /&gt;class MainPage(webapp.RequestHandler):&lt;br /&gt;  def get(self):&lt;br /&gt;    self.redirect('/index.htm')&lt;br /&gt;&lt;br /&gt;application = webapp.WSGIApplication(&lt;br /&gt;                                     [('/', MainPage)],&lt;br /&gt;                                     debug=True)&lt;br /&gt;&lt;br /&gt;def main():&lt;br /&gt;  run_wsgi_app(application)&lt;br /&gt;&lt;br /&gt;if __name__ == "__main__":&lt;br /&gt;  main()&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;and change the app.yaml to:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;application: appname&lt;br /&gt;version: 1&lt;br /&gt;api_version: 1&lt;br /&gt;runtime: python&lt;br /&gt;&lt;br /&gt;handlers:&lt;br /&gt;- url: /&lt;br /&gt;  script: main.py&lt;br /&gt;&lt;br /&gt;- url: /(.*)&lt;br /&gt;  static_files: static/\1&lt;br /&gt;  upload: static/(.*)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-3653282803233845977?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/3653282803233845977/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=3653282803233845977' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/3653282803233845977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/3653282803233845977'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2008/11/configuring-appyaml-for-static-websites.html' title='Configuring app.yaml for static websites'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-6590045684380186595</id><published>2008-07-12T08:47:00.000-07:00</published><updated>2008-07-12T09:00:14.659-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='cache'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><title type='text'>Pre-populate cache for faster performance</title><content type='html'>Recently I came across a scenario where load had to be shifted from an existing database server to a newer (faster) machine. This is usually not a problem but the challenge this time was to do this during peak-load. &lt;br /&gt;&lt;br /&gt;I tried to shift queries to the new server a number of times, but found the load shooting up each time. Thus, the queries had to be shifted back to the old machine.&lt;br /&gt;&lt;br /&gt;After a bit of investigation it was found that since the new server had not cached the database contents, it lead to high load and thus the server response time dropped drastically. To overcome this, I used a small trick. I cached the database contents (at least the indexes) before sending the queries back to the new server. To pre-populate the cache (RAM), use the following:&lt;br /&gt;&lt;br /&gt;cat TABLE_FILES &gt; /dev/null&lt;br /&gt;&lt;br /&gt;(Considering that TABLE_FILES are the file names which contain the data/index)&lt;br /&gt;&lt;br /&gt;This will make the OS read complete contents of the desired files and dump the output to /dev/null. Certainly this is useful only if your data/index size is less than RAM.&lt;br /&gt;&lt;br /&gt;After this, the new machine worked like a breeze and there was no significant i/o.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-6590045684380186595?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/6590045684380186595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=6590045684380186595' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/6590045684380186595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/6590045684380186595'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2008/07/pre-populate-cache-for-faster.html' title='Pre-populate cache for faster performance'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-2408065653074918800</id><published>2008-05-26T10:02:00.001-07:00</published><updated>2008-05-26T10:06:50.953-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='memory'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><title type='text'>More memory does not necessarily mean more speed</title><content type='html'>If the processor waits for i/o most of the time then adding more Primary Memory (RAM) usually helps. But before that decision is made, there are a few important things to look at:&lt;br /&gt;&lt;br /&gt;1) What is the total data size that can be accessed?&lt;br /&gt;2) How much data is accessed multiple times (at least more than once)? And how much Memory does this data require?&lt;br /&gt;&lt;br /&gt;If the total data size is only a couple of gigs then you can probably think of having equivalent amount of Memory. But if the data size is tens or hundreds of gigabytes then adding that much Memory will certainly be very expensive. &lt;br /&gt;&lt;br /&gt;Lets consider a case where the a database instance stores 200 GB of data. Out of this, only 4 GB is accessed multiple times in day and the rest might be accessed only once. In such a scenario, anything above 6 GB (the extra memory for kernel and other processes, if any) should be of no help because every time that extra data (other than the 4 GB) is accessed, the CPU &lt;span style="font-weight:bold;"&gt;has&lt;/span&gt; to wait for the disk i/o to complete.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-2408065653074918800?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/2408065653074918800/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=2408065653074918800' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/2408065653074918800'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/2408065653074918800'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2008/05/more-memory-does-not-necessarily-mean.html' title='More memory does not necessarily mean more speed'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-1906577006272126299</id><published>2008-05-24T03:11:00.000-07:00</published><updated>2008-05-24T03:19:37.538-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='apache logs'/><title type='text'>Parsing apache logs to identify IP with max requests</title><content type='html'>To find out the IP Addresses which generated the maximum number of requests, following Linux command can be used:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;gawk {'print $1'} access_log | sort -n | uniq -d -c | sort -n&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Note: This assumes that you're logging the IP Address in the first column&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-1906577006272126299?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/1906577006272126299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=1906577006272126299' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/1906577006272126299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/1906577006272126299'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2008/05/parsing-apache-logs-to-identify-ip-with.html' title='Parsing apache logs to identify IP with max requests'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-4709919317435632281</id><published>2008-04-12T06:45:00.000-07:00</published><updated>2008-04-12T06:51:35.422-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='website architecture'/><category scheme='http://www.blogger.com/atom/ns#' term='scaling'/><title type='text'>Scaling Up Vs Scaling Out</title><content type='html'>You've got the website up and running, your clients love it, more and more people want to use it. Everything seems to be going great. One fine day you realize that your systems are getting chocked and clients have started complaining. You keep adding new machines to your environment (doing quick-fixes in the application to support this distributed architecture) and believe that this scaling-out approach is the right way to move forward (after all, the big guys like google n yahoo have thousands of machines). After a couple of years, there are 10s (or probably 100s) of machines serving your website traffic and the infrastructure, administration etc. costs have gone up considerably. And due to the quick-fixes, its really difficult to work on a new clean architecture and add more features to your application.&lt;br /&gt;&lt;br /&gt;Lets consider what Googles got and how the scaling-out approach works great for them:&lt;br /&gt;&lt;br /&gt;1) Possibly the best Engineers in the world&lt;br /&gt;2) Google File System (GFS)&lt;br /&gt;3) Map-Reduce&lt;br /&gt;4) An infrastructure where you can treat a server class machine like a plug-n-play device&lt;br /&gt;5) Applications which are designed keeping GFS and MapReduce in mind&lt;br /&gt;... and god knows what else&lt;br /&gt;&lt;br /&gt;If you've got anything close to this, then scaling-out is the obvious answer. Otherwise, read on...&lt;br /&gt;&lt;br /&gt;There are 3 major components to consider while choosing a Server:&lt;br /&gt;&lt;br /&gt;1) CPUs&lt;br /&gt;2) Primary Memory (RAM)&lt;br /&gt;3) RAID configuration (RAID 0, RAID 1, RAID 5 etc.)&lt;br /&gt;&lt;br /&gt;A server has certain limitations in terms of the amount of Memory and number of CPUs it can hold. (mid-level, server class systems come with support of up to 32 GB memory and 4 CPUs). Adding more CPU or Memory becomes very expensive after this. So, there is linear cost of adding more memory and CPU to a certain extent and after that it becomes exponential. &lt;br /&gt;&lt;br /&gt;Example: Lets say you've got a 100 GB database. It works comfortably with a 16 GB(expandable upto 32GB) RAM, 2-CPU Server. Once the database size goes up and the users increase, this single server might not be able to handle the load. The option is either to increase RAM (most database servers need more memory and not CPU power) or add another machine. The economical solution will probably be to add more RAM (addition of another 16 GB memory will cost significantly less than what a new server would). After a certain point addition of RAM might be more costly than adding a new server and thus the better option is to scale-out at this point.&lt;br /&gt;&lt;br /&gt;The key is to scale-up till the cost is linear and side-by-side start work on the Application architecture such that you can run your application smoothly on multiple servers and scale-out thereafter.&lt;br /&gt;&lt;br /&gt;Choosing the right RAID configuration is also important, it depends on what operation you perform the most (read, write or read+write). I'm not an expert in RAID configurations so do a bit of googling and you'll get a number of articles on this.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-4709919317435632281?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/4709919317435632281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=4709919317435632281' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/4709919317435632281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/4709919317435632281'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2008/04/scaling-up-vs-scaling-out.html' title='Scaling Up Vs Scaling Out'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-4803965484290691292</id><published>2008-02-29T02:38:00.001-08:00</published><updated>2008-02-29T03:32:24.367-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='xdebug'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><category scheme='http://www.blogger.com/atom/ns#' term='profiling'/><title type='text'>Profiling PHP code with xdebug</title><content type='html'>Using xdebug to profile php code is very simple.&lt;br /&gt;&lt;br /&gt;Following are the steps to get started:&lt;br /&gt;&lt;br /&gt;1) Install the xdebug extension (http://xdebug.org/docs/install) for PHP.&lt;br /&gt;2) Enable profiling for any PHP which gets executed by setting xdebug.profiler_enable=1 in php.ini&lt;br /&gt;3) Restart the Apache Server&lt;br /&gt;&lt;br /&gt;From now on, whenever you execute a PHP, files with name starting from cachegrind.out will be created under the /tmp directory.&lt;br /&gt;&lt;br /&gt;4) Install kcachegrind (http://kcachegrind.sourceforge.net/)&lt;br /&gt;5) start kcachegrind with the cachegrind.out file as the parameter (eg. kcachegrind cachegrind.out.12345)&lt;br /&gt;6) Set xdebug.profiler_enable=0 in php.ini to disable profiling.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-4803965484290691292?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/4803965484290691292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=4803965484290691292' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/4803965484290691292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/4803965484290691292'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2008/02/profiling-php-code-with-xdebug.html' title='Profiling PHP code with xdebug'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-1454331252430994922</id><published>2008-02-20T21:05:00.000-08:00</published><updated>2008-02-20T21:10:23.384-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='file'/><category scheme='http://www.blogger.com/atom/ns#' term='size'/><category scheme='http://www.blogger.com/atom/ns#' term='average'/><title type='text'>Average file size within a directory</title><content type='html'>To calculate the average file size within a directory on a Linux system, following command can be used:&lt;br /&gt;&lt;br /&gt;ls -l | gawk '{sum += $5; n++;} END {print sum/n;}'&lt;br /&gt;&lt;br /&gt;If you'd like to know the average size of some particular kind of files (like jpg files) then use the following:&lt;br /&gt;&lt;br /&gt;ls -l *.jpg | gawk '{sum += $5; n++;} END {print sum/n;}'&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-1454331252430994922?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/1454331252430994922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=1454331252430994922' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/1454331252430994922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/1454331252430994922'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2008/02/average-file-size-within-directory.html' title='Average file size within a directory'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-6854517398967906743</id><published>2008-02-11T09:43:00.000-08:00</published><updated>2008-02-11T10:12:58.540-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='filter'/><category scheme='http://www.blogger.com/atom/ns#' term='spam'/><category scheme='http://www.blogger.com/atom/ns#' term='gmail'/><title type='text'>Gmail Spam Filter</title><content type='html'>I've been using Yahoo Mail, Hotmail and Gmail for few years now. Out of these, Gmail certainly has the most effective spam filter and keeps junk out of your Inbox. &lt;br /&gt;&lt;br /&gt;The sad part is that at times it even marks some of the important mails as spam and thus you have to keep checking the spam filter regularly.&lt;br /&gt;&lt;br /&gt;Few points to keep in mind if you use gmail:&lt;br /&gt;&lt;br /&gt;* One way to reduce the chances of important mails being marked as spam is to add to your contact list the addresses from where you expect to receive mails.&lt;br /&gt;&lt;br /&gt;* When you send out a mail to some address, then Gmail automatically adds that id to your contact list and thus Gmail should never mark any mail from that id as spam.&lt;br /&gt;&lt;br /&gt;* If you download mails using POP, the Spam mails will never get downloaded (which is great in a way). Thus, you will always have to login using the web interface to check mails marked as Spam.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-6854517398967906743?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/6854517398967906743/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=6854517398967906743' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/6854517398967906743'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/6854517398967906743'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2008/02/gmail-spam-filter.html' title='Gmail Spam Filter'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-8945276446942713651</id><published>2008-02-06T21:00:00.000-08:00</published><updated>2008-02-06T21:02:20.075-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rewrite'/><category scheme='http://www.blogger.com/atom/ns#' term='apache'/><category scheme='http://www.blogger.com/atom/ns#' term='redirect'/><title type='text'>Apache ReWrite Module</title><content type='html'>Apache has a very powerful tool (mod_rewrite) which can be used to redirect/rewrite requested URLs on the fly.&lt;br /&gt;&lt;br /&gt;To use this module, you can configure apache with the '--enable-rewrite' option before compilation. Then, set 'RewriteEngine on' in the httpd.conf to start using it.&lt;br /&gt;&lt;br /&gt;For complete details, please go to http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html.&lt;br /&gt;&lt;br /&gt;I will give a brief example which redirects all requests on http://www.localhost.com/ to http://localhost.com/ (I needed to do something like this for a site) and any request starting with '/redir/xyz' will execute '/test.php/redir/xyz'.&lt;br /&gt;&lt;br /&gt;Following is copied from the httpd.conf.&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;...&lt;br /&gt;NameVirtualHost 127.0.0.1:80&lt;br /&gt;&lt;br /&gt;&amp;lt;VirtualHost 127.0.0.1:80&amp;gt;&lt;br /&gt;    ServerAdmin your@email.com&lt;br /&gt;    DocumentRoot /usr/local/apache/htdocs&lt;br /&gt;    ServerName localhost.com&lt;br /&gt;    ServerAlias localhost.com&lt;br /&gt;    RewriteEngine on&lt;br /&gt;    RewriteRule ^/redir/(.*)  /test.php/redir/$1 [QSA,PT,L]&lt;br /&gt;    RewriteLog logs/rewrite_log&lt;br /&gt;    RewriteLogLevel    3&lt;br /&gt;    ErrorLog logs/local_error_log&lt;br /&gt;    CustomLog logs/local_access_log common&lt;br /&gt;&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;VirtualHost 127.0.0.1:80&amp;gt;&lt;br /&gt;    ServerAdmin your@email.com&lt;br /&gt;    DocumentRoot /usr/local/apache/htdocs&lt;br /&gt;    ServerName www.localhost.com&lt;br /&gt;    ServerAlias www.localhost.com&lt;br /&gt;    RewriteEngine on&lt;br /&gt;    RewriteRule ^/(.*)  http://localhost.com/$1 [QSA,R,L]&lt;br /&gt;    RewriteLog logs/rewrite1_log&lt;br /&gt;    RewriteLogLevel    3&lt;br /&gt;    ErrorLog logs/local1_error_log&lt;br /&gt;    CustomLog logs/local1_access_log common&lt;br /&gt;&amp;lt;/VirtualHost&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-8945276446942713651?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/8945276446942713651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=8945276446942713651' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/8945276446942713651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/8945276446942713651'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2008/02/apache-rewrite-module.html' title='Apache ReWrite Module'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-3224273902666483609</id><published>2008-02-01T20:18:00.000-08:00</published><updated>2008-02-01T21:06:35.170-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><category scheme='http://www.blogger.com/atom/ns#' term='pdo'/><title type='text'>Compiling PHP with PDO-mysql</title><content type='html'>To install pdo-mysql with PHP, following are the steps:&lt;br /&gt;&lt;br /&gt;1) configure PHP with '--enable-pdo=shared --with-pdo-mysql=shared' options.&lt;br /&gt;2) compile and install PHP (make, make install)&lt;br /&gt;3) Add 'extension = pdo.so' and 'extension = pdo_mysql.so' in the php.ini after pointing the extension_dir variable to the appropriate location where these 'so' reside. (eg. extension_dir = /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-3224273902666483609?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/3224273902666483609/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=3224273902666483609' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/3224273902666483609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/3224273902666483609'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2008/02/compiling-php-with-pdo-mysql.html' title='Compiling PHP with PDO-mysql'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-2258433257692776977</id><published>2008-01-25T11:10:00.000-08:00</published><updated>2008-01-25T11:42:51.812-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wrt54g'/><category scheme='http://www.blogger.com/atom/ns#' term='wireless router'/><category scheme='http://www.blogger.com/atom/ns#' term='India'/><category scheme='http://www.blogger.com/atom/ns#' term='v7'/><category scheme='http://www.blogger.com/atom/ns#' term='version 7'/><title type='text'>Buying the WRT54G Wireless Router in India</title><content type='html'>To make my home wi-fi enabled, I decided to buy a Wireless Router. Loads of such routers are available these days and after doing a bit of research online I decided to go for the Linksys WRT54G router.&lt;br /&gt;&lt;br /&gt;WRT54G routers allow you to install certain open-source (linux) firmware. If you are the kind who likes to play around with hardware, then this is the one for you. It allows you to do all sorts of things like increase the range (using the Xmit power), port-forwarding etc. etc. For details please goto http://www.dd-wrt.com/.&lt;br /&gt;&lt;br /&gt;A friend of mine suggested to go for WRT54G Version-5 or 6 since he already had one and it was working fine with Linux firmware. So... I went to Nehru Place (supposedly THE place to buy computer hardware in New Delhi) and asked for Linksys WRT54G router. Surprisingly the version information wasn't mentioned on the router's box.. I tried a few more shops.... but again, no version information. Hoping that the router will work with linux firmware I decided to purchase the router for Rs. 2150/-. Once I got home and opened the box 'version 7' was mentioned at the back of the router. After a bit of googling it was clear that this version of WRT54G CANNOT be upgraded to Linux firmware. Even if I try to install the firmware, the router will get 'bricked' (basically of no use and will have to be thrown).&lt;br /&gt;&lt;br /&gt;If you are planning to buy the WRT54G router and install Linux firmware on it, please ensure that it's NOT 'version 7'. All versions (v5,6,8) can be upgraded to Linux firmware but not v7. The serial number of all WRT54G v7 routers starts with 'CDFE'. The serial number is mentioned on the router's box (wish I knew this early on).&lt;br /&gt;&lt;br /&gt;Luckily I found someone who already had a 2 year old v5 WRT54G and was happy to exchange his router with my new v7 router :) &lt;br /&gt;&lt;br /&gt;I have now successfully upgraded the v5 router to Linux firmware(dd-wrt) and its working fine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-2258433257692776977?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/2258433257692776977/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=2258433257692776977' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/2258433257692776977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/2258433257692776977'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2008/01/buying-wrt54g-wireless-router-in-india.html' title='Buying the WRT54G Wireless Router in India'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-3256880382231487846</id><published>2008-01-24T20:17:00.000-08:00</published><updated>2008-01-24T20:33:24.132-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='apache'/><category scheme='http://www.blogger.com/atom/ns#' term='virtual hosting'/><title type='text'>Hosting multiple sites on a single server using the same IP</title><content type='html'>Apache has a great feature which allows hosting multiple sites using the same apache instance and even the same IP address. To know more &lt;a href="http://httpd.apache.org/docs/1.3/vhosts/name-based.html"&gt; click here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Following example shows how this can be done.&lt;br /&gt;&lt;br /&gt;Open the httpd.conf configuration file which is being used by apache.&lt;br /&gt;&lt;br /&gt;Add following at the end:&lt;br /&gt;&lt;br /&gt;NameVirtualHost 127.0.0.1:80&lt;br /&gt;&lt;br /&gt;&amp;lt;VirtualHost 127.0.0.1:80&amp;gt;&lt;br /&gt;   ServerAdmin your@email.com&lt;br /&gt;   DocumentRoot /doc/root/for/first/domain/&lt;br /&gt;   ServerName www.firstdomain.com&lt;br /&gt;   ServerAlias www.firstdomain.com&lt;br /&gt;   ErrorLog logs/firstdomain_error_log&lt;br /&gt;   CustomLog logs/firstdomain_access_log common&lt;br /&gt;&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;VirtualHost 127.0.0.1:80&amp;gt;&lt;br /&gt;   ServerAdmin your@email.com&lt;br /&gt;   DocumentRoot /doc/root/for/second/domain/&lt;br /&gt;   ServerName www.seconddomain.com&lt;br /&gt;   ServerAlias www.seconddomain.com&lt;br /&gt;   ErrorLog logs/seconddomain_error_log&lt;br /&gt;   CustomLog logs/seconddomain_access_log common&lt;br /&gt;&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;&lt;br /&gt;Replace 127.0.0.1 with the appropriate IP address, firstdomain and seconddomain as per the requirement.&lt;br /&gt;&lt;br /&gt;Restart apache.&lt;br /&gt;&lt;br /&gt;I tried this with apache 2.0.59 and it works fine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-3256880382231487846?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/3256880382231487846/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=3256880382231487846' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/3256880382231487846'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/3256880382231487846'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2008/01/hosting-multiple-domains-on-single.html' title='Hosting multiple sites on a single server using the same IP'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-9175952135394341250</id><published>2008-01-17T17:38:00.000-08:00</published><updated>2008-01-17T17:53:54.436-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c++'/><category scheme='http://www.blogger.com/atom/ns#' term='intersection'/><title type='text'>Finding Intersections between two sets in C++</title><content type='html'>Following C++ code (intersection.cpp) creates 2 sets ( a and b), creates a vector out of those (av and bv) and then finds the intersection between the two vectors.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;#include &amp;lt;vector&amp;gt;&lt;br /&gt;#include &amp;lt;set&amp;gt;&lt;br /&gt;#include&amp;lt;sys/time.h&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;#define MAX_SIZE 1000000&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;        set&amp;lt;int&amp;gt; a,b,un,in,di;&lt;br /&gt;        timeval tim;&lt;br /&gt;&lt;br /&gt;        srand ( time(NULL) );&lt;br /&gt;&lt;br /&gt;        cout &amp;lt;&amp;lt; &amp;quot;Adding to a : &amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;        for( int i = 0; i &amp;lt; MAX_SIZE; i++ ) {&lt;br /&gt;                int r = rand() % MAX_SIZE;&lt;br /&gt;                a.insert( r );&lt;br /&gt;        }  &lt;br /&gt;&lt;br /&gt;        cout &amp;lt;&amp;lt; &amp;quot;Creating vector av&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;        vector&amp;lt;int&amp;gt; av(a.begin(),a.end());&lt;br /&gt;        cout &amp;lt;&amp;lt; &amp;quot;There are &amp;quot; &amp;lt;&amp;lt; av.size() &amp;lt;&amp;lt; &amp;quot; elements in av&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;        cout &amp;lt;&amp;lt; &amp;quot;Adding to b : &amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;        for( int i = 0; i &amp;lt; MAX_SIZE; i++ ) {&lt;br /&gt;                int r = rand() % MAX_SIZE;&lt;br /&gt;                b.insert( r );&lt;br /&gt;        }  &lt;br /&gt;&lt;br /&gt;        cout &amp;lt;&amp;lt; &amp;quot;Creating vector bv&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;        vector&amp;lt;int&amp;gt; bv(b.begin(),b.end());&lt;br /&gt;        cout &amp;lt;&amp;lt; &amp;quot;There are &amp;quot; &amp;lt;&amp;lt; bv.size() &amp;lt;&amp;lt; &amp;quot; elements in bv&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;        gettimeofday(&amp;amp;tim, NULL);&lt;br /&gt;        double t1=tim.tv_sec+(tim.tv_usec/1000000.0);&lt;br /&gt;&lt;br /&gt;        set_intersection(a.begin(),a.end(),b.begin(),b.end(),insert_iterator&amp;lt;set&amp;lt;int&amp;gt; &amp;gt;(in,in.begin()));&lt;br /&gt;&lt;br /&gt;        gettimeofday(&amp;amp;tim, NULL);&lt;br /&gt;        double t2=tim.tv_sec+(tim.tv_usec/1000000.0);&lt;br /&gt;&lt;br /&gt;        vector&amp;lt;int&amp;gt; inv(in.begin(),in.end());&lt;br /&gt;&lt;br /&gt;        cout &amp;lt;&amp;lt; &amp;quot;Elements in intersection &amp;quot; &amp;lt;&amp;lt; inv.size() &amp;lt;&amp;lt; endl;&lt;br /&gt;        cout &amp;lt;&amp;lt; &amp;quot;Intersection time &amp;quot; &amp;lt;&amp;lt; (t2-t1) &amp;lt;&amp;lt; &amp;quot; seconds&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;        return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;compile: c++ intersection.cpp -o intersection&lt;br /&gt;Sample Output&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;./intersection&lt;br /&gt;Adding to a :&lt;br /&gt;Creating vector av&lt;br /&gt;There are 632163 elements in av&lt;br /&gt;Adding to b :&lt;br /&gt;Creating vector bv&lt;br /&gt;There are 631924 elements in bv&lt;br /&gt;Elements in intersection 399250&lt;br /&gt;Intersection time 0.65199 seconds&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-9175952135394341250?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/9175952135394341250/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=9175952135394341250' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/9175952135394341250'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/9175952135394341250'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2008/01/finding-intersections-between-two-sets.html' title='Finding Intersections between two sets in C++'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-1581338533484173873</id><published>2008-01-14T07:54:00.000-08:00</published><updated>2008-01-14T08:27:40.180-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='technology'/><category scheme='http://www.blogger.com/atom/ns#' term='SSD'/><category scheme='http://www.blogger.com/atom/ns#' term='2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Wireless USB'/><category scheme='http://www.blogger.com/atom/ns#' term='OLED'/><category scheme='http://www.blogger.com/atom/ns#' term='NFC'/><title type='text'>Technologies to look out for in 2008</title><content type='html'>&lt;p&gt;Here are a bunch of exciting technologies to look out for this year:&lt;br /&gt;&lt;br /&gt;1) &lt;strong&gt;Wireless USB&lt;/strong&gt;: Tired of carrying all those wires with your USB devices. Well... there is hope of getting rid of them. Wireless USB is capable of high speed data transfer (much faster than Bluetooth). &lt;a href="http://en.wikipedia.org/wiki/Wireless_USB"&gt;http://en.wikipedia.org/wiki/Wireless_USB&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2) &lt;strong&gt;Solid State Drive (SSD)&lt;/strong&gt;: These are the next generation of Disk Drives. They should be hugely successful with mobile devices (like laptops n phones) coz they are mechanically very reliable. They have the ability to endure extreme shock, high altitude, vibration and temperatures. &lt;a href="http://en.wikipedia.org/wiki/Solid_state_disk"&gt;http://en.wikipedia.org/wiki/Solid_state_disk&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;3) &lt;strong&gt;Organic Light-Emitting Diode (OLED)&lt;/strong&gt;: Much more efficient than the traditional LED and plasma due to their low power consumption and ability to provide more color depth without any backlight. Extremely thin TVs with amazing colors will be possible with this technology. &lt;a href="http://en.wikipedia.org/wiki/Organic_light-emitting_diode"&gt;http://en.wikipedia.org/wiki/Organic_light-emitting_diode&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;4) &lt;strong&gt;Near Field Communication (NFC)&lt;/strong&gt;: This is a short range, high-frequency wireless communication technology aimed primarily at usage in the mobiles. This makes things like Mobile ticketing and payment possible. &lt;a href="http://en.wikipedia.org/wiki/Near_Field_Communication"&gt;http://en.wikipedia.org/wiki/Near_Field_Communication&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-1581338533484173873?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/1581338533484173873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=1581338533484173873' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/1581338533484173873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/1581338533484173873'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2008/01/technologies-to-look-out-for-in-2008.html' title='Technologies to look out for in 2008'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-2729089642295964137</id><published>2008-01-11T04:11:00.000-08:00</published><updated>2008-01-11T04:15:36.989-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='special characters'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><category scheme='http://www.blogger.com/atom/ns#' term='ascii'/><title type='text'>Removing all non-ASCII characters from a string using php</title><content type='html'>ASCII characters have hex code from 00 to 7F (http://www.asciitable.com/).&lt;br /&gt;&lt;br /&gt;Following php function removes all non-ASCII characters from a string:&lt;br /&gt;&lt;br /&gt;function removeNonAscii($string) {&lt;br /&gt;return preg_replace('/[^\x00-\x7f]/','',$string);&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-2729089642295964137?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/2729089642295964137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=2729089642295964137' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/2729089642295964137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/2729089642295964137'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2008/01/removing-all-non-ascii-characters-from.html' title='Removing all non-ASCII characters from a string using php'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-2208348850201174012</id><published>2008-01-06T01:52:00.000-08:00</published><updated>2008-01-30T08:23:39.466-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='India'/><category scheme='http://www.blogger.com/atom/ns#' term='rates'/><category scheme='http://www.blogger.com/atom/ns#' term='broadband'/><category scheme='http://www.blogger.com/atom/ns#' term='Reliance'/><title type='text'>Reliance Broadnet (Broadband internet connection)</title><content type='html'>I recently got a pamphlet of Reliance Broadnet (Broadband service provided by Reliance in India) which mentions that the service provides download speeds ranging from 150 Kbps to 2 Mbps.&lt;br /&gt;&lt;br /&gt;Following are the plans mentioned:&lt;br /&gt;&lt;br /&gt;1. Rs. 750/month for 150 Kbps (unlimited upload and download)&lt;br /&gt;2. Rs. 999/month for 300 Kbps (unlimited upload and download)&lt;br /&gt;3. Rs. 1799/month for                                 600 Kbps (unlimited upload and download)&lt;br /&gt;4. Rs. 750/month for speed upto 2 Mbps with free usage of 4 GB (upload+download) and 90 paise/MB for additional usage&lt;br /&gt;&lt;br /&gt;Installation charge is Rs. 500 + Service Tax.&lt;br /&gt;&lt;br /&gt;Call 1-800-227773 or 3033 7777 for details.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-2208348850201174012?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/2208348850201174012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=2208348850201174012' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/2208348850201174012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/2208348850201174012'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2008/01/reliance-broadnet-broadband-internet.html' title='Reliance Broadnet (Broadband internet connection)'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-3233001131914736718</id><published>2008-01-04T21:49:00.000-08:00</published><updated>2008-01-04T21:54:30.292-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='clipboard'/><category scheme='http://www.blogger.com/atom/ns#' term='command line'/><title type='text'>Set Clipboard contents from command line using java</title><content type='html'>Following code(setClipboardContents.java) sets the Clipboard contents for &lt;span style="font-weight: bold;"&gt;10 seconds&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;import java.awt.datatransfer.StringSelection;&lt;br /&gt;import java.awt.Toolkit;&lt;br /&gt;import java.awt.datatransfer.Clipboard;&lt;br /&gt;&lt;br /&gt;public class setClipboardContents{&lt;br /&gt;       public static void main(String[] args) throws Exception {&lt;br /&gt;               StringSelection stringSelection = new StringSelection( args[0] );&lt;br /&gt;               Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();&lt;br /&gt;               clipboard.setContents( stringSelection, null);&lt;br /&gt;               try{&lt;br /&gt;                       Thread.sleep(10000);&lt;br /&gt;               } catch(InterruptedException e){&lt;br /&gt;                       System.out.println("Sleep Interrupted");&lt;br /&gt;               }&lt;br /&gt;       }&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Compile: javac setClipboardContents.java&lt;br /&gt;Run: java -cp . setClipboardContents "add this content to the Clipboard"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-3233001131914736718?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/3233001131914736718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=3233001131914736718' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/3233001131914736718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/3233001131914736718'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2008/01/set-clipboard-contents-from-command.html' title='Set Clipboard contents from command line using java'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-6773128440742037201</id><published>2008-01-04T21:26:00.000-08:00</published><updated>2008-01-04T21:31:13.867-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='echo'/><category scheme='http://www.blogger.com/atom/ns#' term='password'/><category scheme='http://www.blogger.com/atom/ns#' term='capture'/><category scheme='http://www.blogger.com/atom/ns#' term='string'/><title type='text'>Capturing string input without echo in java</title><content type='html'>Following code will demonstrate capturing a string without any echo using java:&lt;br /&gt;&lt;br /&gt;Create a java file (noEcho.java) with the following code:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;font-size:85%;" &gt;import java.lang.System;&lt;br /&gt;import java.io.Console;&lt;br /&gt;&lt;br /&gt;public class noEcho {&lt;br /&gt;        public static void main(String[] args) throws Exception {&lt;br /&gt;                char[] passwd;&lt;br /&gt;                Console cons;&lt;br /&gt;                if ((cons = System.console()) != null &amp;amp;&amp;amp; (passwd = cons.readPassword("[%s]", "Enter Text:")) != null) {&lt;br /&gt;                                String text = new String(passwd);&lt;br /&gt;                                System.out.println("You Entered :"+text);&lt;br /&gt;                }&lt;br /&gt;        }&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Compile: javac noEcho.java&lt;br /&gt;Run: java -cp . noEcho&lt;br /&gt;Sample output:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;[Enter Text:]&lt;br /&gt;You Entered :this is a test string&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-6773128440742037201?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/6773128440742037201/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=6773128440742037201' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/6773128440742037201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/6773128440742037201'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2008/01/capturing-string-input-without-echo-in.html' title='Capturing string input without echo in java'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-5071337491574710553</id><published>2008-01-02T04:25:00.000-08:00</published><updated>2008-01-02T20:23:29.231-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hibernate'/><category scheme='http://www.blogger.com/atom/ns#' term='time'/><category scheme='http://www.blogger.com/atom/ns#' term='boot'/><title type='text'>Hibernate instead of Shutdown for faster performance</title><content type='html'>When you boot your computer, certain critical modules (like kernel) are loaded into the Primary Memory (RAM) which allow the operating system to start. After this whenever you start an application (like Microsoft Word or Outlook) it first gets loaded into the Primary Memory from where the OS loads the Application. Thus, the first time you start an application there might be a delay of a few seconds and the next time it'll be much faster.&lt;br /&gt;&lt;br /&gt;Hibernate saves the contents of the RAM into Secondary Memory (Hard Disk) and when you boot the OS next time, it simply loads the RAM image back from the Hard Disk.&lt;br /&gt;&lt;br /&gt;Thus, even though time taken for a normal boot vs time for a boot after hibernate may be similar, you save a lot of time while working on the same set of applications.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-5071337491574710553?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/5071337491574710553/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=5071337491574710553' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/5071337491574710553'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/5071337491574710553'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2008/01/hibernate-instead-of-shutdown-for.html' title='Hibernate instead of Shutdown for faster performance'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-2381058962425633348</id><published>2007-12-29T02:27:00.000-08:00</published><updated>2007-12-29T02:38:24.218-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MTNL'/><category scheme='http://www.blogger.com/atom/ns#' term='broadband'/><category scheme='http://www.blogger.com/atom/ns#' term='triband'/><title type='text'>MTNL Broadband in Delhi</title><content type='html'>I was using an Airtel Broadband connection in Hyderabad last year and was pretty satisfied with their service. After shifting to Delhi, I wanted to get an Airtel connection again but unfortunately they do not provide telephone/broadband services in my area. Tried Tata Indicom also, but no luck there too.&lt;br /&gt;&lt;br /&gt;So finally I decided to go with MTNL Triband and requested a connection on 25th August 2007. Its been 4 months and after a number of calls and mails I have still not been given a connection. I went to the MTNL office last week and they told me that the 'ports' are not available in my area and I will get a connection only if &lt;span style="font-weight: bold;"&gt;someone else releases their connection&lt;/span&gt;. This is really funny and I suggest anyone who wants to go for an MTNL Broadband connection to first ask their Local MTNL telephone exchange whether there is a possibility of getting a connection anytime soon.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-2381058962425633348?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/2381058962425633348/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=2381058962425633348' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/2381058962425633348'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/2381058962425633348'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2007/12/mtnl-broadband-in-delhi.html' title='MTNL Broadband in Delhi'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-5289506453967432084</id><published>2007-12-27T20:07:00.000-08:00</published><updated>2008-01-04T21:57:28.840-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mobile'/><category scheme='http://www.blogger.com/atom/ns#' term='sony ericsson'/><category scheme='http://www.blogger.com/atom/ns#' term='airtel live'/><category scheme='http://www.blogger.com/atom/ns#' term='gmail app'/><title type='text'>Gmail App using Airtel Live on Sony Ericsson K750i</title><content type='html'>Activating Airtel Live (skip if you already have Airtel Live)&lt;br /&gt;&lt;br /&gt;1) Call the customer care and ask for Airtel Live activation (or send "PLIVE" to 170). It takes about 24 hours for the activation.&lt;br /&gt;2) Once activated. Get the settings by sending "LIVE" to 52567.&lt;br /&gt;&lt;br /&gt;Once you have the settings enabled you can start using your phone's browser to access your gmail account (&lt;a href="http://mail.google.com/mail/x/"&gt;http://mail.google.com/mail/x/&lt;/a&gt;). This works but you might find this slow to access your mails again and again (as I did). If your Phone is capable of running Java Applications (which most phones are these days) then using the Java Application for Gmail is a much better option.&lt;br /&gt;&lt;br /&gt;Setting up Gmail App (On Sony Ericsson K750i)&lt;br /&gt;1) Goto &lt;a href="http://gmail.com/app/"&gt;http://gmail.com/app/&lt;/a&gt; from the phone's browser and download the java application (about 160 KB). This is required only one time.&lt;br /&gt;2) Once download is successful. The phone asks for confirmations. Allow the phone to install the application.&lt;br /&gt;3) Goto Menu-&gt;Settings-&gt;Connectivity-&gt;Settings for Java and select the appropriate Internet profile ("AIRTEL LIVE" in case you are using Airtel Live).&lt;br /&gt;4) Goto Menu-&gt;Organizer-&gt;Applications and select "Gmail".&lt;br /&gt;5) Enter the gmail username and password and sign in.&lt;br /&gt;&lt;br /&gt;Note: Accessing mails using the Gmail App are charged as per the standard download rates.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-5289506453967432084?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/5289506453967432084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=5289506453967432084' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/5289506453967432084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/5289506453967432084'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2007/12/gmail-app-using-airtel-live-on-sony.html' title='Gmail App using Airtel Live on Sony Ericsson K750i'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12017471.post-6343052005840439805</id><published>2007-12-24T22:10:00.000-08:00</published><updated>2008-01-04T21:56:03.844-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='display'/><category scheme='http://www.blogger.com/atom/ns#' term='R60'/><category scheme='http://www.blogger.com/atom/ns#' term='CRT'/><category scheme='http://www.blogger.com/atom/ns#' term='thinkpad'/><category scheme='http://www.blogger.com/atom/ns#' term='external'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Enable External Display on Thinkpad R60 with Linux (Ubuntu 7.10)</title><content type='html'>Followings steps got my external CRT Display working on ThinkPad R60 with Linux Ubuntu 7.10 installed:&lt;br /&gt;&lt;br /&gt;1) cd /opt&lt;br /&gt;2) sudo wget http://www16.plala.or.jp/mano-a-mano/i810switch/i810switch-0.6.5.tar.gz&lt;br /&gt;3) sudo tar -xzvf i810switch-0.6.5.tar.gz&lt;br /&gt;4) cd i810switch-0.6.5/&lt;br /&gt;5) sudo vi i810switch.c&lt;br /&gt;     Insert the lines marked in BOLD below:&lt;br /&gt;&lt;br /&gt;//#define I865STR                       "8086:2572"&lt;br /&gt;#define I915STR                 "8086:2592"&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;#define I945STR                 "8086:27a2" //line 63&lt;/span&gt;&lt;br /&gt;#define MEMSTR                  "Memory at"&lt;br /&gt;...&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;              i = (p = strstr(*buff_ptr, I830STR)) != NULL ||&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;                        (p = strstr(*buff_ptr, I945STR)) != NULL || //line 266&lt;/span&gt;&lt;br /&gt;#if defined (I865STR)&lt;br /&gt;                      (p = strstr(*buff_ptr, I865STR)) != NULL ||&lt;br /&gt;#endif /*defined (I865STR)*/&lt;br /&gt;                      (p = strstr(*buff_ptr, I845STR)) != NULL;&lt;br /&gt;              if (i)&lt;br /&gt;...&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;6) sudo make&lt;br /&gt;7) sudo make install&lt;br /&gt;8) sudo i810switch crt on (turns on the external display)&lt;br /&gt;9) sudo i810switch crt off (turns off the extrenal display)&lt;br /&gt;&lt;br /&gt;To allow any user to perform this switch:&lt;br /&gt;&lt;br /&gt;chmod u+s /usr/bin/i810switch&lt;br /&gt;&lt;br /&gt;I use a simple script to toggle my external display:&lt;br /&gt;&lt;br /&gt;STATUS=`i810switch | grep CRT | awk '{print $2}'`&lt;br /&gt;if [ "$STATUS" = "off" ]&lt;br /&gt;then&lt;br /&gt;      i810switch crt on &gt;&gt; /dev/null&lt;br /&gt;elif [ "$STATUS" = "on" ]&lt;br /&gt;then&lt;br /&gt;      i810switch crt off &gt;&gt; /dev/null&lt;br /&gt;fi&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12017471-6343052005840439805?l=vivekjain10.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vivekjain10.blogspot.com/feeds/6343052005840439805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12017471&amp;postID=6343052005840439805' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/6343052005840439805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12017471/posts/default/6343052005840439805'/><link rel='alternate' type='text/html' href='http://vivekjain10.blogspot.com/2007/12/enable-external-display-on-thinkpad-r60.html' title='Enable External Display on Thinkpad R60 with Linux (Ubuntu 7.10)'/><author><name>Vivek</name><uri>http://www.blogger.com/profile/05943325100308734172</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
