tag:blogger.com,1999:blog-124188532024-03-05T13:00:01.560+05:00Linux ExperiencesSharing my experiences with the Operating System Linux and its rich heritage of programs, languages and featuresZahid Irfanhttp://www.blogger.com/profile/05600816176020222306noreply@blogger.comBlogger41125tag:blogger.com,1999:blog-12418853.post-68004452513894441892017-10-18T21:11:00.001+05:002017-10-18T21:11:35.414+05:00Kubernetes : The genie in a text file<div dir="ltr" style="text-align: left;" trbidi="on">
The fact that a container resides inside a text file was sufficiently awesome. Looking at the way orchestration is done via the Kubernetes has a feeling that its a miracle and yes the miracle has made the giant give in and Lo & Behold ....<br />
<div>
<br /></div>
<a href="https://techcrunch.com/2017/10/17/docker-gives-into-invevitable-and-offers-native-kubernetes-support/">Docker gives into inevitable and offers native Kubernetes support</a><div>
<br /></div>
<div>
It was not inevitable as the news refers to but it was really hard work at Kubernetes and already most of the big guns have given up (or joined hands with Kubernetes). The following news item show.</div>
<div>
<br /></div>
<div>
<a href="https://techcrunch.com/2017/09/20/kubernetes-gains-momentum-as-big-name-vendors-join-cloud-native-computing-foundation/">Kubernetes gains momentum as big name vendors join cloud native computing foundation</a></div>
<div>
<br /></div>
<div>
Platinum Members : Microsoft, AWS, CISCO, CoreOS, DellTechnologies, Fujitsu, Google, Huawei, IBM, Intel, Joyent, NEOSPHERE, ORACLE, Pivotal, Redhat, Samsung, SAP, VMWare and Finally Docker.</div>
<div>
<br /></div>
<div>
The above <a href="https://www.cncf.io/about/members/">list</a> shows that there is quite a bit of back story to the 'inevitable'. </div>
<div>
<br /></div>
<div>
Happy Days for k8s and loving it totally. </div>
</div>
Zahid Irfanhttp://www.blogger.com/profile/05600816176020222306noreply@blogger.com0tag:blogger.com,1999:blog-12418853.post-68679774301524709222017-10-16T00:31:00.001+05:002017-10-16T00:31:44.834+05:00TIL : Never change and push code directly on GitHub site<div dir="ltr" style="text-align: left;" trbidi="on">
Never ever do this even if its as mundane and harmless as a few changes in the README.<br />
<br />
Your customers will suffer because they are not as aware of the code as you are and they follow README much more diligently than you do.<br />
<br />
Another lesson learnt is that never ever do it on master branch. Also create a sub branch and work on it. Keep your most recent working code in master. This is another mistake I made while I preach the same to others I did not practice it myself.<br />
<br />
The above cost me hours of fixing and a lot of client disgruntlement. </div>
Zahid Irfanhttp://www.blogger.com/profile/05600816176020222306noreply@blogger.com0tag:blogger.com,1999:blog-12418853.post-74519614187721109142017-10-04T17:55:00.002+05:002017-10-04T18:05:36.755+05:00APIs with a postman<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
I never realised that a postman would be worth so much. However while recently working with lots of APIs in parallel and in the process developing another one. It struck me and stuck with me the importance of a tool as handy as <a href="https://www.getpostman.com/">postman</a>. </div>
<div>
<br /></div>
<div>
I was firm believer of using CURL scripts to test APIs and incorporating tests into the API development would be the best way. However postman awed and shocked me by its ease of use and wonderful interface. </div>
<div>
<br /></div>
<div>
Next stop .... How to handle load balancing and load testing. </div>
</div>
Zahid Irfanhttp://www.blogger.com/profile/05600816176020222306noreply@blogger.com0tag:blogger.com,1999:blog-12418853.post-88755981900903392882012-10-08T22:09:00.001+05:002012-10-08T22:10:39.039+05:00Exploring Pyreverse UML<div dir="ltr" style="text-align: left;" trbidi="on">
Installing <a href="http://pypi.python.org/pypi/pylint">pylint </a>for python came with an extra package called pyreverse. This wonderful little package gave ability to create class diagrams from python code. Simply writing the following code produced the png files of class diagrams.<br />
<br />
<blockquote class="tr_bq">
$pyreverse -o png * </blockquote>
<br />
This would create png files which can be used for documentation as well as design review meeting. A very handy tool which won the day for us.</div>
Zahid Irfanhttp://www.blogger.com/profile/05600816176020222306noreply@blogger.com0tag:blogger.com,1999:blog-12418853.post-29972746702479116962011-02-14T22:18:00.001+05:002011-02-14T22:21:47.385+05:00Getting Wireless Up on Ubuntu 10.10 DELL VOSTRO 1500<div dir="ltr" style="text-align: left;" trbidi="on">After long long hours of searching and head scratching the following two-step process helped in getting the wireless up and running on Dell Vostro<br />
<br />
<span class="Apple-style-span" style="font-size: large;">Step 1: Flash BIOS</span><br />
<br />
Go to the <a href="http://support.dell.com/support/downloads/download.aspx?c=us&l=en&s=gen&releaseid=R184570&SystemID=VOS_N_1500&servicetag=&os=BIOSA&osl=en&deviceid=14974&devlib=0&typecnt=0&vercnt=5&catid=-1&impid=-1&formatcnt=0&libid=1&typeid=-1&dateid=-1&formatid=-1&source=-1&fileid=252223">link </a>and flash the bios according to latest.<br />
Simply download the file and install the program and reboot.<br />
This would enable the wlan in Ubuntu.<br />
<br />
<span class="Apple-style-span" style="font-size: large;">Step 2: Update Driver</span><br />
Update the wireless driver using the following command. <br />
<blockquote>$ sudo apt-get update</blockquote><blockquote>$ sudo apt-get install bcmwl-kernel-source</blockquote>This should be done and after a reboot the Wireless should be up and running.<br />
<br />
Immense help for this was taken from <a href="http://support.dell.com/support/downloads/download.aspx?c=us&l=en&s=gen&releaseid=R184570&SystemID=VOS_N_1500&servicetag=&os=BIOSA&osl=en&deviceid=14974&devlib=0&typecnt=0&vercnt=5&catid=-1&impid=-1&formatcnt=0&libid=1&typeid=-1&dateid=-1&formatid=-1&source=-1&fileid=252223">here</a> and <a href="http://ubuntu-ky.ubuntuforums.org/showthread.php?p=9232072">here</a>.<br />
<br />
</div>Zahid Irfanhttp://www.blogger.com/profile/05600816176020222306noreply@blogger.com2tag:blogger.com,1999:blog-12418853.post-75865307049409902472011-02-14T16:02:00.000+05:002011-02-14T16:02:36.666+05:00Twofolds Joy of using Ubuntu<div dir="ltr" style="text-align: left;" trbidi="on">Frequent inhibitors to migrating to Ubuntu are what if something goes wrong, where will my windows go, what if I don't get everything working and topmost is I have only one partition what to do now don't wish to risk any partition magicians. A quick fix to all this rests in using Windows-based Ubuntu Installer (Wubi). If something goes wrong you don't lose windows, hard disk space and top of all your patience with Linux-derivatives.<br />
<br />
All it takes is the following simple steps<br />
<br />
1. Go to the <a href="http://www.ubuntu.com/desktop/get-ubuntu/windows-installer">Ubuntu Windows Installer Link</a><br />
2. Let the 1.4 MB or so file to download and then install click.<br />
3. Then let the application take charge while it asks for minimal information like username and password.<br />
4. Boom after a couple of restarts and long download (700+ MB)you will have a copy of Ubuntu lying alongside windows harmless.<br />
5. If you encounter some hiccups then its best to go to the windows and ask around google and then apply the fixes. This is the fun part that such hiccups no longer are fatal.<br />
<br />
<br />
Best of luck Happy Hunting Ubuntu</div>Zahid Irfanhttp://www.blogger.com/profile/05600816176020222306noreply@blogger.com2tag:blogger.com,1999:blog-12418853.post-4226171046016243352010-11-01T22:01:00.001+05:002010-11-01T22:06:25.883+05:00Ubuntu Update Manager's Proxy does not change when system proxy is changedAll efforts to change the Update Manager's proxy come to a grinding halt without any solution. The reason for this fallout is that the proxy is "hidden" at a very safe location. Ubuntu Update Manager's proxy does not change after changing the system-wide proxy or proxy of synaptic program. The reason is that it uses the apt-get's proxy settings. Which can be amended by looking at the /etc/apt/apt.conf file. This file contains the information about proxy servers.<br />
<blockquote>Acquire::http::proxy "http://ProxyServerAddress:ProxyServerPort/";</blockquote><blockquote>Acquire::ftp::proxy "ftp://ProxyServerAddress: ProxyServerPort/";</blockquote><div>This information can be amended to gain direct access to the internet or if the need is to change to a different proxy server. </div>Zahid Irfanhttp://www.blogger.com/profile/05600816176020222306noreply@blogger.com3tag:blogger.com,1999:blog-12418853.post-86465329231178653592010-10-30T11:25:00.000+05:002010-10-30T11:25:21.246+05:00The easiest SVN tutorial everBrowsing through the Internet its extremely difficult to find the subversion(svn) commands in an instance and be productive immediately. So here is the step by step list of instructions which can be followed to accomplish the most common tasks of svn.<br />
<br />
We would use the project on Sourceforge named Dr. Java as an example.<br />
<br />
If the project is already there and you wish to CHECKOUT some code to view here is the command.<br />
<blockquote>$svn co https://drjava.svn.sourceforge.net/svnroot/drjava drjava</blockquote>Now if you wish to add new file to the svn repository the command is very simple. For example if you wish to add the text file readme.<br />
<blockquote>$svn add README_TEXT</blockquote>The above command will not add it to the server but add it to the schedule. If you wish to view current status of additions, deletions that are scheduled you could use the command<br />
<blockquote>$svn status</blockquote>And finally if you are satisfied simple do the following and the commit will be done meaning all the changes will now be part of the repository and a new version will be assigned. REMEMBER adding/ deleting/ changing code in a repository requires permissions. Therefore you might be prompted for passwords during the process. <br />
<br />
<blockquote> $svn commit </blockquote>This is all the information that you need to get past the basic svn commands and concentrate on your project.<br />
<br />
Now that you have gone through one cycle it would be easier to use the following command to explore other features of svn.<br />
<blockquote>$svn help</blockquote>Zahid Irfanhttp://www.blogger.com/profile/05600816176020222306noreply@blogger.com0tag:blogger.com,1999:blog-12418853.post-80437866339027182492010-10-26T23:25:00.000+05:002010-10-26T23:25:36.737+05:00MySQL quickest way to look at databasesLooking for MySQL's administration tool is a task. Installing and configuring PHPMyAdmin would take Apache, php and then successful configuration. Then what to do to look at the tables, databases in the fastest possible way to look at tables and execute queries.<br />
<blockquote>$ mysql -u username -p </blockquote>the command will prompt for a password<br />
<blockquote>mysql> Show databases;<br />
mysql> show tables;</blockquote> The above two commands are extremely useful when one wants to look at the databases installed and tables in individual databases.<br />
<br />
<br />
For example to look at users tables in database drupal the following commands will suffice.<br />
<blockquote><br />
mysql> use drupal6;<br />
mysql> select * from users;</blockquote><br />
These commands can be used in both Linux and Windows and are very handy and dont require much to do.Zahid Irfanhttp://www.blogger.com/profile/05600816176020222306noreply@blogger.com0tag:blogger.com,1999:blog-12418853.post-91339068761628153702010-10-26T14:21:00.000+05:002010-10-26T14:21:54.641+05:00PHP Issue :: preg_split instead of explode functionIf the need is to parse a string and extract the words. Then its advisable to use preg_split instead of using the explode function.<br />
<br />
Code follows :<br />
<blockquote><blockquote>preg_split ("/\s+/",$textInput); </blockquote></blockquote>where the first argument is the regular expression for finding one or more spaces and the second argument is the input text.<br />
<br />
This option works far better than the explode(" ", $textInput).Zahid Irfanhttp://www.blogger.com/profile/05600816176020222306noreply@blogger.com0tag:blogger.com,1999:blog-12418853.post-15184712557728737652010-09-21T21:05:00.000+05:002010-09-21T21:05:29.736+05:00Judging the Joomla Jungle :: The Premier CMSFirst experience of using a comprehensive Content Management System (CMS) was Drupal way back some years ago. Before that content management meant either using Front Page or direct FTP of the webpages. Despite "hearing" a lot of good reviews about Joomla never really got the time to explore it. <br />
<br />
<span style="font-size: large;"><b>First Steps</b></span><br />
The first steps towards installing Joomla in Linux are the usual for web servers. Install <a href="http://zahidirfan.blogspot.com/2010/03/linux-lamp-raising-jinn-and-exorcising.html">LAMP </a>(Linux, Apache, MySQL and PHP). After testing LAMP's successful installation proceed with the following.<br />
<br />
Download Joomla from the <a href="http://www.joomla.org/download.html">website</a> and follow the instructions given in INSTALL.PHP file in the main folder. Copying the instructions from the php file verbatim here. Copy the folder into www directory of Apache. <br />
<br />
<b>{verbatim copy starts</b>}<br />
First, you must create a new database for your Joomla! site e.g.<br />
<br />
<blockquote> $ mysqladmin -u db_user -p create Joomla</blockquote>MySQL will prompt for the 'db_user' database password and then create the initial database files. Next you must login and set the access database rights e.g.<br />
<blockquote> $ mysql -u db_user -p</blockquote>Again, you will be asked for the 'db_user' database password. At the MySQL prompt, enter following command:<br />
<blockquote> GRANT ALL PRIVILEGES ON Joomla.*<br />
TO nobody@localhost IDENTIFIED BY 'password';</blockquote> where:<br />
'Joomla' is the name of your database<br />
'nobody@localhost' is the userid of your webserver MySQL account<br />
'password' is the password required to log in as the MySQL user<br />
<br />
If successful, MySQL will reply with<br />
<blockquote> Query OK, 0 rows affected</blockquote> to activate the new permissions you must enter the command<br />
<blockquote> flush privileges;</blockquote> and then enter '\q' to exit MySQL.<br />
Alternatively you can use your web control panel or phpMyAdmin to create a database for Joomla.<br />
<br />
<b>{verbatim copy ends}</b><br />
<br />
So once the installation was complete simply go to the http://localhost/joomla (depending on where you stored the joomla in the apache directory. This would launch the web installer and answering a couple of simple questions results in the installation of Joomla.<br />
<br />
<span style="font-size: large;"><b>Ooops where are my other databases !!!!</b></span><br />
Having installed and worked on Joomla I realized that my other databases have been lost. Moreover the admin password has been lost. So I had to recover the password again via the <a href="http://www.cyberciti.biz/tips/recover-mysql-root-password.html">instruction given here. </a>This glitch created a lot of headache but finally after recovery of the admin password. <br />
<br />
<b><span style="font-size: large;">Using the CMS</span></b><br />
The result of this installation procedure was a sleek joomla content management system. Its extremely easy to get started and actually use via the admin panel by going to the http://localhost/jooomla/administrator.<br />
The whole website can be managed through a set of menus and control panel. There is the template manager which helps in installation of new templates as well as edit/ preview/ apply templates. The other important aspect is easy maintenance of posts. The CMS is nice although it takes time to figure out the whole concepts. In contrast to Drupal (which was really easy to manage via the web interface of admininstrator account) Joomla lacks a bit of such flexibility. <br />
<br />
<b><span style="font-size: large;">Next Steps</span></b><br />
The next steps is installation of themes and extensions. In this regard the following seems attractive and worthy of exploration.<br />
<ul><li>Financial Extensions</li>
<li>Site Analytics</li>
</ul>Zahid Irfanhttp://www.blogger.com/profile/05600816176020222306noreply@blogger.com0tag:blogger.com,1999:blog-12418853.post-48065423677844616742010-08-17T03:13:00.000+05:002010-08-17T03:13:34.370+05:00Learning Probability via OctaveProbability is a subject which brings everyone sleepless nights. Octave, the MATLAB clone or for some MATLAB wanna-be . <a href="http://www.octave.org/">GNU Octave is a high-level language, primarily intended for numerical computations.</a> The best way to learn octave is to take a difficult task (or goal) and then start using it.<br />
<br />
<span style="font-size: large;"><b>Octave Basics</b></span><br />
Octave can be installed using the following command in Ubuntu.<br />
<blockquote>$ sudo apt-get install octave</blockquote>Once installed octave can be invoked via the command.<br />
<blockquote>$ octave </blockquote>Its best to understand the modus operandi of Octave. Like lists are the primary data structures in LISP Language. In octave vectors are at the core. Vectors are used to store information, manipulate information via vector algebra and display data still using 2D/3D graphics. Applications of octave are huge but we will use probability as a starting point and see how we can learn better probability using the computational and graphical features of octave.<br />
<br />
<span style="font-size: large;"><b>Uniform Probability Distribution</b></span><br />
Uncertainty of events can be modeled using concepts of probability. If a set of events is equally likely to occur then we say that the events have equal or uniform probability of happening. <br />
The first step towards developing a mathematical model for probability is to map real-life events to random variables (in our case the random variables will take on values from real numbers). Thus we say that instead of using real-life events we will refer to values 1, 2, 3, 4, .... when talking about events (e.g., Sun rise, Sun Set etc.). Lets use the example of a dice having six faces each one marked with number 1, 2, 3, 4, 5 and 6 respectively. The events of getting a particular face after rolling the dice are getting face marked by either One, Two, Three, Four, Five or Six. Since we cannot say with certainty which face will come up on roll of dice. We say that x which is a random variable which takes on values {1, 2, 3, 4, 5, 6} corresponding to the aforementioned events. <br />
Now this information can be stored as a vector x = [1 2 3 4 5 6] and so lets see the corresponding command in octave by simply typing x=[1 2 3 4 5 6].<br />
<blockquote>octave:1> x=[1 2 3 4 5 6]<br />
x =<br />
<br />
1 2 3 4 5 6</blockquote>The following values x = and followed by 1 2 3 4 5 6, shows the value stored in the vector x. This display can be avoided by placing a semi-colon (;) at the end of the command. Now that we have declared a variable named x with values lets see how octave stores it. This can be achieved anytime by writing the command whos on the command line of octave.<br />
<blockquote>octave:2> whos<br />
Variables in the current scope:<br />
<br />
Attr Name Size Bytes Class<br />
==== ==== ==== ===== ===== <br />
ans 1x30 30 char<br />
x 1x6 48 double</blockquote>The size of variable x is 1x6 which means that its a vector (matrix) of size 1 row and 6 columns, with 48 bytes needed to store it while the class of variables in double.<br />
<br />
Now lets see what is the probability of getting a particular face. Since all the faces of the dice have an equal probability of showing up hence the probability of getting a 1 is equal to the probability of getting 2, 3, 4, 5 or 6. Therefore in our model the probability given by p(x) = 1/6 {where 6 represents the total number of possibilities}. Now lets calculate the probability of the events using octave.<br />
<blockquote>octave:3> px=1/6*ones(1,6)<br />
px =<br />
<br />
0.16667 0.16667 0.16667 0.16667 0.16667 0.16667</blockquote>Here in the above code we have used the function ones which helps to declare a vector of size 1x6 and initialize it with ones. We simply multiply it with 1/6 to get 0.16667 in all the elements. In order to check what is the probability of event 3 simply write the following command.<br />
<blockquote>octave:4> px(3)<br />
ans = 0.16667</blockquote>Similarly for all the other events. This was simple because we used the simplest possible probability model. <br />
<br />
<span style="font-size: large;"><b>Normal Probability Distribution</b></span><br />
Moving further lets move to a more "realistic" probability model. Normal Probability Distribution is a very practical to model most situations. Special thanks to Guillaume Riflet's <a href="http://point.pt/%7Eguillaume/latex/latexiframe.html">website</a> for the equations in this article.<br />
<div style="text-align: center; width: 100%;"><img alt=" f(x) = \tfrac{1}{\sqrt{2\pi\sigma^2}}\; e^{ -\frac{(x-\mu)^2}{2\sigma^2} }
" src="http://www.mathtran.org/cgi-bin/mathtran?D=3;tex=%20f%28x%29%20%3D%20%5Ctfrac%7B1%7D%7B%5Csqrt%7B2%5Cpi%5Csigma%5E2%7D%7D%5C%3B%20e%5E%7B%20-%5Cfrac%7B%28x-%5Cmu%29%5E2%7D%7B2%5Csigma%5E2%7D%20%7D%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20" /></div>Trying out this equation in octave gives the following resulting. Now using the same number of events x=[1 2 3 4 5 6]. The mean (mu)=3.5 and variance(sigma)=1.<br />
<blockquote>octave:5> mu=3.5; sigma=1;<br />
octave:6> fx=(1/sqrt(2*pi*sigma^2)*exp(-(x-mu).^2/(2*sigma^2)));</blockquote><blockquote>fx =<br />
<br />
0.017528 0.129518 0.352065 0.352065 0.129518 0.017528</blockquote><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYIlmxFcV8e59rgXyO1R_xbNh4lMzsWLgCTRJW0_KYloehpALoPZ5wI2o4iQKgkIPMuC2Ah1IS_OdzvmilnyCrE0D-bm4cS3zzBGRGGdGluNOpe7Vs-E7L2nIDyDqToRZBFslp6g/s1600/Plot-1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="322" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYIlmxFcV8e59rgXyO1R_xbNh4lMzsWLgCTRJW0_KYloehpALoPZ5wI2o4iQKgkIPMuC2Ah1IS_OdzvmilnyCrE0D-bm4cS3zzBGRGGdGluNOpe7Vs-E7L2nIDyDqToRZBFslp6g/s400/Plot-1.jpg" width="400" /></a></div>Since the mean was selected to be 3.5 therefore we can see that the probability of 3 and 4 are maximum here while the probability decreases as we move away from 3.5 on either side. Now this is the classical "bell shaped" or Gaussian curve. This does not look clear because we took only 6 data points to plot the curve we can improve the points by using the following code and the resulting graph is shown. <br />
<blockquote>octave:8> x=[1:0.1:6];<br />
octave:9> fx=(1/sqrt(2*pi*sigma^2)*exp(-(x-mu).^2/(2*sigma^2)));<br />
octave:10> plot(x,fx)</blockquote><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo22OYnY0tFHYgXprXdM2wdkIffk-ezreBcsS1emNffTIILVl1cgv9VdiuaszstmZYLh4o7P_Ns2PnGIE7JUc297y7RqXAVFI__GzvpEpW-rFl3SCwFAXBtzIfMW6co2JaoR129w/s1600/Plot-2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="322" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo22OYnY0tFHYgXprXdM2wdkIffk-ezreBcsS1emNffTIILVl1cgv9VdiuaszstmZYLh4o7P_Ns2PnGIE7JUc297y7RqXAVFI__GzvpEpW-rFl3SCwFAXBtzIfMW6co2JaoR129w/s400/Plot-2.jpg" width="400" /></a></div><br />
Now that the data points have been increased the graph is much more smooth and looks like a bell shaped curve and the probability is now really maximum at point 3.5 as should be since mu (mean)=3.5.<br />
<br />
<span style="font-size: large;"><b>Multivariate Probability Distribution</b></span><br />
<br />
In order to generate further interest now lets look at multivariate normal distribution. The following equation gives us the multivariate normal distribution here the x and mu are d-dimensional vectors defining the multidimensional event and means while sigma is the co-variance matrix.<br />
<div style="text-align: center; width: 100%;"><br />
<img alt="p(x)=\frac{1}{(2\pi)^{k/2}|\Sigma|^{1/2}}\, e^{ -\frac{1}{2}(x-\mu)'\Sigma^{-1}(x-\mu) }
" src="http://www.mathtran.org/cgi-bin/mathtran?D=3;tex=p%28x%29%3D%5Cfrac%7B1%7D%7B%282%5Cpi%29%5E%7Bk/2%7D%7C%5CSigma%7C%5E%7B1/2%7D%7D%5C%2C%20e%5E%7B%20-%5Cfrac%7B1%7D%7B2%7D%28x-%5Cmu%29%27%5CSigma%5E%7B-1%7D%28x-%5Cmu%29%20%7D%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20" /></div>The above equation requires further constructs like for-loop to be implemented in Octave lets use the example given at <a href="http://commons.wikimedia.org/wiki/File:Multivariate_Gaussian.png">wiki</a> to learn.<br />
<blockquote>octave:10> mu=[40, 60]; sigma=[100, 30; 30, 140]; octave:39> isigma = inv(sigma); <br />
octave:11> detsigma = det(sigma);<br />
octave:12> coeff = 1/(2*pi*sqrt(detsigma));<br />
octave:13> for i=1:100<br />
> for j=1:100<br />
> x = [i;j];<br />
> xm = x - mu;<br />
> p(i,j) = exp(-0.5*xm'*isigma*xm);<br />
> end <br />
> end<br />
octave:14> p=p*coeff;<br />
octave:15> [X,Y]=meshgrid(1:100,1:100);<br />
octave:16> surf(X,Y,p);</blockquote><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBlxv7aavNKfAep0ra8lS2JXK6z9vbKU6mOY1jHEc6QNdZkdWG4N-NdYF-eIKeBSpqh9JDx2QZkHFGLnR99UOMNTKFdjKm8USACiCxd1ZL1k0LhjzHFDv1fRcmvfVwv_i5p6SCuw/s1600/Plot-3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="235" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBlxv7aavNKfAep0ra8lS2JXK6z9vbKU6mOY1jHEc6QNdZkdWG4N-NdYF-eIKeBSpqh9JDx2QZkHFGLnR99UOMNTKFdjKm8USACiCxd1ZL1k0LhjzHFDv1fRcmvfVwv_i5p6SCuw/s400/Plot-3.jpg" width="400" /></a></div><br />
The plot above is a 3-D graph of the multivariate normal probability distribution of p(x,y) depending on two variables x and y. The above methodology helps us learn probability in a fun manner as well as get familiar with octave's computational and graphical features.Zahid Irfanhttp://www.blogger.com/profile/05600816176020222306noreply@blogger.com1tag:blogger.com,1999:blog-12418853.post-64975356274521596322010-07-02T03:18:00.001+05:002010-07-02T03:19:48.328+05:00Best web hosting companies :: A futile search without a plan and executionWeb hosting services is a thriving business and new services keeps propping almost daily. Now with every new choice new questions need to be asked. Which web hosting service should I go for? The answer to this question does not lie in any search engine queries but rather lies in a plan. In order to determine the best web hosting companies one needs to have a plan and an execution map.<br />
<br />
<b><span style="font-size: large;">Plan Phase</span></b><br />
Selection of web hosting service is easier if answers to the following questions can be determined.<br />
<ol><li><span style="font-size: small;">Why do we need a web hosting service?</span></li>
<li><span style="font-size: small;">What is the goal of the website? </span></li>
<li><span style="font-size: small;">What will be our needs in the next three years?</span></li>
<li><span style="font-size: small;">Which departments in the company are planning to use the website in the next few years?</span></li>
<li><span style="font-size: small;">Is our company's business uniform enough to warrant a company-wide website? </span></li>
<li><span style="font-size: small;">How much is the company willing to invest? What is the expected budget of this endeavor?</span></li>
<li><span style="font-size: small;">Expected automation needs of the company in the next three years? Calenders, Emails other needs.</span></li>
<li><span style="font-size: small;">Maximum number of users(departments) who will upload data on the website expected?</span></li>
</ol>The importance of these questions varies from company to company but every company must ponder over more or less each of these questions. This helps in preparing a map for searching the best web hosting company for our purposes.<br />
<br />
<span style="font-size: large;"><b>Execution Phase</b></span><br />
After pondering over each of these questions we need to heed to the following points which will filter out and help focus.<br />
<br />
<span style="font-size: small;"><b>1. Throwing money at it wont make the problems go away.</b></span><br />
Every one is interested in offering a service at a cost. Don't get lured by low costs solutions or for that matter overly priced solutions. Look before you leap. Expensive solutions not necessarily mean stable and robust solutions.<br />
<br />
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span style="font-size: small;"><b>2. Linux is the best </b></span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Yes, Linux is the best but is it best for you depends on the environment in your enterprise. If Windows and Microsoft are the name of the game in the organization then choosing Linux for website hosting might be counter productive in that it would not fit in with the software being used currently e.g. MS Project, MS Office, MS Exchange Server, MS Email Clients like Outlook. The difference in prices between Linux and Windows web hosting services does not warrant putting all the investment already done in Microsoft software to disuse. </div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span style="font-size: small;"><b>3. My cousin's company gives the lowest rates</b></span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Avoid falling into buying service on referrals which are not based on purely business terms. If someone refers to a company whose only 'positive' point is that its owned by the referrer's relative than this is probably a huge drawback instead of an advantage. One might not be able to fully negotiate the terms and in the event of problems really push the company to provide support. </div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span style="font-size: small;"><b>4. My web hosting company performs really well</b></span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Avoid giving contract to a company just because it works well for someone else. The reason is that your company's needs might be completely orthogonal to the other party. </div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span style="font-size: small;"><b>5. Traffic does not matter at all</b></span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Give proper attention to the traffic caps in the hosting plans. Never fall for the trap that your traffic needs six months from now will remain the same as they are today. Websites have a strange pattern of jumping from single digit hits to hundreds (or at times thousands) of hits per day. </div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><b><span style="font-size: large;">Future Decisions</span></b></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Once a web hosting plan has been selected and the website has been deployed. Its imperative to perform monitoring of the website as much as possible. It helps in avoiding problems as well as planning growth of the website. A first step could be registering the website with analytics service providers. Google analytics is one example of such a service. Second step is to get the website report from Alexa. The third optional step could be to buy monitoring software like one developed by Hubspot. </div>Zahid Irfanhttp://www.blogger.com/profile/05600816176020222306noreply@blogger.com1tag:blogger.com,1999:blog-12418853.post-11619472333623722312010-07-02T02:55:00.000+05:002010-07-02T02:55:11.740+05:00Why Operating Systems Programming is so difficult?The character of operating system programming has remained more or less constant over the years. That is a polite way of saying that it is still as scary as ever. Why it is so? Complex system requires complex programming methods and this goes against the spirit of the dictum "Good programs are easier to understand and develop". So can we conclude that system programming being done is bad programming. Or the programmers are not following best practices and all the elaborate methods created to ease programming. Or they are still dealing with a lot of legacy code. Looking at the output "they" are the best talent. Probably its the fact that they are good that they create something so brilliant that nobody can fathom or appreciate. The reality needs to be explored.<br />
<br />
<b><span style="font-size: large;"><span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;">System Programming</span></span></b><span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"> </span><br />
So what exactly is operating system programming. Is it really something different from regular programming or its just a subset of programming. System Programming in contrast to application programming is directed towards hardware/system programming while Application Programming deals with creating software which interact with the user. <br />
<br />
<b><span style="font-size: large;">Sources of Complexity</span></b><br />
The complexity in the dealing with systems programming language amongst others is due to the following reasons.<br />
<br />
1. Legacy<br />
2. Diversity <br />
<br />
<span style="font-size: small;"><b>Legacy</b></span><br />
Legacy code is very hard to get away with in application programming but when it comes to Systems Programming. Legacy code is EXTREMELY hard to get away. Since the legacy code has been written with an extremely large investment of time and also due to scarcity of expertise available so it is more feasible to use legacy code instead of re-inventing the wheel.<br />
<br />
<b>Diversity of Hardware</b><br />
This is the other problem which leads to complicated code. Hardware diversity needs to be catered by system programmers as compared to application programmers who have the luxury of using interfaces (provided by system programmers) to hardware.<br />
<br />
<div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><b><span style="font-size: large;">How to get over it</span></b></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">There is no short cut to success in the system programming domain. One has to go through the rigor of learning the issue. An easier way could be using the input-output model. Input output model is a way of getting reducing the code's complexity and focusing on inputs and outputs of the given algorithm/ function. This helps in first understanding the basic goals before diving deeper into the code. </div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Another familiar method is to develop state diagrams. This methodology requires a little more skill than the previous method but can be extremely helpful in figuring out complicated code.</div></div>Zahid Irfanhttp://www.blogger.com/profile/05600816176020222306noreply@blogger.com0tag:blogger.com,1999:blog-12418853.post-45936421020306392842010-05-06T02:05:00.001+05:002010-05-06T02:11:57.615+05:00Harnessing UML in UbuntuSoftware development was never easy. Software design became extremely difficult with the explosive growth of computers and Internet. Let me accept that I was never a fan of UML. I always believed that software development is an art and the design process is more of an inspiration than a mechanical process of finding nouns and verbs. Patterns, well I thought they were probably the worst creativity-repellents possible. So I was always lousy with UML until I realized that this aversion was compounded due to using MS Visio. Visio probably is the worst place to go to develop UML diagrams. My faith in Visio was developed while using the minimal project management tools (during undergraduate studies) so when it came to doing UML I simply went ahead and used Visio for Software Design. <br />
<br />
Not until 2007 did I come out of the dark ages when I used umbrello for the first time. Then i came to realize that the true worth of a UML Drawing tool. The way in which all the diagrams were integrated gave a sense of connection. While in Visio it was always like drawing a redundant diagram be it class diagram or interaction diagram. However with umbrello this is not the case. The model that is defined in one diagram can be used in the other diagram. This functionality is emphasized by the code-generation facility. Although I personally did not like to use this facility but its a handy tool specially when dealing with very large projects. The fact that umbrello supports code-generation in many languages adds to the tool-box of the designer.<br />
<br />
How to install umbrello in Ubuntu? <br />
<blockquote>$ sudo apt-get install umbrello</blockquote>Once installed the program is available in Applications--> Programming menu.Zahid Irfanhttp://www.blogger.com/profile/05600816176020222306noreply@blogger.com1tag:blogger.com,1999:blog-12418853.post-24884540824043327532010-04-07T02:15:00.001+05:002010-05-02T17:24:49.440+05:00Overcoming Python in Ubuntu 9.10Python's rise to power is imminent by claims that Python alongside PHP/ Perl is the "P" in LAMP. This is equivalent to knighthood amongst geeks. <br />
<br />
Python fascinates developers who are very much conscious about productivity. The first step is to ensure Python is installed so here is the command to do so in Ubuntu 9.10. (Most likely it would already be installed). <br />
<blockquote>$ sudo apt-get install python </blockquote>The first step to testing a language is to write a hello world program.<br />
<br />
<b><span style="font-size: large;">Hello World Program</span></b><br />
Python's manner of saying hello world to the world is different. Go to terminal and write the following command to invoke python.<br />
<blockquote>$ python</blockquote>Once inside the shell. Type print "hello world" and the output hello world will appear.<br />
<br />
<blockquote>>>> print "hello world"<br />
hello world</blockquote>Another way of saying hello from the Python world is via creating a text file and writing the same in it and then saving it say "helloworld.py" and then on the command prompt executing the following statement.<br />
<blockquote>$ python helloworld.py </blockquote>Or to write the following in the interactive shell. (Please note that .py is not written)<br />
<blockquote>>>>import helloworld</blockquote><b><span style="font-size: large;">The Next Step Forward </span></b><br />
A very easy but powerful command can be used is called "subprocess". This helps in executing the shell commands. This simply executes the "df -h" command. The format is to first import the subprocess and then <br />
<blockquote>>>> import subprocess<br />
>>> subprocess.call(["df","-h"])<br />
Filesystem Size Used Avail Use% Mounted on<br />
/dev/sda1 1299.4G 5.0G 4.0G 56% /<br />
udev 490M 228K 490M 1% /dev</blockquote><span style="font-size: large;"><b>Functions in Python</b></span><br />
Lets take a leap here and write a recursive function so that our imagination is tested and concepts build on sound footing. Write the following code in a text file and name it factorial.py<br />
<blockquote> def fact(n):<br />
if n==1:<br />
return 1<br />
else :<br />
return fact(n-1)*n</blockquote>Notice how similar it is to the factorial code written in any other C-lookalike language. The keyword def indicates the start of a function. Now execute the code in the interactive shell using the following commands.<br />
<blockquote>Examples include finding 2!, 10! and 4! respectively <br />
>>> import factorial </blockquote><br />
<blockquote>>>> factorial.fact(2)<br />
2<br />
>>> factorial.fact(10)<br />
3628800<br />
>>> factorial.fact(4)<br />
24</blockquote>Now lets write another function but this time its not recursive rather its iterative version of Fibonacci Serics. Write the following in a text file and save as fibonnaci.py. Notice how multiple assignments and increments are being performed. <br />
<blockquote>def fib(n):<br />
a, b = 0, 1<br />
while b < n:<br />
print b,<br />
a,b = b, a+b</blockquote>Execute the function in the interactive shell using the following commands.<br />
<blockquote>>>> import fibonnaci<br />
>>> fibonnaci.fib(10)<br />
1 1 2 3 5 8<br />
>>> fibonnaci.fib(100)<br />
1 1 2 3 5 8 13 21 34 55 89 </blockquote><span style="font-size: large;"><b>Object-Oriented Python</b></span><br />
Python being a very clean language also helps one to define classes in a sleek manner. Write the following in a text file and save as PrintName.py<br />
<blockquote>class NameClass :<br />
myFirstName, myLastName = "Alexia", "Candella"<br />
def printName(self):<br />
print self.myFirstName <br />
print self.myLastName</blockquote>Now write the following in the interactive shell to test not only the class method but also to create the instance of the class.<i>{Notice that PrintName is the name of the module loaded. Hence required to create instance of the class NameClass}</i><br />
<blockquote>>>> import PrintName<br />
>>> x=PrintName.NameClass()<br />
>>> x.printName()<br />
Alexia<br />
Candella</blockquote><br />
Its believed that after doing this little exercise the python language has been overcome. Now the next part is to move on and do some serious stuff. This can be accomplished by using the tools of the language and combining to solve the problems and learning the language along the way. A very good reference is available <a href="http://docs.python.org/tutorial">here</a>.Zahid Irfanhttp://www.blogger.com/profile/05600816176020222306noreply@blogger.com0tag:blogger.com,1999:blog-12418853.post-30583403001022128572010-03-25T02:22:00.002+05:002010-05-02T17:25:20.938+05:00Experimenting Java Enterprise Edition (EE) SDK 6 on Ubuntu Linux<span style="font-size: large;"><b>Installations</b></span><br />
Soon after downloading the Java EE on Ubuntu machine through the <a href="http://java.sun.com/javaee/downloads/index.jsp">website</a> the file (~48 MB) called java_ee_sdk-6-web-unix.sh. An attempt to run the shell script resulted in the following error.<br />
<blockquote style="color: blue; font-family: "Courier New",Courier,monospace;">Could not locate a suitable Java runtime.<br />
Please ensure that you have Java 6 or newer installed on your system<br />
and accessible in your PATH or by setting JAVA_HOME</blockquote>This requires installation of Java 6 by using the following command (another roughly 55 MB).<br />
<blockquote><span style="color: blue; font-family: 'Courier New', Courier, monospace;">$ sudo apt-get install sun-java6-jdk</span></blockquote>Now going back to the Java EE installation through the following command.<br />
<blockquote><span style="color: blue; font-family: 'Courier New', Courier, monospace;">$ sh java_ee_sdk-6-web-unix.sh </span></blockquote>Going through the clicks (one has to only write the password for admin account and the proxy if any). Rest of the information is filled in by default.<br />
<br />
<span style="font-size: large;"><b>Verifying Installation</b></span> <br />
Now go to the web browser and type the following in the address box.<br />
<blockquote style="color: blue;"><span style="font-family: 'Courier New', Courier, monospace;">http://localhost:4848</span></blockquote>If you changed the value of admin control panel port. Please replace 4848 with the port number you specified during installation. This would open the administration control panel (shown below) and demand user name and password. Please put the username/ password which were set during installation. <br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhN-76xfUttzGS3okHX9KNKiXb9yhfdDqehqDzO0Jyd-dhcIVYPgMRRkhMLxZTPNI_WDDaOZxVMt3wkyz7bRWFlhJCX6wwjNLKJg8L31kW5fOLM6kkbSyXxdqKAoScddVxUN5vvdA/s1600/GlassFishAdmin.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhN-76xfUttzGS3okHX9KNKiXb9yhfdDqehqDzO0Jyd-dhcIVYPgMRRkhMLxZTPNI_WDDaOZxVMt3wkyz7bRWFlhJCX6wwjNLKJg8L31kW5fOLM6kkbSyXxdqKAoScddVxUN5vvdA/s400/GlassFishAdmin.JPG" width="400" /></a></div><br />
<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;"></div><br />
After the username and password has been entered the following window will appear.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzBuyrfCE8q2FfFulQMwYod6muy5U_Am2YYF-6RquNie8aDXV39lmPMJ4AEdGN5cRtv8YtaDAq3LXvBgCzs0u7qqGKSM16ZQ9e5ATUt85UMsOioJlCkr6ay9aCVLJxf-OrCjvKUQ/s1600/GlassFishAdminPanel.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzBuyrfCE8q2FfFulQMwYod6muy5U_Am2YYF-6RquNie8aDXV39lmPMJ4AEdGN5cRtv8YtaDAq3LXvBgCzs0u7qqGKSM16ZQ9e5ATUt85UMsOioJlCkr6ay9aCVLJxf-OrCjvKUQ/s320/GlassFishAdminPanel.JPG" width="320" /></a></div><br />
<br />
<br />
<span style="font-size: large;"><b>Deploying Sample Application</b></span><br />
<br />
Download the application hello.war from the website <a href="https://glassfish.dev.java.net/downloads/quickstart/hello.war">here</a>. Click on Applications on the tree on the right side and click the button deploy and then point to the path where the hello.war was downloaded.<br />
<br />
Then write the following in the address box of the web browser and write your name in the box and click submit. <br />
<br />
http://localhost:8080/hello/<br />
<br />
<br />
The following output will appear hence showing that the Java EE 6 has not only been installed but also working.<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnJegCDTt4HGAvgYEeTF0GZ6I1p3dPDZXMGZXRlGv6lLAsZocY4JPwLkpzRKItCzZ9E-gYwbmMQ-XXe2jcCeeleWlYS6DA2D1PNp8-45ViRyycgjIwiAo7xZC-f7Cix4unZu66Sw/s1600/GlassFishHello.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnJegCDTt4HGAvgYEeTF0GZ6I1p3dPDZXMGZXRlGv6lLAsZocY4JPwLkpzRKItCzZ9E-gYwbmMQ-XXe2jcCeeleWlYS6DA2D1PNp8-45ViRyycgjIwiAo7xZC-f7Cix4unZu66Sw/s400/GlassFishHello.JPG" width="400" /></a></div><br />
The next step is to develop applications using the Java EE standard. This requires knowledge of EJB, Components, three tier architecture and advanced java programming.Zahid Irfanhttp://www.blogger.com/profile/05600816176020222306noreply@blogger.com1tag:blogger.com,1999:blog-12418853.post-57178723918745667902010-03-22T20:51:00.000+05:002010-03-22T20:51:14.275+05:00Virtualization :: Old wine in new bottlesVirtualization dates back to the introduction of CP/CMS later renamed IBM VM-370. VM-370 provided two key ingredients. Multiprogramming and extended machine with better interface with the hardware[1]. The recent interest in Virtualization came on the back drop of energy conservation and providing services to users. The explosive growth of the needs of internet and data centers has fueled this renewed interest in Virtualization. <br />
<br />
<b>Virtualization Software</b><br />
Already have experimented with a virtual machine player <a href="http://www.vmware.com/products/player/">VMware Player</a> marketed by VMware Inc. Using this we installed FreeBSD, Ubuntu, Gentoo on top of Windows XP.<br />
<br />
Whats the next step towards Virtualization? Hypervisor? Hypervisors are of two basic types. Type one are those which provide direct interface between the Guest OS and the hardware. While the type two hypervisor has a host OS onto which the virtualization software is installed and then the guest OS is installed. VMware ESX and GSX are examples of type 1 and type 2 hypervisors.<br />
<br />
<b>Benefits</b><br />
So what exactly does Virtualization achieve? The increasing needs of users demanded setting up servers for individual applications. Email Server, Web Server, Internet Server, Print Server, File Server and many more servers are routinely installed and maintained by IT departments in large organizations. Now with the advent of superior hardware the needs of the users can be served by using only one machine with all these server applications running on it. This is generally not possible due to limitations/ requirements of using different OS for different applications. So its better to use hypervisors and install as many applications as possible over a set of hardware. This is not only energy efficient but due to hypervisors as easy to maintain as the each individual servers.<br />
<br />
<b>Drawbacks</b><br />
The primary drawback is performance issues. Maintenance could also prop up as a problem (which it tended originally solved) but separate machines might be better from Maintenance. Another issue is security.<br />
<br />
<b>Genuine breakthrough or simply old wine in new bottles</b><br />
Virtualization<b> </b>is one of the few ideas which came back from the dead and took the world by storm. Its importance is gaining due to another technology. Cloud Computing is getting more and more pervasive and this has helped virtualization gain more strength and appeal. Clouds of applications can be maintained by using virtualization like never before. Calling it old win in a new bottles will be a little bit too simplistic. Although on the face of it, virtualization does borrow from the good old VM/370 but with the advent of internet and cloud computing its given the old wine a very nice taste. Application like <a href="http://www.vmware.com/products/vsphere/">VMware vSphere </a>for data center virtualization are changing the meaning of virtualization. Amazon's Elastic Cloud Compute (EC2) enables users to rent out computers to run applications using virtualization as a building block to create the EC2. Grid Computing, an effort where (even geographically) diverse machines come together and try to solve a single task, is defined by Plaszczak/Wellner as "the technology that enables resource virtualization, on-demand provisioning, and service (resource) sharing between organizations."[3].<br />
<b> </b><br />
A very nice but pretty detailed and long introduction is available <a href="http://www.infoq.com/articles/virtualization-intro">here</a>. <br />
<br />
<b>References</b><br />
[1] Tanenbaum, A. S., "Modern Operating Systems", Third Edition, 2008<br />
[2] http://www.infoq.com/articles/virtualization-intro<br />
[3] P Plaszczak, R Wellner, <i>Grid computing</i>, 2005, Elsevier/Morgan Kaufmann, San FranciscoZahid Irfanhttp://www.blogger.com/profile/05600816176020222306noreply@blogger.com0tag:blogger.com,1999:blog-12418853.post-5725101825456315372010-03-08T12:42:00.000+05:002010-03-08T12:42:03.894+05:00How and where should I change proxy settings in Linux?<span style="font-size: x-small;"><b style="color: red;">PLEASE NOTE THAT IF YOU ARE USING DIRECT CONNECTION TO THE INTERNET THEN THE FOLLOWING POST DOES NOT APPLY. TRYING TO SET THE SETTINGS MAY LEAD TO DISRUPTIONS / DISCONNECTION FROM THE INTERNET.</b></span><br />
<br />
How and where should I change proxy settings in Linux? This is a most frequent question posed by newbie (and not so new) Linux users ? This mountain can be scaled in three steps.<br />
<h2>Step 1 Using proxy to get <i>simply</i> connected to the internet</h2>Just change proxy setting in Firefox and/ or browser of your choice and start using internet. Ignore the rest of urges of Linux to get updates etc and life will be cool and simple.<br />
<br />
<br />
Of course life cannot continue to be so simple. One has to after all install programs etc. <br />
<h2> </h2><h2>Step 2 Adding proxy for system-wide settings<br />
</h2>Now the next step is to setup proxy for "system-wide" setting. If using GNOME got to the System-> Preferences -> Network Proxy. Typical settings could be ip address/ host name of the proxy server and port name (typically 8080). Click system-wide settings button and then authenticate by the root password. This would add system-wide system proxy settings and ability to use package managers and instant messengers.<br />
<h2>Step 3 Adding proxy to the terminal</h2>Reading through the manuals/ howtos (including those on this blog) the sudo apt-get install (or yum or other variants of package install commands) frequently need proxy settings. The proxy settings can be setup via the following command sequence.<br />
<br />
Edit your .bashrc file present in home directory in your favorite editor. Here vi is used for demonstration. <br />
<blockquote>$ vi .bashrc</blockquote>Go to the end and add the following please note # indicates comments its healthy practice to write comments so that later we know why we wrote the particular lines.<br />
<blockquote># Proxy settings<br />
export http_proxy="http://MY_PROXY_IP_OR_HOST:MY_PROXY_PORT"<br />
export ftp_proxy="http://MY_PROXY_IP_OR_HOST:MY_PROXY_PORT"</blockquote><br />
Please ensure to replace MY_PROXY_IP_OR_HOST by the proxy server ip or host name and MY_PROXY_PORT by port number (typically 8080). <br />
<br />
Close the terminal and start again. Test out by writing export in the command line and it should be followed by a long list and at the end you should find.<br />
<br />
declare -x http_proxy="http://MY_PROXY_IP_OR_HOST:MY_PROXY_PORT"<br />
declare -x ftp_proxy="http://MY_PROXY_IP_OR_HOST:MY_PROXY_PORT"<br />
<h2> </h2>{Please note the MY_PROXY_IP _OR_HOST and PROXY_PORT will be replaced by the ip/ host name and port number you specify earlier}<br />
<br />
A simple test whether the settings have been done is by the following command (if available). It should open the command line browser and open google's webpage. <br />
<blockquote>$ w3m www.google.com</blockquote><br />
Now the apt-get install and other commands requiring connection to internet via proxy should work.Zahid Irfanhttp://www.blogger.com/profile/05600816176020222306noreply@blogger.com0tag:blogger.com,1999:blog-12418853.post-91039855387342549052010-03-01T00:03:00.004+05:002010-03-01T09:22:55.151+05:00Linux LAMP raising jinn and exorcising demonsIn the early nineties Linux was a hobby, which in <a href="http://www.linux.org/people/linus_post.html">the words of Linus <em>Torvalds</em> </a>might never be professional like GNU. It took off and shook the foundations of empires aspiring to bleed every penny by selling server operating system. The contributions of open source community have caused severe headache for software companies. Apache Foundation is one such name. How much does it cost to setup a web server? Around the cost of a LAMP, compare this with the cost of aptly named vamp or is it WAMP? What jinn did the lamp raise? What changes did it trigger? A very simple question is how come Ethernet and Networks were around in the seventies but it took just a couple of years after Linux for Internet to raise it head? The answers to all these questions is there was no LAMP earlier.<br />
<br />
LAMP stands for Linux Apache MySQL PHP (Python / Perl). This is open source combination which gives a head start to web development environment. LAMPs have been around for not very long but the LAMP was developed gradually. First came Linux and then after couple of years it was Apache, followed by MySQL and PHP. Apache web server became the default choice because number one it was open source (and free) and secondly it integrated pretty well with Linux. Just imagine telling a windows user that the configurations of Apache can be done via httpd.conf file. Now first question asked by the window's user is ok http is understandable but what is the “d” and secondly what is .conf extension? So the integration of Apache into windows as a service is pretty much artificial and although it works ok but Linux & Apache go together.<br />
<br />
Next comes MySQL. MySQLis open source (and free). So that makes it the choice for database and its whole organization and architecture seamlessly fits into the Linux frame of mind. Just imagine having web interface for database management and then using ports to access databases. Windows does not deal in ports (until very late).<br />
<br />
Now PHP is a completely scripting language which looks somewhat like C. Again C and scripts rings Linux/Unix bells. PHP created circa 1995 so were Apache and MySQL. Internet boomed and growth quadrupled ever since. <br />
<br />
<a href="http://lwn.net/Articles/189186/">This article</a> also deals with similar subject and associated history.Zahid Irfanhttp://www.blogger.com/profile/05600816176020222306noreply@blogger.com0tag:blogger.com,1999:blog-12418853.post-54270408799099594892010-02-24T11:51:00.000+05:002010-02-24T11:51:57.252+05:00The LISP-end of the computingLISP never introduced until very late in school and that too in the form of ONE slide (yes true) one slide. So what is it in LISP that deserves so little concern. Looking at MIT OCW lectures it seems to be THE language of choice. So whats lisp infact? LISP (LISt Processing) is a language where the primary data structure is list and modus operandi is list operations. <br />
<br />
<span style="font-size: large;"><b>Step 1: Installation</b></span><br />
Installation of lisp on aptitude based package manager (like Debian/ Ubuntu) can be achieved by the following command.<br />
<blockquote> $ sudo apt-get install clisp</blockquote>Alongside this its recommended to install the HTML version of the book Common Lisp the language, 2nd Edition by Guy L. Steele Jr. <br />
<blockquote>$ sudo apt-get install cltl </blockquote>The book is installed in the /usr/share/doc/cltl/clm/index.html. <br />
<br />
<b><span style="font-size: large;">Step 2: Testing LISP functionality</span></b><br />
Soon after installation clisp can be tested for functionality. The following sequence of commands test the lisp environment.<br />
To start clisp<br />
<blockquote>$ clisp</blockquote>Try out the lisp-expression to add 2 and 2 the result is in the second line. <br />
<blockquote>[1]> (+ 2 2)<br />
4</blockquote>Build on more complex lists. The following expression is lisp way of (1*2)+ 6.<br />
<br />
<blockquote>[2]> (+ (* 1 2) 6)<br />
8</blockquote>Now with the increase in comfort and confidence that lisp is installed and functional. Assigning values to variables is done via the following command<br />
<blockquote>[3]> (setq a 10)<br />
10</blockquote>For an extremely simple loop using the print command to print hello world five times.<br />
<blockquote>[4]> (do ((x 1 (+ x 1))) ((> x 5)) (print "hello world"))<br />
<br />
"hello world" <br />
"hello world" <br />
"hello world" <br />
"hello world" <br />
"hello world" <br />
NIL</blockquote><span style="font-size: large;"><b>Step 3: Doing something more than "hello world" </b></span><br />
Having done with assignments and control structures. The next thing is procedures / functions. LISP supports functions via the keyword defun. <br />
<blockquote>[5]> (defun increment (x) (+ x 1))<br />
INCREMENT<br />
[6]> (increment 10)<br />
11</blockquote> The line 5 defines the function named increment which essentially has one argument and one line in which the argument is incremented by one. The line 6 calls the function increment with the argument passed as second member of the list.<br />
<br />
The following code finds the square of a variable x. <br />
<blockquote>(defun square(x) (x*x))<br />
(setq x 10)<br />
(square x)</blockquote>Exploration of LISP on emacs is another really interesting topic which needs a dedicated post.Zahid Irfanhttp://www.blogger.com/profile/05600816176020222306noreply@blogger.com0tag:blogger.com,1999:blog-12418853.post-37104046133345722982010-02-24T11:44:00.000+05:002010-02-24T11:44:07.394+05:00Why hibernating Linux might be a great ideaWhy hibernating Linux might be a great idea? What supports the idea? There are basically two reasons that support this idea. One Linux has traditionally lived up to the billing as premium server class operating system. Secondly it might strange but Windows has performed much better on Laptop using hibernate option than desktops. The former is a direct evidence support the convention while latter is circumstantial evidence. Since Windows is performing better in spite of it’s not so glorious record otherwise. So Linux can be expected to perform better than Windows because of its better history. The conjecture that server’s better performance can be attributed to the lesser frequent restarts needs to be further investigated but for now we could assume it to be true. Therefore its important to start setting up the hibernate option in the Operating System (be it Windows or Linux on laptop or a desktop). Its very good for the battery life too.<br />
<br />
<span style="font-size: large;"><b>Steps for initiating hibernate inUbuntu Linux (Karmic 9.10)</b></span><br />
Ubuntu click on your user name on the task bar and select "Hibernate" from the menu. <br />
<br />
<span style="font-size: large;"><b>Steps for initiating hibernate in Windows</b></span><br />
<span style="font-size: small;">XP Operating System the option can be </span>accessed by clicking Control Panel --> Power Options --> Selecting the tab Hibernate. Click the box next to Enable Hibernate (it would be checked by a tick mark). Next go to Advanced Tab and select actions to perform when the lid of the portable computer is closed , Power button is pressed or standby button is pressed.Zahid Irfanhttp://www.blogger.com/profile/05600816176020222306noreply@blogger.com0tag:blogger.com,1999:blog-12418853.post-34767248860723068182010-02-18T19:40:00.002+05:002010-02-18T19:58:13.806+05:00The Evolution that is LinuxThe availability of huge number of Linux distributions is amazing. The primordial soup developed by Dennis Ritchie and Ken Thompson named UNIX had in it genesis the most amazing OS Multics. The primordial soup gave birth to a phenomenon which resulted in evolution of one beautiful species after another. The rise of Lisa led to Mac. Even the great evil empire acknowledged its superiority by first trying to develop Xenix and when it failed in its attempt to usurp started slowly building in features into its own Windows. A mutation took place in 1991 when Linux Travolds gave birth to Linux. This led to the never ending stream of species. Each and every species had its strengths and weaknesses but every species showed the brilliance and resilience that was present in its initial genes. The Linux of today cannot be compared directly to the MULTICS or even the first UNIX but the design is same providing solid and unbeatable performance. Not only is Linux and FreeBSD holding on to the server markets but also under the hood of iPhones and ARM processors. Spreading its seeds across all continents be it the PC Market or Laptop or Mini-Laptop Market, the species continues to awe its original developers.Zahid Irfanhttp://www.blogger.com/profile/05600816176020222306noreply@blogger.com1tag:blogger.com,1999:blog-12418853.post-31240030728704186162010-02-11T02:12:00.002+05:002010-02-18T19:59:11.963+05:00Linux Newbie : Why I cannot use Latex like those gurus?Latex is another brilliant Linux / Unix specialty hidden behind the geek facade. Interesting introduction <a href="http://mirror.ctan.org/info/lshort/english/lshort.pdf">here {warning PDF file}</a> talks in detail about why and how document processing improves with increase in document complexity. In the words of the author <i>"It is very hard to write unstructured and disorganized documents"</i>. I like the approach but feel that this might attract power users but for newbies its more of the same old school of Linux is for geeks. The purpose is not to criticize the authors. He / she did a great job and deserves credit for this article as well. Now the primary question is how and where to start, following tutorials almost always leads to temporary use. Even students writing thesis in latex only a few would later use it for submitting assignments or other work. The problem is two fold one the students or users are not introduced to latex in a friendly manner rather they use it as if trying to live up to the 'lofty standards' setup by advisers or seniors. The second problem was highlighted when a highly motivated student submitted a journal paper in pdf format (developed via pdflatex) to the supervisor. The supervisor demanded an MS-Word Copy of the paper so as to edit. The student completely disgruntled vowed never to use Latex again.<br />
Therefore a complete change of heart is required to accept Latex. Once this step has been done getting to grips with Latex becomes easier and fun. <br />
<br />
<span style="font-size: large;">Step one: Getting Latex </span><br />
The following method is for Ubuntu. Please google/ contact service manual on how to install on other distributions or <a href="http://www.tug.org/texlive/doc/texlive-en/texlive-en.html#x1-150003">here</a> for steps.<br />
<br />
Ubuntu / Debian : $ apt-get install texlive<br />
<br />
<span style="font-size: large;">Step two: Starting up </span><br />
Its never an easy job getting used to something as complex and with such <a href="http://en.wikipedia.org/wiki/TeX#History">rich history</a> like tex. Using a gui-based tex would be a perfect way to not getting to use tex later. Since in that scenario it is incorrectly compared to microsoft and open office. Yes those programs are good to get work done but they are not anything like tex. Why? This would become clear soon.<br />
Write the following text in a file using editor of your choice (<i>freedom at last</i>). <br />
<blockquote>\documentclass{article}<br />
\title{Welcome to Freedom}<br />
\begin{document}<br />
\maketitle<br />
This is a sample document which showcases the freedom and peace of mind offered by using {LATEX}<br />
\end{document}</blockquote>The following command creates an output file (pdf format) with same name as the name of the tex file.<br />
<blockquote>$ pdflatex firstTry.tex </blockquote><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXIFr1z1utvAkjMKZ1U4QYJcE9zm6XeBroqbdKdOvSyr9ZxZfcASbvWq5NWasKGVuSCYZqXN-9Mz5BoUGA5tdbWhw5eQcQDvf-HmoSrX7fjhGfl3Z0yMlFBZB2XjAg0TU9A9V8-w/s1600-h/firstTry.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="170" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXIFr1z1utvAkjMKZ1U4QYJcE9zm6XeBroqbdKdOvSyr9ZxZfcASbvWq5NWasKGVuSCYZqXN-9Mz5BoUGA5tdbWhw5eQcQDvf-HmoSrX7fjhGfl3Z0yMlFBZB2XjAg0TU9A9V8-w/s400/firstTry.jpg" width="400" /></a></div><br />
So here lies the first charm of latex that my readers dont need to buy expensive EDITING software just to read what i write.<br />
<br />
How did latex decide about the placement of the title and date and fonts. The key to success lies in the fact that the document design and text has been separated. Hence now the user can concentrate on producing text rather than deciding about placement of text, font sizes and other details that confound a user trying to use a word processor. This fact can be readily appreciated by a simple change in the above code. Change <i><b>\documentclass{article}</b></i> to <b><i>\documentclass{report} or </i></b><b><i>\documentclass{book}</i></b>. The resulting pdf file exhibits that the formating of the document can be changed at any stage and the user is least bothered how the document looks while typing the document. This is immense relief.<br />
<br />
This bare-minimum tex file <i>ONLY</i> demonstrates the principle of separation of formatting and content. <br />
<br />
<br />
<span style="font-size: large;">Step three: Adding more functionality </span><br />
Now that fear of tags has subsided. The following tags add more formating information.<br />
\section {SECTION_HEADING_HERE}<br />
\subsection{SUB_SECTION HEADING_HERE}<br />
\subsubsection{SUB_SUB_SECTION_HEADING_HERE}<br />
<br />
Incorporate the above tags in the file as below. <br />
<br />
<blockquote>\documentclass{article}<br />
\title{Welcome to Freedom}<br />
\begin{document}<br />
\maketitle<br />
This is a sample document which showcases the freedom and peace of mind offered by using \LaTeX<br />
\section{Formating Sections}<br />
The best part is that you dont have to set font sizes and then try to place the<br />
section headings<br />
\subsection{Sub Sections are cool}<br />
Adding simple tag of subsection simply adds more sections and special part is there is no numbering involved. The numbering is dealt with automatically at the time of preparing pdf file.<br />
\subsubsection{Moving further inside we can enjoy better functionality}<br />
This shows how easy it is create subsections within subsections. Simply continue<br />
to add sub behind the tag and it goes deeper and deeper.<br />
\section{Simplicity is still the essence}<br />
So the current document if shown to a novice will scare away but we are begining to get the feel of Latex.<br />
Rest would be mostly easier part<br />
\end{document}</blockquote>The following screen shot exhibits the usage of the above tags.<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgffNzyA4ivHPsokZ1L8gkFXpWW8kQL1USJfl04lUACpAuJMpgRG9PfmSIJZ-oJ6yz6jkKieMTqQsHLhBSDAb7hSvO1UAP3gJVPCIuuLfFoTJaTqWgPWRBjxMkwYTzbZujwJZoWgg/s1600-h/firstTry-2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="280" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgffNzyA4ivHPsokZ1L8gkFXpWW8kQL1USJfl04lUACpAuJMpgRG9PfmSIJZ-oJ6yz6jkKieMTqQsHLhBSDAb7hSvO1UAP3gJVPCIuuLfFoTJaTqWgPWRBjxMkwYTzbZujwJZoWgg/s400/firstTry-2.jpg" width="400" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwkJ8Mf3WM5NVjHDkzrjxLoIdGZIE4QV1eQvRrYu2kjWNOuhpz1bm0Y3uoSV7gIfI26rAHqcWlJcjQqudbyKjgC5CRfepgjy442KxBZYHg3GmoWQZYGeOojXsZFwiPNf9VJP6ESA/s1600-h/firsttry-3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="151" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwkJ8Mf3WM5NVjHDkzrjxLoIdGZIE4QV1eQvRrYu2kjWNOuhpz1bm0Y3uoSV7gIfI26rAHqcWlJcjQqudbyKjgC5CRfepgjy442KxBZYHg3GmoWQZYGeOojXsZFwiPNf9VJP6ESA/s400/firsttry-3.jpg" width="400" /></a></div>Adding \tableofcontents after \maketitle adds table of contents automatically.<br />
<br />
<br />
<span style="font-size: large;">Step four: Moving on to power usage</span><br />
Moving on to power usage requires the approach according to the Chinese proverb.<br />
<blockquote><br />
<dl><dt>Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.</dt>
</dl></blockquote>Instead of going into the details of each and every command/ tag. Its far better to use the "i will learn it when I need it" approach. This can only be achieved by keeping a tap on where to get the desired information. One method is to use "<a href="http://www.ctan.org/tex-archive/info/lshort/english/lshort.pdf">The (Not So) Short Introduction to LATEX 2E</a>" as a reference and simply copy and use any commands (examples) and tweak to requirement.<br />
<br />
For Example , In order to add mathematical equations and use them effectively the best manner is to actually go and check out an example in the tutorial and study them. The following code fragment adds the equations given in the screen shot that follows.<br />
<blockquote>\section{Explaining how to write Mathematical Equations}<br />
One simple way to write mathematical equations is $A_x^2$ or using the tags begin equation and end equation<br />
\begin{equation}<br />
\sum_{i=0}^{\infty} X_i=0<br />
\end{equation}<br />
\begin{equation}<br />
\omega = \Omega<br />
\end{equation}<br />
\begin{equation}<br />
\sigma = \Sigma<br />
\end{equation} </blockquote><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlIrV75b0GBImzVG-ZHlCzt8RCWiYCiKkANIZ-miTMwFWYHEygaXP4jVqLHKABnzULprfU2F4jtBsFXX7cNdmhHYT6mwWmv8qbzB91GakUCM_0Y1gueQJxXvOg3QHDorsCrHMFIQ/s1600-h/firstTry-4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="152" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlIrV75b0GBImzVG-ZHlCzt8RCWiYCiKkANIZ-miTMwFWYHEygaXP4jVqLHKABnzULprfU2F4jtBsFXX7cNdmhHYT6mwWmv8qbzB91GakUCM_0Y1gueQJxXvOg3QHDorsCrHMFIQ/s400/firstTry-4.jpg" width="400" /></a></div><br />
<br />
The code fragments shows in order to write subscript _ is used while to write as superscript ^ is used. Also another thing to notice is that \sigma outputs lower case Greek alphabet sigma while \Sigma outputs an upper case Greek alphabet sigma. <br />
<br />
Another method more in line with the Chinese proverb is the use of the template files provided by the publishers. E.g., IEEE conference style file (IEEEconf.sty) comes with a <a href="http://www.ctan.org/tex-archive/macros/latex/contrib/IEEEconf/IEEEconf.pdf">pdf</a> which explains all the features and how to use IEEEconf.sty. Similarly University of California Los Angeles (UCLA) thesis style file comes with a <a href="http://mirror.ctan.org/macros/latex/contrib/ucthesis/README">readme file</a> which explains how to use it.<br />
<br />
This way by maintaining high level of confidence and keeping learning Latex while ACTUALLY using it to accomplish different tasks leads to better understanding and long term use.Zahid Irfanhttp://www.blogger.com/profile/05600816176020222306noreply@blogger.com4tag:blogger.com,1999:blog-12418853.post-75299337236255967072010-02-09T20:01:00.009+05:002010-02-18T19:59:39.678+05:00How to automatically change proxy setting in Firefox ?Proxy setting for office LAN / WLAN and home LAN / WLAN are often different. Firefox provides an easy method of changing proxies without having to do anything. The file proxy.pac provides an easy method of automatically changing proxy setting in Firefox from one network to another. There are elaborate methods of changing proxy settings given <a href="http://en.wikipedia.org/wiki/Proxy_auto-config">here</a>. However the easiest method is described below. <br />
<br />
Step 1: Edit the file proxy.pac (preferably save it at a convenient location) and add the following line.<br />
<blockquote><br />
<pre class="de1"><span class="kw2">function</span> FindProxyForURL<span class="br0">(</span>url<span class="sy0">,</span> host<span class="br0">)</span> <span class="br0"> </span></pre><pre class="de1"><span class="br0">{</span> </pre><pre class="de1"><span class="kw1"> return</span> <span class="st0">"PROXY proxy.example.com:8080; DIRECT"</span><span class="sy0">;</span> <span class="br0"> </span></pre><pre class="de1"><span class="br0">}</span></pre></blockquote>Where proxy.example.com is simply the address of proxy and could be replaced by the IP Address of the proxy server. 8080 is the port address for http in most networks but could be different in some networks.<br />
<br />
Step 2: Go to Firefox Menu--> Tools --> Options --> Network Tab --> Click Setting Button --> Check the automatic proxy configuration url and enter "file:///<b>your_path_goes_here</b>/proxy.pac" in it.<br />
Please ensure to replace the your_path_goes_here with the path where the file proxy.pac is saved. For example in my case it was file:///home/zahid/proxy.pac<br />
<br />
Now the Firefox will first check the proxy and if it is not responding then connect directly to the internet.<br />
<br />
This removes the head ache of changing proxy settings on an almost daily basis. Peace at last !! <br />
<br />
For those still using Internet Explorer ::: Please keep changing your proxy at regular intervals :)Zahid Irfanhttp://www.blogger.com/profile/05600816176020222306noreply@blogger.com0