<?xml version="1.0" encoding="UTF-8" standalone="no"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:gd="http://schemas.google.com/g/2005" xmlns:georss="http://www.georss.org/georss" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-5324599319882973732</atom:id><lastBuildDate>Fri, 30 Aug 2024 07:45:58 +0000</lastBuildDate><category>Ubuntu</category><category>Xen</category><category>Ubuntu10.04 LTS</category><category>GUI</category><category>Karmic Koala</category><category>Matlab</category><category>VGA</category><category>glxgears</category><category>GCC</category><category>Xen3.2</category><category>Xen4.0.1</category><category>address</category><category>bash</category><category>source</category><category>ssh</category><category>40_custom</category><category>BMC</category><category>C++</category><category>Control-C</category><category>Ctrl-C</category><category>David Wolinsky</category><category>Evil</category><category>FPS</category><category>File</category><category>GDM</category><category>GMP</category><category>IP</category><category>MPFR</category><category>Mesa</category><category>NTP</category><category>Pierre St. Juste</category><category>R2010b</category><category>Statistics</category><category>TightVNC</category><category>VLC</category><category>Windows</category><category>alter</category><category>anacron</category><category>archives</category><category>arguments</category><category>backup</category><category>bangalore</category><category>behavior</category><category>boot</category><category>brctl. dhclient</category><category>clock</category><category>clocksource</category><category>club</category><category>command</category><category>configure</category><category>cron</category><category>disable</category><category>domain</category><category>dri2proto</category><category>floating point</category><category>glproto</category><category>grub2</category><category>hard</category><category>if</category><category>inflate</category><category>kill</category><category>killall</category><category>known_hosts</category><category>libdrm</category><category>man-in-the-middle attack</category><category>mountaineering</category><category>network</category><category>password</category><category>process ID</category><category>python</category><category>rc</category><category>rsync</category><category>sftp</category><category>socket</category><category>ssh-keygen</category><category>static IP</category><category>stream</category><category>string</category><category>sudo</category><category>tar</category><category>tar.gz</category><category>translation</category><category>trap</category><category>unix</category><category>virt-manager</category><category>virtual manager</category><category>web</category><category>web archives</category><category>work</category><category>xdamage</category><category>xorg-macros</category><category>xtem Xvfb</category><category>xxf86vm</category><category>zip</category><title>You got to be kidding me!</title><description></description><link>http://whowhywhathow.blogspot.com/</link><managingEditor>noreply@blogger.com (Priya Bhat)</managingEditor><generator>Blogger</generator><openSearch:totalResults>29</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><language>en-us</language><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5324599319882973732.post-3161923588681013297</guid><pubDate>Wed, 13 Apr 2011 19:15:00 +0000</pubDate><atom:updated>2011-04-14T01:07:13.784+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Karmic Koala</category><category domain="http://www.blogger.com/atom/ns#">python</category><category domain="http://www.blogger.com/atom/ns#">Ubuntu10.04 LTS</category><category domain="http://www.blogger.com/atom/ns#">Windows</category><title>Winexe: To run code on windows machines from Linux</title><description>References:&lt;br /&gt;The instructions on this post are a summary of information collected from &lt;a href="http://mpov.timmorgan.org/winexe-on-ubuntu#comment"&gt;this&lt;/a&gt; link. And I made some changes to it as well&lt;br /&gt;&lt;br /&gt;These are instructions of how to get winexe working on Ubuntu 10.04.1 LTS system&lt;br /&gt;&lt;br /&gt;To begin with make sure your system has the required libraries:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;sudo apt-get install build-essential autoconf checkinstall&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;You will also need the python development libraries and header files:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;sudo aptitude install python python-all python-dev python-all-dev python-setuptools&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Now get the source code of winexe using svn. And apply the first patch:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;svn co http://dev.zenoss.org/svn/trunk/wmi/Samba/source&lt;br /&gt;cd source&lt;br /&gt;wget https://gist.github.com/raw/843062/5bb87c4fa13688f65ca8b1e54fc42676aee42e5a/fix_winexe_service.diff&lt;br /&gt;patch -p0 -i fix_winexe_service.diff&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Now there is bug in the source/winexe/service.c file:&lt;br /&gt;replace file &lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;#define NT_STATUS_SERVICE_DOES_NOT_EXIST NT_STATUS(0xc0000424)&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;with&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;#define NT_STATUS_SERVICE_DOES_NOT_EXIST NT_STATUS(0x00000424)&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Save,close and you are ready to compile:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;cd source/&lt;br /&gt;./autogen.sh&lt;br /&gt;./configure&lt;br /&gt;make proto bin/winexe&lt;br /&gt;sudo cp bin/winexe /usr/local/bin/&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;and now you can test that that winexe is working correctly by doing:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;winexe -W WORKGROUP -U Administrator%SecretPassword //192.168.xxx.xxx 'cmd.exe'&lt;/code&gt;&lt;/blockquote&gt;</description><link>http://whowhywhathow.blogspot.com/2011/04/winexe-to-run-code-on-windows-machines.html</link><author>noreply@blogger.com (Priya Bhat)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5324599319882973732.post-9020015930238665228</guid><pubDate>Thu, 13 Jan 2011 20:38:00 +0000</pubDate><atom:updated>2011-02-01T03:03:51.817+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">GCC</category><category domain="http://www.blogger.com/atom/ns#">Matlab</category><category domain="http://www.blogger.com/atom/ns#">Ubuntu</category><category domain="http://www.blogger.com/atom/ns#">Ubuntu10.04 LTS</category><title>Compiling C/C++ code from Matlab on Ubuntu Linux machine</title><description>It seems that there is much easier way of compiling and running &lt;code&gt;C/C++&lt;/code&gt; from your &lt;code&gt;Matlab&lt;/code&gt; application, than the &lt;a href="http://whowhywhathow.blogspot.com/2011/01/compile-gcc-from-souce-on-ubuntu-10041.html"&gt;one I was trying before&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Reproducing the instructions on &lt;a href="http://xcorr.wordpress.com/2010/05/07/getting-gcc-to-work-with-matlab-r2009b-on-linux-ubuntu-karmic-to-compile-mex-files/"&gt;this blog&lt;/a&gt; here:&lt;br /&gt;&lt;br /&gt;My version of gcc (4.4) is too high for Matlab R2009b (4.3), and Matlab chokes on it. The solution is as follows:&lt;br /&gt;&lt;br /&gt;Install gcc-4.3:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;&lt;br /&gt;sudo apt-get install gcc-4.3&lt;br /&gt;sudo apt-get install g++-4.3&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;In matlab, run mex -setup and select the GCC compiler.(Choose option 2). Next, at the command line:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;&lt;br /&gt;sudo gedit ~/.matlab/R2009b/mexopts.sh&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;Replace all instances of &lt;code&gt;CC=’gcc’&lt;/code&gt; with &lt;code&gt;CC=’gcc-4.3′,&lt;/code&gt; and al instances of &lt;code&gt;CXX='g++'&lt;/code&gt; with &lt;code&gt;CXX='g++-4.3'.&lt;/code&gt;&lt;br /&gt;And restart Matlab !</description><link>http://whowhywhathow.blogspot.com/2011/01/compiling-cc-code-from-matlab-on-ubuntu.html</link><author>noreply@blogger.com (Priya Bhat)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5324599319882973732.post-3321130737917828817</guid><pubDate>Thu, 13 Jan 2011 19:31:00 +0000</pubDate><atom:updated>2011-01-14T01:37:22.825+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">GCC</category><category domain="http://www.blogger.com/atom/ns#">GMP</category><category domain="http://www.blogger.com/atom/ns#">Matlab</category><category domain="http://www.blogger.com/atom/ns#">MPFR</category><category domain="http://www.blogger.com/atom/ns#">R2010b</category><title>Compile gcc from souce on Ubuntu 10.04.1 LTS</title><description>To run C/C++ code using the &lt;code&gt;mex&lt;/code&gt; utility of &lt;code&gt;Matlab 7.11.0 (R2010b&lt;/code&gt; I needed to compile a different version of GCC than what was already installed on my machine. (I had the &lt;code&gt;gcc version 4.4.1-4ubuntu9&lt;/code&gt; and the currently supported version with &lt;code&gt;mex&lt;/code&gt; is 4.3.4)&lt;br /&gt;&lt;br /&gt;So I downloaded &lt;code&gt;gcc-4.3 release&lt;/code&gt; from &lt;a href="http://gcc.gnu.org/gcc-4.3/"&gt;here&lt;/a&gt;.&lt;br /&gt;Untarred the file: &lt;code&gt;tar -jxvf gcc-4.3.4.tar.bz2&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;And now when I tried to use the &lt;code&gt;./configure&lt;/code&gt; from inside the &lt;code&gt;gcc-4.3.4&lt;/code&gt; folder, the system complained that it could not find two necessary API's namely GMP and MPFR.&lt;br /&gt;&lt;br /&gt;The issue can be resolved by doing the following. We need to (1) download the &lt;a href="ftp://ftp.gnu.org/pub/gnu/gmp/gmp-4.1.3.tar.bz2"&gt;GMP&lt;/a&gt; and &lt;a href="http://www.mpfr.org/mpfr-current/mpfr-3.0.0.tar.bz2"&gt;MPFR&lt;/a&gt; libraries separately , (2) place them inside the GCC folder and then, (3) tell the &lt;code&gt;configure&lt;/code&gt; script to look for it there.&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;tar -jxf gcc-4.3.2.tar.bz2&lt;br /&gt;tar -jxf mpfr-2.3.2.tar.bz2&lt;br /&gt;mv mpfr-2.3.2 gcc-4.3.2/mpfr&lt;br /&gt;tar -jxf gmp-4.2.4.tar.bz2&lt;br /&gt;mv gmp-4.2.4 gcc-4.3.2/gmp&lt;br /&gt;cd gcc-4.3.2&lt;br /&gt;./configure --with-gmp-include=$(pwd)/gmp --with-gmp-lib=$(pwd)/gmp/.libs&lt;br /&gt;make&lt;br /&gt;make install&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;/blockquote&gt;Hopefully, that should solve the issues !</description><link>http://whowhywhathow.blogspot.com/2011/01/compile-gcc-from-souce-on-ubuntu-10041.html</link><author>noreply@blogger.com (Priya Bhat)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5324599319882973732.post-3431454100613615226</guid><pubDate>Wed, 13 Oct 2010 18:54:00 +0000</pubDate><atom:updated>2010-10-14T00:33:01.242+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">boot</category><category domain="http://www.blogger.com/atom/ns#">GDM</category><category domain="http://www.blogger.com/atom/ns#">GUI</category><category domain="http://www.blogger.com/atom/ns#">Ubuntu</category><category domain="http://www.blogger.com/atom/ns#">Ubuntu10.04 LTS</category><category domain="http://www.blogger.com/atom/ns#">VGA</category><title>Disable the graphics on your machine</title><description>Just a quick note about how to disable the graphical user interface on your machine safely and quickly. This may be useful if you are having issues with your video card causing your system to crash. By disabling the graphics you could get command line interface to your machine.. and hopefully determine the exact problem to get your GUI to work.&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;&lt;br /&gt;mv /etc/init/gdm.conf /etc/init/gdm.disabled&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;This works on Ubuntu 10.04 LTS.&lt;br /&gt;Remember that this would disable the graphics on all your boots. Not just the the one from which you make the change. And of course run the reverse &lt;code&gt;mv&lt;/code&gt; command and reboot your machine to start your graphics again.</description><link>http://whowhywhathow.blogspot.com/2010/10/disable-graphics-on-your-machine.html</link><author>noreply@blogger.com (Priya Bhat)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5324599319882973732.post-7506019202960798332</guid><pubDate>Wed, 29 Sep 2010 15:59:00 +0000</pubDate><atom:updated>2010-09-29T21:52:52.773+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">known_hosts</category><category domain="http://www.blogger.com/atom/ns#">man-in-the-middle attack</category><category domain="http://www.blogger.com/atom/ns#">ssh</category><category domain="http://www.blogger.com/atom/ns#">ssh-keygen</category><title>Removing entries from the known_hosts</title><description>One often encounters the following error message, particularly in situations where the machine owning the target IP address has changed:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;&lt;br /&gt;user@host-machine:~$ ssh user@target_IP&lt;br /&gt;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&lt;br /&gt;@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @&lt;br /&gt;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&lt;br /&gt;IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!&lt;br /&gt;Someone could be eavesdropping on you right now (man-in-the-middle attack)!&lt;br /&gt;It is also possible that the RSA host key has just been changed.&lt;br /&gt;The fingerprint for the RSA key sent by the remote host is&lt;br /&gt;XX:XX:XX.&lt;br /&gt;Please contact your system administrator.&lt;br /&gt;Add correct host key in /home/user/.ssh/known_hosts to get rid of this message.&lt;br /&gt;Offending key in /home/user/.ssh/known_hosts:4&lt;br /&gt;RSA host key for target_IP has changed and you have requested strict checking.&lt;br /&gt;Host key verification failed.&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;The issue can be resolved by using the &lt;code&gt;ssh-keygen&lt;/code&gt; command with the &lt;code&gt;-R&lt;/code&gt; option to remove and update the &lt;code&gt;known_hosts&lt;/code&gt; file. Simply do:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;&lt;br /&gt;user@host-machine:~$ ssh-keygen -R target_IP -f /home/user/.ssh/known_hosts&lt;br /&gt;/home/user/.ssh/known_hosts updated.&lt;br /&gt;Original contents retained as /home/user/.ssh/known_hosts.old&lt;br /&gt;user@host-machine:~$ ssh user@target_IP&lt;br /&gt;The authenticity of host 'target_IP (target_IP)' can't be established.&lt;br /&gt;RSA key fingerprint is XX:XX:XX.&lt;br /&gt;Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;Warning: Permanently added 'target_IP' (RSA) to the list of known hosts.&lt;br /&gt;user@target_IP's password:&lt;br /&gt;Linux XenOpen 2.6.32.21-xen #2 SMP Mon Sep 27 10:23:06 EDT 2010 x86_64 GNU/Linux&lt;br /&gt;Ubuntu 10.04.1 LTS&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://whowhywhathow.blogspot.com/2010/09/removing-entries-from-knownhosts.html</link><author>noreply@blogger.com (Priya Bhat)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5324599319882973732.post-1435225073885849229</guid><pubDate>Wed, 29 Sep 2010 15:10:00 +0000</pubDate><atom:updated>2010-10-30T00:27:56.038+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">David Wolinsky</category><category domain="http://www.blogger.com/atom/ns#">Pierre St. Juste</category><category domain="http://www.blogger.com/atom/ns#">VGA</category><category domain="http://www.blogger.com/atom/ns#">Xen</category><category domain="http://www.blogger.com/atom/ns#">Xen4.0.1</category><title>Starting new domains on Xen 4.0.1 from command line</title><description>So, I have &lt;a href="http://lists.xensource.com/archives/html/xen-users/2010-09/msg00715.html"&gt;issues with my installation of Xen4.0.1&lt;/a&gt; as the graphics driver keeps crashes during boot up, resulting in a hung machine. For now, I am using a work around suggested by my colleagues &lt;a href="http://blog.davidwolinsky.com/"&gt;David Wolinsky&lt;/a&gt; and &lt;a href="http://ptony82.wordpress.com/"&gt;Pierre St. Juste&lt;/a&gt;, namely to disable the graphics display module (using "&lt;code&gt;mv /etc/init/gdm.conf /etc/init/gdm.disabled&lt;/code&gt;") and hence I only have command line access to my domain-0 at this point. &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;At this point, Domain-0 boots up just fine, and &lt;code&gt;xm&lt;/code&gt; and &lt;code&gt;xend&lt;/code&gt; seem to be working. I now need to start Virtual domains using only the command line. (Later I will explore ways to do the same thing using APIs like Virt-Manager, or its console variant Virt-install)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;b&gt; Creating an Image&lt;/b&gt;&lt;/div&gt;&lt;div&gt;The first step is to create an image that will hold the user-domain (domU) virtual disk. This can be just a raw zero-filled file and so we can use the &lt;code&gt;dd&lt;/code&gt; command here:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;dd if=/dev/zero of=/var/lib/xen/images/domain1.img oflag=direct bs=1M seek=2047 count=1&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;The above command will create &lt;code&gt;/var/lib/xen/images/domain1.img&lt;/code&gt; file of 2048MB although the actual data blocks are allocated in a lazy fashion. To reserve all the data blocks right away, get rid of the &lt;code&gt;seek&lt;/code&gt; option from above. So do:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;dd if=/dev/zero of=/var/lib/xen/images/domain1.img oflag=direct bs=1M count=2048&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;This will avoid data block allocation problems if the volume that holds the image is full. It is important to check that the image has the correct security context (permissions), otherwise access to the virtual disk will be denied to the user domain system. You can check this as follows:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;ls -l /var/lib/xen/images/domain1.img&lt;br /&gt;-rw-r--r-- 1 root root 2147483648 2010-10-13 10:23 /var/lib/xen/images/domain1.img&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;b&gt;Preparing a Xen configuration file for the installation&lt;/b&gt;&lt;br /&gt;Xen uses a configuration file per domain. The configuration for the domains is different because we have to provide installation kernels, initial ram-disk and possibly some boot parameters. The domainU installation initrd image and kernel for my machine architecture (64-bit x86) can be downloaded from &lt;a href="http://archive.ubuntu.com/ubuntu/dists/lucid/main/installer-amd64/current/images/netboot/xen/"&gt;this page&lt;/a&gt;. You can put them in some sensible directory and name them appropriately.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;&lt;code&gt;root@Xen-Open:~# mkdir /home/user/x86_64_domU_images&lt;br /&gt;root@Xen-Open:~# cd /home/user/x86_64_domU_images&lt;br /&gt;root@Xen-Open:~/x86_64_domU_images# &lt;span class="Apple-style-span"&gt;wget http://archive.ubuntu.com/ubuntu/dists/lucid/main/installer-amd64/current/images/netboot/xen/initrd.gz&lt;/span&gt;&lt;br /&gt;root@Xen-Open:~/x86_64_domU_images# &lt;span class="Apple-style-span"&gt;wget http://archive.ubuntu.com/ubuntu/dists/lucid/main/installer-amd64/current/images/netboot/xen/vmlinuz&lt;/span&gt;&lt;br /&gt;root@Xen-Open:~/x86_64_domU_images# ls&lt;br /&gt;&lt;span class="Apple-style-span"&gt;initrd.gz&lt;/span&gt;  vmlinuz&lt;br /&gt;root@Xen-Open:~/x86_64_domU_images# gunzip -c initrd.gz &gt; initrd.img&lt;br /&gt;root@Xen-Open:~/x86_64_domU_images# ls&lt;br /&gt;initrd.gz  initrd.img  vmlinuz&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;In this example, the kernel and the initrd image were named &lt;code&gt;/home/user/x86_64_domU_images/vmlinuz&lt;/code&gt; and &lt;code&gt; /home/user/x86_64_domU_images/initrd.img&lt;/code&gt; respectively. With the images in place, we can now create the installation configuration file named &lt;code&gt;/etc/xen/domain1.cfg&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;kernel = "/home/user/x86_64_domU_images/vmlinuz"&lt;br /&gt;ramdisk = "/home/user/x86_64_domU_images/initrd.img"&lt;br /&gt;name = "domain1"&lt;br /&gt;memory = "256"&lt;br /&gt;disk = [ 'file://var/lib/xen/images/disk.img,xvda,w', ]&lt;br /&gt;vif = [ '' ]&lt;br /&gt;dhcp="dhcp"&lt;br /&gt;netmask="255.255.240.0"&lt;br /&gt;gateway="10.5.144.1"&lt;br /&gt;root="/dev/xvda ro"&lt;br /&gt;vcpus=1&lt;br /&gt;extra="4"&lt;br /&gt;on_reboot = 'destroy'&lt;br /&gt;on_crash = 'destroy'&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Couple of points to note:&lt;/b&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;The netmask and gateway values to be used can be determined by using the &lt;code&gt;route&lt;/code&gt; command on your control domain. If you encounter problems in getting the network to start, you could try using methods suggested &lt;a href="http://whowhywhathow.blogspot.com/2010/07/no-network-on-xen-user-domain.html"&gt;here&lt;/a&gt;. &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;The &lt;code&gt;[ 'file://var/lib/xen/images/disk.img,xvda,w', ]&lt;/code&gt; line here does not work if you use &lt;code&gt;"tap:aio"&lt;/code&gt; instead of &lt;code&gt;"file"&lt;/code&gt;. Also for some reason, if you replace &lt;code&gt;"xvda" &lt;/code&gt;with &lt;code&gt;"xvda1" &lt;/code&gt;or something else, it does not work either. If you do any of those things you will get the following error:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;&lt;br /&gt;Error message:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span"&gt;Error informing the kernel about modifications to partition&lt;br /&gt;/dev/xvda1p1&lt;/span&gt; -- Invalid argument. This means Linux won't know about&lt;br /&gt;any changes you made to /dev/xvda1p1 until you reboot -- so you&lt;br /&gt;shouldn't mount it or use it in any way before rebooting.&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;/ol&gt;Once your config file is ready, you can start creating a domain with:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;sudo xm create -c /etc/xen/domain1.cfg&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;And now, to access your domain, do:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;sudo xm domain1&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;This will open an interactive installation window. Everything is self explanatory in general. If you get an error to the effect that the Ubuntu repository cannot be reached, check your control domain network and &lt;a href="http://whowhywhathow.blogspot.com/2010/07/no-network-on-xen-user-domain.html"&gt;here is the fix&lt;/a&gt;. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Once your domain is properly created it will ask permission to reboot and will automatically get destroyed in the process because of the last two lines in the configuration command line, namely:&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;&lt;code&gt;on_reboot = 'destroy'&lt;br /&gt;on_crash = 'destroy'&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;So now you need to change your configuration file to the following:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;name   ="domain1"&lt;br /&gt;memory ="256"&lt;br /&gt;disk   =[ 'file://var/lib/xen/images/disk.img,xvda,w', ]&lt;br /&gt;vif=[ '' ]&lt;br /&gt;dhcp="dhcp"&lt;br /&gt;netmask="255.255.240.0"&lt;br /&gt;gateway="10.5.144.1"&lt;br /&gt;vcpus=1&lt;br /&gt;on_reboot="restart"&lt;br /&gt;on_crash="restart"&lt;br /&gt;bootloader="/usr/bin/pygrub"&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;And now just use the &lt;code&gt; xm create &lt;/code&gt; command to create your new domain. Finally in order to automatically start and stop your domains when domain-0 starts, move the location of the configuration file to &lt;code&gt; /etc/xen/auto&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;At this point, it is a good idea to create a copy of your virtual machine image. To create new virtual machines using the same image all you have to do is to change the configuration file (name, location of the disk image etc) to point to the copy and start the new machines... waaa la !&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;b&gt;References:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://wiki.centos.org/HowTos/Xen/InstallingCentOSDomU"&gt;Creating and installing CentOS 5 Xen domain instance&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.gossamer-threads.com/lists/xen/users/182859"&gt;Error during guided partitioning&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;</description><link>http://whowhywhathow.blogspot.com/2010/09/starting-new-domains-on-xen-401-from.html</link><author>noreply@blogger.com (Priya Bhat)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5324599319882973732.post-2101180002402813225</guid><pubDate>Mon, 13 Sep 2010 15:26:00 +0000</pubDate><atom:updated>2010-09-29T20:36:56.348+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">40_custom</category><category domain="http://www.blogger.com/atom/ns#">grub2</category><category domain="http://www.blogger.com/atom/ns#">Ubuntu</category><category domain="http://www.blogger.com/atom/ns#">Ubuntu10.04 LTS</category><category domain="http://www.blogger.com/atom/ns#">VGA</category><category domain="http://www.blogger.com/atom/ns#">Xen</category><category domain="http://www.blogger.com/atom/ns#">Xen4.0.1</category><title>How to install Xen4.0 on Ubuntu 10.04 LTS</title><description>This post provides documentation about how to get &lt;a href="http://wiki.xensource.com/xenwiki/Xen4.0"&gt;Xen4.0&lt;/a&gt; (the opensouce version) up and running on an &lt;a href="http://www.ubuntu.com/desktop/get-ubuntu/download"&gt;Ubuntu 10.04 LTS&lt;/a&gt; (Long Term Support) 64-bit machine.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Start of with a fresh new installation of Ubuntu 10.04 LTS. Install the required packages first:&lt;blockquote&gt;&lt;code&gt;apt-get install bcc bin86 gawk bridge-utils iproute libcurl3 libcurl4-openssl-dev bzip2 module-init-tools transfig tgif texinfo texlive-latex-base texlive-latex-recommended texlive-fonts-extra texlive-fonts-recommended pciutils-dev mercurial build-essential make gcc libc6-dev zlib1g-dev python python-dev python-twisted libncurses5-dev patch libvncserver-dev libsdl-dev libjpeg62-dev iasl libbz2-dev e2fslibs-dev git-core uuid-dev ocaml libx11-dev&lt;/code&gt;&lt;/blockquote&gt;On a 64-bit machine, you will also need this additional package:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;apt-get install gcc-multilib&lt;/code&gt;&lt;/blockquote&gt;The next step is to get &lt;a href="http://www.xen.org/products/xen_source.html"&gt; Xen4.0.1&lt;/a&gt; &lt;blockquote&gt;&lt;code&gt;cd /usr/src/&lt;br /&gt;wget http://bits.xensource.com/oss-xen/release/4.0.1/xen-4.0.1.tar.gz&lt;/code&gt;&lt;/blockquote&gt;Un-tar and make:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt; tar xf xen-4.0.1.tar.gz&lt;br /&gt;cd xen-4.0.1&lt;br /&gt;make xen&lt;br /&gt;make tools&lt;br /&gt;make stubdom&lt;/code&gt;&lt;/blockquote&gt;At this point you should have the Xen hypervisor/tools binaries in "dist/" directory ready for installation. Now run:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;make install-xen&lt;br /&gt;make install-tools&lt;br /&gt;make install-stubdom&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;The next step is to download and compile a dom0 kernel, and to update the grub file. We can do this using the following commands:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;make prep-kernels&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;This will create a &lt;code&gt;build-linux-2.6-pvops_x86_64&lt;/code&gt; directory in &lt;code&gt;/usr/src/&lt;/code&gt; which has by a &lt;code&gt;.config&lt;/code&gt; file in it. You need to modify the &lt;code&gt;.config&lt;/code&gt; file to suit your requirements. You can have a look at mine &lt;a href="https://docs.google.com/leaf?id=0B90KFmlUEJybNjQ2MWQ2N2MtMTc1NC00NTA4LTgyMDAtNDVjOTNmMjc2Y2Y2&amp;amp;sort=name&amp;amp;layout=list&amp;amp;num=50"&gt;here&lt;/a&gt;. (Source &lt;a href="http://lists.xensource.com/archives/html/xen-users/2010-09/msg00440.html"&gt;Boris Derzhavets&lt;/a&gt;).&lt;br /&gt;You could use &lt;code&gt;make menuconfig&lt;/code&gt; from inside the &lt;code&gt;build-linux-2.6-pvops_x86_64&lt;/code&gt; to make alterations to your &lt;code&gt;.config&lt;/code&gt; file.&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;cd build-linux-2.6-pvops_x86_64&lt;br /&gt;make menuconfig&lt;br /&gt;make&lt;br /&gt;chmod g-s /usr/src/ -R&lt;br /&gt;make deb-pkg&lt;br /&gt;dpkg -i ../linux-image-2.6.32.21-xen_*.deb&lt;br /&gt;depmod 2.6.32.21-xen&lt;br /&gt;update-initramfs -c -k 2.6.32.21-xen&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;At this point enable Xend at boot:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;update-rc.d xend defaults 20 21&lt;br /&gt;update-rc.d xendomains defaults 21 20&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;When I typed in the last two lines, I got warning messages saying:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;&lt;span class="Apple-style-span"&gt;update-rc.d: warning: xend start runlevel arguments (2 3 4 5) do not match LSB&lt;br /&gt;Default-Start values (3 4 5)&lt;br /&gt;update-rc.d: warning: xend stop runlevel arguments (0 1 6) do not match LSB&lt;br /&gt;Default-Stop values (0 1 2 6)&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;Apparently these messages are benign and should not cause any issues in the working of Xen Daemon. Now create the Grub2 entry for your new kernel:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;vim /etc/grub.d/40_custom&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;Following is what I entered to in the &lt;code&gt;40_custom&lt;/code&gt; file. My installation &lt;a href="http://lists.xensource.com/archives/html/xen-users/2010-09/msg00715.html"&gt;still has issues&lt;/a&gt; because the graphics driver keeps crashing, and I think that the grub file has something to do with it.&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;#!/bin/sh&lt;br /&gt;exec tail -n +3 $0&lt;br /&gt;# This file provides an easy way to add custom menu entries.  Simply type the&lt;br /&gt;# menu entries you want to add after this comment.  Be careful not to change&lt;br /&gt;# the 'exec tail' line above.&lt;br /&gt;&lt;br /&gt;menuentry 'Xen 4.0.1, Ubuntu 10.4 kernel 2.6.32.21' {&lt;br /&gt;      recordfail&lt;br /&gt;      insmod ext2&lt;br /&gt;      set root='(hd0,1)'&lt;br /&gt;      multiboot (hd0,1)/boot/xen-4.0.1.gz dummy=dummy dom0_mem=832M&lt;br /&gt;      module (hd0,1)/boot/vmlinuz-2.6.32.21-xen dummy=dummy root=/dev/sda1 nopat ro nomodeset console=tty0 earlyprintk=xen&lt;br /&gt;      module (hd0,1)/boot/initrd.img-2.6.32.21-xen&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;Update grub and reboot... And choose the correct grub option from the boot-up menu.&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;update-grub&lt;br /&gt;reboot&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;</description><enclosure length="0" type="text/html" url="http://lists.xensource.com/archives/html/xen-users/2010-03/msg00878.html"/><link>http://whowhywhathow.blogspot.com/2010/09/how-to-install-xen40-on-ubuntu-1004-lts.html</link><author>noreply@blogger.com (Priya Bhat)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5324599319882973732.post-8458679476335901701</guid><pubDate>Fri, 10 Sep 2010 15:53:00 +0000</pubDate><atom:updated>2010-09-11T00:00:11.617+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">configure</category><category domain="http://www.blogger.com/atom/ns#">dri2proto</category><category domain="http://www.blogger.com/atom/ns#">glproto</category><category domain="http://www.blogger.com/atom/ns#">glxgears</category><category domain="http://www.blogger.com/atom/ns#">libdrm</category><category domain="http://www.blogger.com/atom/ns#">Mesa</category><category domain="http://www.blogger.com/atom/ns#">source</category><category domain="http://www.blogger.com/atom/ns#">Ubuntu</category><category domain="http://www.blogger.com/atom/ns#">xdamage</category><category domain="http://www.blogger.com/atom/ns#">xorg-macros</category><category domain="http://www.blogger.com/atom/ns#">xxf86vm</category><title>Compile glxgears from source on Ubuntu 9.10</title><description>I decided to modify the source code of &lt;code&gt;glxgears&lt;/code&gt; to overcome &lt;a href="http://whowhywhathow.blogspot.com/2010/09/writing-output-of-running-glxgears-to.html"&gt;a peculiar  problem&lt;/a&gt;. This application would not write the FPS information to file (if redirected) unless it is shutdown.&lt;br /&gt;&lt;br /&gt;I checked the source code, &lt;code&gt;glxgears.c&lt;/code&gt; and found the problem was simply that there was no &lt;code&gt;fflush&lt;/code&gt; statement after the output &lt;code&gt;printf&lt;/code&gt;: &lt;blockquote&gt;&lt;code&gt;static void&lt;br /&gt;event_loop(Display *dpy, Window win)&lt;br /&gt;{&lt;br /&gt;&lt;blockquote&gt;....&lt;br /&gt;if (t - t0 &gt;= 5.0) {&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;GLfloat seconds = t - t0;&lt;br /&gt;GLfloat fps = frames / seconds;&lt;br /&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;            printf("%d frames in %3.1f seconds = %6.3f FPS\n",frames, seconds,&lt;br /&gt; fps);                                   &lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;//no flushing!&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;t0 = t;&lt;br /&gt;frames = 0;&lt;br /&gt;&lt;/blockquote&gt;}}}&lt;br /&gt;&lt;/blockquote&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;And so, the solution seemed simple: add the line of code that would force the output buffer to flush (&lt;code&gt;fflush(stdout);&lt;/code&gt;) after &lt;code&gt; printf &lt;/code&gt; and re-compile the source code.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;To be able to compile &lt;code&gt;glxgears.c&lt;/code&gt;, however one needs to install many other libraries and packages. Here are the steps that I followed to get the whole thing working.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;code&gt;glxgears&lt;/code&gt; is part of the Mesa Library. I downloaded th latest source code (&lt;code&gt;&lt;a href="ftp://ftp.freedesktop.org/pub/mesa/7.8.2/MesaLib-7.8.2.tar.gz"&gt;MesaLib-7.8.2.tar.gz&lt;/a&gt;&lt;/code&gt;)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Start by &lt;code&gt; untarring &lt;/code&gt; this file:&lt;blockquote&gt;&lt;code&gt; tar -xvf MesaLib-7.8.2.tar.gz&lt;/code&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;li&gt;Enter the directory &lt;code&gt;Mesa-7.8.2&lt;/code&gt; and type: &lt;span class="Apple-style-span"  style="font-family:monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;./configure --with-driver=xlib&lt;/span&gt;&lt;/span&gt;. The configuration code will now start spitting out the libraries that it needs (and which your machine does not have). Following are the libraries that I needed on my machine:&lt;/li&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt; libdrm: &lt;blockquote&gt;&lt;code&gt;sudo wget http://dri.freedesktop.org/libdrm/libdrm-2.4.21.tar.gz&lt;br /&gt;tar -xvf libdrm-2.4.21.tar.gz&lt;br /&gt;cd libdrm-2.4.21/&lt;br /&gt;./configure&lt;br /&gt;make&lt;br /&gt;make install&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;li&gt;xorg-macros: &lt;blockquote&gt;&lt;code&gt;wget http://mirrors.kernel.org/ubuntu/pool/main/x/xutils-dev/xutils-dev_7.5+4_i386.deb&lt;br /&gt;sudo dpkg -r xutils-dev&lt;br /&gt;sudo dpkg -i xutils-dev_7.5+4_i386.deb&lt;br /&gt;ls /usr/share/pkgconfig/&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;li&gt;dri2proto: &lt;blockquote&gt;&lt;code&gt;wget http://xorg.freedesktop.org/releases/individual/proto/dri2proto-2.3.tar.gz&lt;br /&gt;tar -xvf dri2proto-2.3.tar.gz&lt;br /&gt;cd dri2proto-2.3/&lt;br /&gt;./configure&lt;br /&gt;make&lt;br /&gt;make install&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;li&gt;glproto:&lt;blockquote&gt;&lt;code&gt;wget http://xorg.freedesktop.org/releases/individual/proto/glproto-1.4.12.tar.gz&lt;br /&gt;tar -xvf glproto-1.4.12.tar.gz&lt;br /&gt;cd glproto-1.4.12/&lt;br /&gt;./configure&lt;br /&gt;make&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;li&gt;xxf86vm: &lt;blockquote&gt;&lt;code&gt;sudo apt-get install libxxf86vm-dev&lt;/code&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;li&gt;xdamage: &lt;blockquote&gt;&lt;code&gt;sudo apt-get install libxdamage-dev&lt;/code&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;After all the dependencies are satisfied, &lt;code&gt;./configure --with-driver=xlib&lt;/code&gt; will complete and create the &lt;code&gt;make&lt;/code&gt; file.&lt;/li&gt;&lt;br /&gt;&lt;li&gt; Follow it up with: &lt;code&gt; make&lt;/code&gt;. Once you modify the &lt;code&gt; Mesa-7.8.2/progs/xdemos/glxgears.c&lt;/code&gt; file, call &lt;code&gt; ./configure --with-driver=xlib&lt;/code&gt; and &lt;code&gt;make&lt;/code&gt;. The new &lt;code&gt;glxgears&lt;/code&gt; executable will be created in the same directory as the souce code.&lt;/li&gt;&lt;/ol&gt;&lt;ol&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/ol&gt;&lt;/div&gt;</description><link>http://whowhywhathow.blogspot.com/2010/09/compile-glxgears-from-source-on-ubuntu.html</link><author>noreply@blogger.com (Priya Bhat)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5324599319882973732.post-2089703775595150535</guid><pubDate>Tue, 07 Sep 2010 12:22:00 +0000</pubDate><atom:updated>2010-09-07T17:59:29.552+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">alter</category><category domain="http://www.blogger.com/atom/ns#">behavior</category><category domain="http://www.blogger.com/atom/ns#">Control-C</category><category domain="http://www.blogger.com/atom/ns#">Ctrl-C</category><category domain="http://www.blogger.com/atom/ns#">trap</category><title>Altering the behavior of CTRL-C</title><description>Short piece of code that might come in handy. One can use the "trap" procedure to alter the behavior of Ctrl-C which is often used to interrupt execution. One can use the altered behavior to delete back-ground processes or remove temporary files that might otherwise keep lying around.. So here is the src code which you can add anywhere in your script.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;&lt;br /&gt;&lt;br /&gt;# trap ctrl-c and call ctrl_c()&lt;br /&gt;trap 'ctrl_c' 2&lt;br /&gt;&lt;br /&gt;function ctrl_c() {&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;pkill temp_processes&lt;br /&gt;#run clean up code here ...&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;</description><link>http://whowhywhathow.blogspot.com/2010/09/altering-behavior-of-ctrl-c.html</link><author>noreply@blogger.com (Priya Bhat)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5324599319882973732.post-3573652638016237211</guid><pubDate>Fri, 03 Sep 2010 14:59:00 +0000</pubDate><atom:updated>2010-09-11T00:12:44.780+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">FPS</category><category domain="http://www.blogger.com/atom/ns#">glxgears</category><category domain="http://www.blogger.com/atom/ns#">GUI</category><category domain="http://www.blogger.com/atom/ns#">killall</category><title>Writing the output of running glxgears to file</title><description>&lt;code&gt;glxgears&lt;/code&gt; is a API that people frequently use to test if their graphical user interface works, and though it not a standardized benchmark of how good your GUI is, it does (at least, theoretically) give you some idea of the frames per second that are being rendered on your screen.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When you type the command &lt;code&gt;glxgears&lt;/code&gt; in your terminal you should see an animation of rotating gears in the foreground and in the background, the terminal outputs every 5 or so seconds the frames per second that are being used in the rendering...&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.blogger.com/video.g?token=AD6v5dz15QeI7aywh1vQvl6o449cw6fVa7A3U6Ew04DKjv8Zr982eOgW7HmNVVPzs44luDrMx6IVWTtnwwR7ioEVew' class='b-hbp-video b-uploaded' frameborder='0'&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;So now, my problem was simply to get the output of the terminal, that is the FPS values that are getting printed after roughly 5 seconds into a file.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The most obvious solution, that is:&lt;/div&gt;&lt;blockquote&gt;&lt;code&gt;glxgears &gt;&gt; out.txt&lt;/code&gt;&lt;/blockquote&gt; does not work. Apparently, &lt;code&gt;glxgears&lt;/code&gt; does not flush the values if the output is redirected to file.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I was unable to "solve" the problem (that would require changing the source code of &lt;code&gt;glxgears&lt;/code&gt; to make it not only print the output values but also flush it). For now I got something to work which is alright for me. I manually kill the &lt;code&gt; glxgears&lt;/code&gt; every 5 seconds, store the output, and then restart another &lt;code&gt;glxgears&lt;/code&gt; process.&lt;br /&gt;&lt;br /&gt;This is &lt;a href="http://www.mombu.com/gnu_linux/mandriva/t-send-glxgears-output-to-file-2945738.html"&gt;not so trivial actually&lt;/a&gt;. If you kill the &lt;code&gt;glxgears&lt;/code&gt; using something like &lt;blockquote&gt;&lt;code&gt;killall glxgears&lt;/code&gt;&lt;/blockquote&gt; no FPS values are returned or written to file. Instead you need to shutdown  &lt;code&gt;glxgears&lt;/code&gt; by telling x-server to withdraw its window resource!&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</description><enclosure length="0" type="video/mp4" url="http://www.blogger.com/video-play.mp4?contentId=274914d45416b4a5&amp;type=video%2Fmp4"/><enclosure length="0" type="video/mp4" url="http://www.blogger.com/video-play.mp4?contentId=3fb1b8d4cbea987b&amp;type=video%2Fmp4"/><enclosure length="0" type="video/mp4" url="http://www.blogger.com/video-play.mp4?contentId=c9690a8b905075c1&amp;type=video%2Fmp4"/><link>http://whowhywhathow.blogspot.com/2010/09/writing-output-of-running-glxgears-to.html</link><author>noreply@blogger.com (Priya Bhat)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5324599319882973732.post-1913544054652631445</guid><pubDate>Thu, 02 Sep 2010 23:05:00 +0000</pubDate><atom:updated>2010-09-11T00:11:42.870+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">glxgears</category><category domain="http://www.blogger.com/atom/ns#">GUI</category><category domain="http://www.blogger.com/atom/ns#">static IP</category><category domain="http://www.blogger.com/atom/ns#">TightVNC</category><category domain="http://www.blogger.com/atom/ns#">Xen</category><category domain="http://www.blogger.com/atom/ns#">Xen3.2</category><category domain="http://www.blogger.com/atom/ns#">xtem Xvfb</category><title>Obtaining GUI access to Xen Domains Using TightVNC</title><description>This is a step by step tutorial on how to install a Xen Domain on Xen 3.2 (kernel version 2.6.24-24-xen) and how to get graphical user interface working on it. &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I am using a rather ancient version of the Xen kernel because I am short of time at the moment and this is something I have worked with before. But hopefully, I should be able to get the same thing done on a more recent Xen kernel soon.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So to install a new domain from the command line, do:&lt;/div&gt;&lt;blockquote&gt;&lt;code&gt;sudo xen-create-image --hostname=xen_7 --size=1Gb --swap=256Mb --ide --ip=10.5.155.7 --netmask=255.255.240.0 --gateway=10.5.159.255 --force --dir=/home/xen --memory=256Mb --arch=i386 --kernel=/boot/vmlinuz-2.6.24-16-xen --initrd=/boot/initrd.img-2.6.24-16-xen --install-method=debootstrap --dist=hardy --mirror=http://archive.ubuntu.com/ubuntu/&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;Most of the parameters are self-explanatory. I am using static IP address (&lt;code&gt;10.5.155.7&lt;/code&gt;) on my VM. The kernel (&lt;code&gt;vmlinuz-2.6.24-16-xen&lt;/code&gt;) and the initial ram disk (&lt;code&gt;initrd.img-2.6.24-16-xen&lt;/code&gt;) should be present in your &lt;code&gt;boot&lt;/code&gt; directory. Ususally the &lt;code&gt;gateway&lt;/code&gt; parameter and the &lt;code&gt;netmask&lt;/code&gt; parameter would be the same for your Domain-0 and user domains. To see how much memory is available for the new domain that you are creating use the &lt;code&gt;df&lt;/code&gt; or &lt;code&gt;free&lt;/code&gt; commands before hand.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Once the new domain has been created you will see a new configuration file in the &lt;code&gt; /etc/xen/&lt;/code&gt; directory. This file needs to be edited a little bit as follows:&lt;/div&gt;&lt;blockquote&gt;&lt;code&gt;# Configuration file for the Xen instance xen_7, created&lt;br /&gt;# by xen-tools 3.8 on Thu Sep  2 19:12:55 2010.&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;#  Kernel + memory size&lt;br /&gt;#&lt;br /&gt;kernel      = '/boot/vmlinuz-2.6.24-16-xen'&lt;br /&gt;ramdisk     = '/boot/initrd.img-2.6.24-16-xen'&lt;br /&gt;memory      = '256'&lt;br /&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;vcpu     = '2'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;#  Disk device(s).&lt;br /&gt;#&lt;br /&gt;root        = '/dev/hda2 ro'&lt;br /&gt;disk        = [&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;        '&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;tap:aio&lt;/span&gt;:/home/xen/domains/xen_7/swap.img,hda1,w',&lt;br /&gt;        '&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;tap:aio&lt;/span&gt;:/home/xen/domains/xen_7/disk.img,hda2,w',&lt;br /&gt;&lt;/blockquote&gt;            &lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;The text in red shows the text that has been changed/added. The &lt;code&gt;vcpu&lt;/code&gt; parameter can be used if your want your domain to have more than one virtual processor. Later when your machine has booted you can check that this is indeed the case from the &lt;code&gt;/proc/cpuinfo&lt;/code&gt; file.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;So now we are all set to boot up our machine. In the Domain-0 terminal, type:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt; sudo xm create /etc/xen/xen_7.cfg&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;You could monitor the booting up and working of your new domain from Domain-0 using &lt;code&gt;xentop&lt;/code&gt; and&lt;blockquote&gt;&lt;code&gt; sudo xm list&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt; To access your machine, use:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt; sudo xm console xen_7&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt; Login as &lt;code&gt;root&lt;/code&gt; and set your new password using &lt;code&gt;passwd&lt;/code&gt; command. If the network on your new domain is not functioning for some reason, look at &lt;a href="http://whowhywhathow.blogspot.com/2010/07/no-network-on-xen-user-domain.html"&gt;this post&lt;/a&gt; for possible ways to correct the problem.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So at this point you have a functioning domain that you can access via the terminal. But now we want to get GUI access using tightVNC. To do this, a truck load of software needs to be installed. I have used the &lt;code&gt;&lt;a href="http://ubuntuforums.org/showthread.php?t=261366"&gt;dpkg --get-selections&lt;/a&gt;&lt;/code&gt;&lt;a href="http://ubuntuforums.org/showthread.php?t=261366"&gt; option&lt;/a&gt; to generate &lt;a href="https://docs.google.com/leaf?id=0B90KFmlUEJybZTExOTMzNWEtYzAwMi00MTJjLWE3NGUtZWRmNzg3M2U5NTBl&amp;amp;sort=name&amp;amp;layout=list&amp;amp;num=50"&gt;a list of all the software that I needed on my machine&lt;/a&gt;. Use the &lt;code&gt; dpkg --set-selection&lt;/code&gt; command followed by &lt;code&gt;dselect&lt;/code&gt; (Select the "install" option on the interface opened by &lt;code&gt;dselect&lt;/code&gt;) to install all the packages in the list.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now the client/remote machine from which you want to access the graphical user interface of your domains needs to have VNCviewer (&lt;code&gt; sudo apt-get install vncviewer&lt;/code&gt;) installed. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On the host (guest domain) terminal, do:&lt;/div&gt;&lt;blockquote&gt;&lt;code&gt;Xvfb :0 -screen 0 800x600x16 &amp;amp;&lt;br /&gt;export DISPLAY=:0&lt;br /&gt;x11vnc -display :0&amp;amp;&lt;br /&gt;xterm&amp;amp;&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;You can check that the &lt;code&gt; Xvfb &lt;/code&gt; and &lt;code&gt; xterm&lt;/code&gt; processes have started from the list of running processes. (&lt;code&gt;ps uax) &lt;/code&gt;&lt;br /&gt;&lt;br /&gt;On the client machine, do &lt;code&gt; vncviewer 10.5.155.6:0 &lt;/code&gt;. You should see the GUI interface at this point. To test that the graphics are working, try: &lt;blockquote&gt;&lt;code&gt;glxgears&lt;/code&gt;&lt;/blockquote&gt;Well, that's it! You should see an animation of a  bunch of gears rotating on your screen.... Which means that you have a GUI access to your machine!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</description><link>http://whowhywhathow.blogspot.com/2010/09/obtaining-gui-access-to-xen-domains.html</link><author>noreply@blogger.com (Priya Bhat)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5324599319882973732.post-9079186592537994895</guid><pubDate>Wed, 01 Sep 2010 13:39:00 +0000</pubDate><atom:updated>2010-09-01T20:54:24.968+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">File</category><category domain="http://www.blogger.com/atom/ns#">rc</category><category domain="http://www.blogger.com/atom/ns#">socket</category><category domain="http://www.blogger.com/atom/ns#">Statistics</category><category domain="http://www.blogger.com/atom/ns#">stream</category><category domain="http://www.blogger.com/atom/ns#">unix</category><category domain="http://www.blogger.com/atom/ns#">VLC</category><title>Issuing commands to VLC and collecting output to file</title><description>So, I wanted to play a video using VLC Media Player and collect statistics like lost frames and bit rate into a file every x seconds while the video is running. Seems pretty straight forward considering that the stats can be viewed from the VLC GUI. So it should be a straight forward matter to get them into a file, right? Wrong !!&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I tried several approaches including using the &lt;code&gt; rc &lt;/code&gt; interface. Pierre gave me a piece of code that solves the problem on his machine:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;while true; do echo stats; sleep 2; done | vlc -I rc filename &gt; out.txt&lt;/code&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Here, the &lt;code&gt;filename&lt;/code&gt; is the name of the file that needs to be played and the number following &lt;code&gt;sleep &lt;/code&gt; is the time between two reads of the statistics. As you can see, all this piece of code does is to issue (using pipe &lt;code&gt;|&lt;/code&gt;) &lt;code&gt;stats&lt;/code&gt; command to the &lt;code&gt;rc interface&lt;/code&gt; (denoted by the &lt;code&gt; -I &lt;/code&gt; option) every &lt;code&gt;2&lt;/code&gt; seconds and store the output into &lt;code&gt;out.txt&lt;/code&gt; file. For some reason the same code did not work on my machine and I kept getting the error message:&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;code&gt;&lt;div&gt;user@machine:~$ while true; do echo stats; sleep 2; done | vlc -I rc 350animation2.mpg &gt; out.txt&lt;/div&gt;&lt;div&gt;VLC media player 1.0.2 Goldeneye&lt;/div&gt;&lt;div&gt;[0x8731750] main interface error: &lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;no suitable interface module&lt;/span&gt;&lt;/div&gt;&lt;div&gt;[0x8685140] main libvlc error: &lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;interface "default" initialization failed&lt;/span&gt;&lt;/div&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt; I am using VLC media player &lt;code&gt;1.0.2&lt;/code&gt; and my OS is &lt;code&gt;Ubuntu Karmic Koala.&lt;/code&gt;If anyone has a clue as to what could be causing the problem, please send me a comment. Between, I was able to redirect the output stats to a file using the &lt;code&gt; rc &lt;/code&gt; interface. For that I started VLC using &lt;code&gt; vlc --intf rc filename &gt;output.txt&lt;/code&gt; and then in the interface that opens, I issued the &lt;code&gt;stats&lt;/code&gt; command. What I could not do was to automate the process of issuing the &lt;code&gt;stats&lt;/code&gt; command every &lt;code&gt;x&lt;/code&gt; seconds.&lt;/div&gt;&lt;br /&gt;While trying to resolve the issue, I stumbled upon this &lt;a href="http://n0tablog.wordpress.com/2009/02/09/controlling-vlc-via-rc-remote-control-interface-using-a-unix-domain-socket-and-no-programming/"&gt;"Not a blog"&lt;/a&gt; where the author shows how to issue commands to VLC from the command line using &lt;a href="http://en.wikipedia.org/wiki/Netcat"&gt;netcat&lt;/a&gt; and UNIX sockets. I tried to extrapolate from the code and tweak it to channel the collection of stats but it did not work. My super naive attempts basically were along the lines of writing a &lt;code&gt; bash&lt;/code&gt; script that starts the video and then runs in an infinite loop trying to collect stats and sleep, as shown below:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;echo play 350animation2.mpg&lt;br /&gt;while true&lt;br /&gt;do&lt;blockquote&gt;echo stats&lt;br /&gt; sleep 2&lt;/blockquote&gt;done&lt;/code&gt;&lt;/blockquote&gt;Then I would redirect the input and output to the VLC interface. But the same error message persisted. &lt;a href="http://www.davidwolinsky.com/"&gt;David Wolinsky&lt;/a&gt; came to the rescue. Here is the script that he come up with:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;#!/bin/bash&lt;br /&gt;&lt;br /&gt;set +o nounset&lt;br /&gt;LC_ALL=C ; LANG=C ; export LC_ALL LANG&lt;br /&gt;version &gt;/dev/null 2&gt;&amp;amp;1 &amp;amp;&amp;amp; version "=o" $(_eat $0 $1)&lt;br /&gt;set -o nounset&lt;br /&gt;&lt;br /&gt;set -m&lt;br /&gt;&lt;br /&gt;run() {&lt;br /&gt;pid=$1&lt;br /&gt;sleep 4&lt;br /&gt;while true; do&lt;br /&gt;&lt;blockquote&gt;        echo -n "stats" | nc -U vlc.sock&lt;br /&gt;    if [[ ! $(ps uax | grep -v grep | grep $pid) ]]; then&lt;br /&gt;            return&lt;br /&gt;    fi&lt;br /&gt;    sleep 2&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;done&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;vlc -I rc --rc-unix vlc.sock 350animation2.mpg &amp;amp;&gt; out &amp;amp;&lt;br /&gt;pid=$!&lt;br /&gt;run $pid &amp;amp;&lt;br /&gt;fg %1&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;As you can see, this code uses the UNIX socket approach as well. After the VLC process is started, the &lt;code&gt;PID&lt;/code&gt; is stored and used to start the &lt;code&gt;run&lt;/code&gt; script on the top. The output gets stored in the &lt;code&gt;out&lt;/code&gt; file. The &lt;code&gt;fg&lt;/code&gt; (fore ground) command in the end is apparently necessary.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Thanks to Pierre, David and Andrabr for help with this problem!&lt;/div&gt;</description><enclosure length="0" type="text/html" url="http://mailman.videolan.org/pipermail/vlc/2010-August/019392.html"/><link>http://whowhywhathow.blogspot.com/2010/09/vlc-help.html</link><author>noreply@blogger.com (Priya Bhat)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5324599319882973732.post-6495167975654963667</guid><pubDate>Thu, 22 Jul 2010 17:43:00 +0000</pubDate><atom:updated>2010-07-23T03:34:29.329+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Ubuntu</category><category domain="http://www.blogger.com/atom/ns#">virt-manager</category><category domain="http://www.blogger.com/atom/ns#">virtual manager</category><category domain="http://www.blogger.com/atom/ns#">Xen</category><category domain="http://www.blogger.com/atom/ns#">Xen3.2</category><title>How to get Virtual Manager to work for a Xen host</title><description>So, continuing with the theme of Xen, &lt;a href="http://virt-manager.et.redhat.com/index.html"&gt;Virtual Machine Manager or virt-manager&lt;/a&gt; for short, is a piece of software that I decided to check out because I wanted graphical access to my virtual machines. A more formal description as given on their website is:&lt;br /&gt;&lt;blockquote&gt;"&lt;i&gt;Virt-manager is a desktop user interface for managing virtual machines. It presents a summary view of running domains, their live performance &amp;amp; resource utilization statistics. The detailed view graphs performance &amp;amp; utilization over time. Wizards enable the creation of new domains, and configuration &amp;amp; adjustment of a domain's resource allocation &amp;amp; virtual hardware. An embedded VNC client viewer presents a full graphical console to the guest domain&lt;/i&gt;"&lt;/blockquote&gt;You need to download virt-manager on the machine from which you wish to access your virtual machines. I am using a machine running &lt;code&gt;Ubuntu 10.04&lt;/code&gt; which I will call the &lt;b&gt;&lt;i&gt;client&lt;/i&gt;&lt;/b&gt; machine in the description below.&lt;br /&gt;&lt;br /&gt;My Virtual Machines (VMs) were created on top of &lt;code&gt;Xen 3.2&lt;/code&gt; hypervisor, Earlier I had some issues getting the network up and running on my VMs, the resolution of which I have described in an &lt;a href="http://whowhywhathow.blogspot.com/2010/07/no-network-on-xen-user-domain.html"&gt;earlier post&lt;/a&gt;. My hypervisor machine which I will call my &lt;b&gt;&lt;i&gt;host&lt;/i&gt;&lt;/b&gt; machine is running kernel &lt;code&gt;2.6.24-24-xen&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;So here is the procedure that I followed to get virt-manager to work:&lt;br /&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;I used the &lt;code&gt;Synaptic Package Manager (System-&gt;Administration-&gt;Synaptic Package Manager&lt;/code&gt; to download &lt;code&gt;virt-manager&lt;/code&gt; and all the dependencies on my client machine. Alternatively, one could also do &lt;code&gt;sudo apt-get install virt-manager&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;On my host machine, I downloaded and installed &lt;code&gt;libvirt-bin &lt;/code&gt; and &lt;code&gt;ssh-askpass &lt;/code&gt;&lt;blockquote&gt;&lt;code&gt;&lt;div&gt;sudo apt-get install libvirt-bin&lt;/div&gt;&lt;div&gt;sudo apt-get install ssh-askpass&lt;/div&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Now to access the virt-manager console from my client machine I used &lt;code&gt;Application-&gt;System Tools-&gt;Virtual Machine Manager&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;On my host machine, I started the &lt;code&gt;libvirtd daemon&lt;/code&gt;:&lt;div&gt;&lt;blockquote&gt;&lt;code&gt; sudo libvirtd start&lt;/code&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt; At this point I tried to connect to my host machine using &lt;code&gt;File-&gt;Add Connection...&lt;/code&gt;; I chose my specific hypervisor (&lt;code&gt;Xen&lt;/code&gt;) and Connection as &lt;code&gt;Remote Tunnel over SSH&lt;/code&gt; (I am not sure that this is the one that I was supposed to use, but it did work, eventually!)&lt;br /&gt;&lt;div&gt;At this point, I got the following error on a pop-up on my client machine and on the console of my host machine:&lt;blockquote&gt;&lt;code&gt;libvir: Xen Daemon error :internal error failed to connect to xend&lt;/code&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;After some effort, the following fix worked:&lt;blockquote&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Open the &lt;code&gt;xend configuration file&lt;/code&gt;&lt;blockquote&gt;&lt;code&gt;sudo vim /etc/xen/xend-config.sxp&lt;/code&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://whowhywhathow.blogspot.com/2010/07/no-network-on-xen-user-domain.html"&gt;In my previous post&lt;/a&gt; I had talked about adding a temporary bridge between physical network device and the virtual TAP device. I had to let the &lt;code&gt;xend&lt;/code&gt; daemon become aware of this. So under the line:&lt;blockquote&gt;&lt;code&gt;(network-script network-bridge)&lt;/code&gt;&lt;/blockquote&gt; I added:&lt;blockquote&gt;&lt;code&gt;(network-script 'network-bridge netdev=tmpbridge')&lt;/code&gt;&lt;/blockquote&gt;(To recall what my network device is called, I did a &lt;code&gt;ifconfig&lt;/code&gt;. It was the one whose description contains the domain-0's IP. &lt;/li&gt;&lt;br /&gt;&lt;li&gt;I was not done with this file yet. I needed to add the following line somewhere in the file:&lt;blockquote&gt;&lt;code&gt;(xend-unix-server yes)&lt;/code&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;I saved and closed the file. Restarted the host machine's network (&lt;code&gt;sudo /etc/init.d/networking restart&lt;/code&gt;), restarted the &lt;code&gt;xend&lt;/code&gt; daemon (&lt;code&gt;sudo xend restart&lt;/code&gt;), and finally restarted the &lt;code&gt;libvirtd&lt;/code&gt; daemon(&lt;code&gt; sudo libvirtd start&lt;/code&gt;)&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/blockquote&gt;&lt;br /&gt;Now when I tried to add the connection using the setting mentioned above, it went through, asked me for a password and I would see a table giving the details of the CPU utilization and some other statistics of my VMs. Following is a screen shot of what I can see so far:&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhX_RoyqBfGCcAu0rrvTfcQm4cdAOCAnvkLapwrr_oYn4E1QvlB7_d5PUtZB_QaoL-WFmjE7wVJpu5uW1LRk725b_fGZUdcOcx9Ky8U4fV1U-7tDzgk8Lf6epapqj9Chz0YtZXiCc3uza4/s1600/ScreenShot_virtManager.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 250px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhX_RoyqBfGCcAu0rrvTfcQm4cdAOCAnvkLapwrr_oYn4E1QvlB7_d5PUtZB_QaoL-WFmjE7wVJpu5uW1LRk725b_fGZUdcOcx9Ky8U4fV1U-7tDzgk8Lf6epapqj9Chz0YtZXiCc3uza4/s400/ScreenShot_virtManager.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5496849151517372226" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;/div&gt;</description><link>http://whowhywhathow.blogspot.com/2010/07/how-to-get-virtual-manager-to-work-for.html</link><author>noreply@blogger.com (Priya Bhat)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhX_RoyqBfGCcAu0rrvTfcQm4cdAOCAnvkLapwrr_oYn4E1QvlB7_d5PUtZB_QaoL-WFmjE7wVJpu5uW1LRk725b_fGZUdcOcx9Ky8U4fV1U-7tDzgk8Lf6epapqj9Chz0YtZXiCc3uza4/s72-c/ScreenShot_virtManager.jpg" width="72"/></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5324599319882973732.post-6836362319545820434</guid><pubDate>Thu, 22 Jul 2010 14:11:00 +0000</pubDate><atom:updated>2010-07-22T23:00:47.039+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">brctl. dhclient</category><category domain="http://www.blogger.com/atom/ns#">domain</category><category domain="http://www.blogger.com/atom/ns#">network</category><category domain="http://www.blogger.com/atom/ns#">Xen</category><title>No network on Xen user domain</title><description>Today I installed &lt;code&gt;Xen 3.2&lt;/code&gt; for my work and created a guest VM using the &lt;a href="http://www.howtoforge.com/ubuntu-8.04-server-install-xen-from-ubuntu-repositories-p2"&gt;this&lt;/a&gt; link as a guide. However I found that the network on my VM didn't work. The problem as  &lt;a href="http://ptony82.wordpress.com/"&gt;Pierre&lt;/a&gt; explained was that the link between my physical network device and the virtual TAP device was not set up.&lt;br /&gt;&lt;br /&gt;This was in spite of the fact that I re-started the &lt;code&gt;xend&lt;/code&gt; daemon on my machine and used the static IP address method that was recommended in the blog mentioned above.So it seems that the &lt;code&gt;xm create &lt;/code&gt; and &lt;code&gt;xend&lt;/code&gt; scripts are not doing what they are supposed to do!&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blog.davidwolinsky.com/"&gt;David Wolinsky&lt;/a&gt; came up with the following fix:&lt;br /&gt;On the console of your control domain, do the following:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;$ brctl addif tmpbridge eth0&lt;br /&gt;$ ifup tmpbridge&lt;br /&gt;$ ifconfig eth0 0.0.0.0 promisc&lt;br /&gt;$ brctl show&lt;br /&gt;$ dhclient tmpbridge&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;Now when you do an &lt;code&gt;ifconfig&lt;/code&gt; on you domain-0, the &lt;code&gt;tmpbridge&lt;/code&gt; interface should show up with the IP that was originally assigned to &lt;code&gt;eth0&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;And since &lt;code&gt;eth0&lt;/code&gt; is set to "promiscuous" mode, it will accept all network packages coming to it.&lt;br /&gt;&lt;br /&gt;Now using the &lt;code&gt;route&lt;/code&gt; command find the &lt;code&gt; default gateway&lt;/code&gt; used by your domain-0. The following terminal snapshot is provided to clarify which IP I am talking about:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;&lt;br /&gt;user@Domain0:~$ route&lt;br /&gt;Kernel IP routing table&lt;br /&gt;Destination     Gateway         Genmask         Flags Metric Ref    Use Iface&lt;br /&gt;10.5.144.0      *               255.255.240.0   U     0      0        0 tmpbridge&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;default         10.5.144.1&lt;/span&gt;      0.0.0.0         UG    0      0        0 tmpbridge&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;In the last line, the &lt;code&gt;default gateway&lt;/code&gt; is highlighted in red. Make a note of this IP.&lt;br /&gt;Now open the console of your user domain and check the &lt;code&gt;route&lt;/code&gt;:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;&lt;br /&gt;root@UserDomain:~# route&lt;br /&gt;Kernel IP routing table&lt;br /&gt;Destination     Gateway         Genmask         Flags Metric Ref    Use Iface&lt;br /&gt;10.5.144.0      *               255.255.240.0   U     0      0        0 eth0&lt;br /&gt;&lt;/blockquote&gt;&lt;/code&gt;&lt;br /&gt;As you can see, in my case the &lt;code&gt;default gateway&lt;/code&gt; was not set. To do so use the &lt;code&gt; route add default gw &lt;/code&gt; command and the IP we obtained from the &lt;code&gt;default gateway&lt;/code&gt; of domain-0.&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;&lt;br /&gt;root@UserDomain:~# route add default gw 10.5.144.1&lt;br /&gt;&lt;/blockquote&gt;&lt;/code&gt;&lt;br /&gt;Verify using &lt;code&gt;route&lt;/code&gt;, and then try pinning something:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;&lt;br /&gt;root@UserDomain:~# route &lt;br /&gt;Kernel IP routing table&lt;br /&gt;Destination     Gateway         Genmask         Flags Metric Ref    Use Iface&lt;br /&gt;10.5.144.0      *               255.255.240.0   U     0      0        0 eth0&lt;br /&gt;default         10.5.144.1      0.0.0.0         UG    0      0        0 eth0&lt;br /&gt;root@UserDomain:~# ping google.com&lt;br /&gt;PING google.com (72.14.253.104) 56(84) bytes of data.&lt;br /&gt;64 bytes from mia04s03-in-f104.1e100.net (72.14.253.104): icmp_seq=1 ttl=56 time=15.5 ms&lt;br /&gt;64 bytes from mia04s03-in-f104.1e100.net (72.14.253.104): icmp_seq=2 ttl=56 time=14.0 ms&lt;br /&gt;64 bytes from mia04s03-in-f104.1e100.net (72.14.253.104): icmp_seq=3 ttl=56 time=13.9 ms&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Dadaaa! Many thanks to Pierre and David!&lt;br /&gt;As a side note, if you are adding more domains, you do not need to repeat all the commands on domain-0, as its interface is already in the "promiscuous" mode. Only run the &lt;code&gt;dhclient&lt;/code&gt;  again. You will however need to set up the &lt;code&gt;default gateway&lt;/code&gt; in every new domain that you create.</description><link>http://whowhywhathow.blogspot.com/2010/07/no-network-on-xen-user-domain.html</link><author>noreply@blogger.com (Priya Bhat)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5324599319882973732.post-3569153818609237457</guid><pubDate>Tue, 25 May 2010 14:57:00 +0000</pubDate><atom:updated>2010-05-25T20:57:45.452+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">disable</category><category domain="http://www.blogger.com/atom/ns#">Karmic Koala</category><category domain="http://www.blogger.com/atom/ns#">password</category><category domain="http://www.blogger.com/atom/ns#">sudo</category><category domain="http://www.blogger.com/atom/ns#">Ubuntu</category><title>Disable Sudo password prompts on Ubuntu</title><description>&lt;div&gt;A simple trick to disable the &lt;code&gt;sudo&lt;/code&gt; password prompts on &lt;code&gt;Ubuntu&lt;/code&gt; (I have tested this on &lt;code&gt;Ubuntu 9.10 Karmic Koala&lt;/code&gt;). A word of caution, be aware that by doing this you are sacrificing the security that &lt;code&gt;sudo&lt;/code&gt; provides. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You basically need to edit the &lt;code&gt;/etc/sudoers&lt;/code&gt; file. This file cannot be changed by any user. You need to sign in as &lt;code&gt;root&lt;/code&gt; and then use the &lt;code&gt;visudo&lt;/code&gt; command to start editing the file.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;code&gt;&lt;div&gt;user@machine:~$ sudo su&lt;/div&gt;&lt;div&gt;[sudo] password for user: &lt;/div&gt;&lt;div&gt;root@machine:/home/user# visudo&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/code&gt;&lt;div&gt;In this file, right at the bottom you will find a line: &lt;/div&gt;&lt;code&gt;&lt;div&gt;%admin ALL=(ALL) ALL&lt;/div&gt;&lt;/code&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Replace it with:&lt;/div&gt;&lt;code&gt;&lt;div&gt;%admin ALL=NOPASSWD: ALL&lt;/div&gt;&lt;/code&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This will disable the requirement to enter the password every time you run a &lt;code&gt;sudo&lt;/code&gt; command. Save and close (&lt;code&gt;ESC, :wq, ENTER&lt;/code&gt;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So you can now run a command like &lt;code&gt;sudo reboot&lt;/code&gt; without having to enter the password:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;div&gt;user@machine:~$ sudo reboot&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Broadcast message from user@machine&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;(/dev/pts/0) at 11:17 ...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The system is going down for reboot NOW!&lt;/div&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Again, be careful and know what you are doing. Also, it might be a good idea to make a copy of your &lt;code&gt;/etc/sudoers&lt;/code&gt; file before your make any changes to it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;One way to use this trick could be in a scenario where you want to run a &lt;code&gt;sudo&lt;/code&gt; command through a script and do not want to use the &lt;code&gt;-S&lt;/code&gt; option of &lt;code&gt;sudo&lt;/code&gt; (&lt;code&gt;-S&lt;/code&gt; option allows you to provide the password from the script itself; this can be dangerous if someone gets access to your script)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://whowhywhathow.blogspot.com/2010/05/disable-sudo-password-prompts-on-ubuntu.html</link><author>noreply@blogger.com (Priya Bhat)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5324599319882973732.post-5714309975549621655</guid><pubDate>Thu, 20 May 2010 15:17:00 +0000</pubDate><atom:updated>2010-06-15T22:05:16.301+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">arguments</category><category domain="http://www.blogger.com/atom/ns#">bash</category><category domain="http://www.blogger.com/atom/ns#">floating point</category><category domain="http://www.blogger.com/atom/ns#">if</category><category domain="http://www.blogger.com/atom/ns#">kill</category><category domain="http://www.blogger.com/atom/ns#">process ID</category><category domain="http://www.blogger.com/atom/ns#">string</category><title>Bash chit-sheet</title><description>Some simple tricks that can make bash scripting a breeze:&lt;div&gt;&lt;ol&gt;&lt;li&gt;To &lt;b&gt;truncate&lt;/b&gt; a float to int: &lt;blockquote&gt;&lt;code&gt;INT=${FLOAT/\.*}&lt;/code&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;To &lt;b&gt;split a string&lt;/b&gt; (of 2 words) into its components: &lt;blockquote&gt;&lt;code&gt;FIRST_WORD=${STRING%% *}&lt;/code&gt;,&lt;code&gt;SECOND_WORD=${STRING#* }&lt;/code&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;To do simple &lt;b&gt;floating point arithmetic&lt;/b&gt;, use &lt;code&gt;bc&lt;/code&gt;: &lt;blockquote&gt;&lt;code&gt;AVERAGE=$(echo "scale=2; ($FLOAT1 + $FLOAT2 ) / 2" | bc )&lt;/code&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Conditional&lt;/b&gt; &lt;code&gt;if&lt;/code&gt; statement: &lt;blockquote&gt;&lt;code&gt;if [[ $INT1 -gt $INT2 ]]; then echo greater; fi&lt;/code&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;To check the &lt;b&gt;number of arguments&lt;/b&gt; for a bash script and to issue an error message if the number of arguments if insufficient, use the following code snippet at the top of the script: &lt;blockquote&gt;&lt;code&gt;&lt;div&gt; EXPECTED_ARGS=2&lt;/div&gt;&lt;div&gt;E_BADARGS=65&lt;/div&gt; &lt;div&gt;if [ $# -ne $EXPECTED_ARGS ]; then&lt;/div&gt;&lt;blockquote&gt;&lt;code&gt;&lt;div&gt;        echo "Usage: ./script_name arg1 arg2"&lt;/div&gt;&lt;div&gt;        echo "  Example: ./sum 1 2"&lt;/div&gt;&lt;div&gt;        exit $E_BADARGS&lt;/div&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;div&gt;fi&lt;/div&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;To &lt;b&gt;find the process ID&lt;/b&gt; of a running process, use &lt;code&gt;pgrep&lt;/code&gt;:&lt;blockquote&gt;&lt;code&gt;&lt;div&gt; pgrep -fl PROCESS_NAME&lt;/div&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;To &lt;b&gt;kill a process&lt;/b&gt; using the process name instead of the process ID, use:&lt;blockquote&gt;&lt;code&gt;&lt;div&gt;kill $(ps -ef |grep PROCESS_NAME | grep -v grep | awk '{print $2}')&lt;/div&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Find files that contain a text string&lt;/b&gt;:&lt;blockquote&gt;&lt;code&gt;&lt;div&gt;grep -lir "text to find" *&lt;/div&gt;&lt;/code&gt;&lt;/blockquote&gt; The  &lt;code&gt;-l&lt;/code&gt; switch outputs only the names of files in which the text occurs (instead of each line containing the text), the &lt;code&gt;-i&lt;/code&gt; switch ignores the case, and the &lt;code&gt;-r&lt;/code&gt; descends into subdirectories.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;/ol&gt;&lt;/div&gt;</description><link>http://whowhywhathow.blogspot.com/2010/05/bash-chit-sheet.html</link><author>noreply@blogger.com (Priya Bhat)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5324599319882973732.post-5139173312980758568</guid><pubDate>Wed, 19 May 2010 13:44:00 +0000</pubDate><atom:updated>2010-05-19T19:37:24.189+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">clock</category><category domain="http://www.blogger.com/atom/ns#">clocksource</category><category domain="http://www.blogger.com/atom/ns#">NTP</category><category domain="http://www.blogger.com/atom/ns#">source</category><title>Clock source and NTP control</title><description>&lt;div&gt;To view the available clocksource options for your machine, look into the &lt;code&gt;/sys/devices/system/clocksource/clocksource0&lt;/code&gt; directory. This directory also shows the current clock source that your machine is using. You will need &lt;code&gt;sudo&lt;/code&gt; privileges to access this information:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;code&gt;&lt;div&gt;user@machine:/sys/devices/system/clocksource/clocksource0$ sudo more available_clocksource&lt;/div&gt;&lt;div&gt;tsc hpet acpi_pm pit jiffies&lt;/div&gt;&lt;div&gt;user@machine:/sys/devices/system/clocksource/clocksource0$ sudo more current_clocksource&lt;/div&gt;&lt;div&gt;hpet&lt;/div&gt;&lt;/code&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Usually, your machine will pick the "best" clock source from the available options at start up, but if you want to force the selection of a particular clock source, you can do this by including the desired option in the configuration file that the system uses at the time of start-up, namely &lt;code&gt;/boot/grub/menu.lst&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;code&gt;&lt;div&gt;user@machine:/boot/grub$ sudo vim menu.lst&lt;/div&gt;&lt;/code&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Add the clock source option at the end of the line declaring the kernel path, as shown below:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;code&gt;&lt;div&gt;title           Ubuntu 8.04.3 LTS, kernel 2.6.24-26-generic&lt;/div&gt;&lt;div&gt;root            (hd0,0)&lt;/div&gt;&lt;div&gt;kernel          /boot/vmlinuz-2.6.24-26-generic root=UUID=cea24a64-f038-469c-b716-226ab0da2f93 ro quiet splash &lt;b&gt;clocksource=tsc&lt;/b&gt;&lt;/div&gt;&lt;div&gt;initrd          /boot/initrd.img-2.6.24-26-generic&lt;/div&gt;&lt;div&gt;quiet&lt;/div&gt;&lt;/code&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Save and restart your machine. The desired clock source should show up in the &lt;code&gt;/sys/devices/system/clocksource/clocksource0/current_clocksource&lt;/code&gt; file.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To start/stop or restart the ntp demon on your machine from the command line, do:&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;code&gt;&lt;div&gt;user@machine$ sudo /etc/init.d/ntp stop&lt;/div&gt;&lt;div&gt;[sudo] password for user: &lt;/div&gt;&lt;div&gt; * Stopping NTP server ntpd                                                                                                                           [ OK ] &lt;/div&gt;&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://whowhywhathow.blogspot.com/2010/05/to-view-available-clocksource-options.html</link><author>noreply@blogger.com (Priya Bhat)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5324599319882973732.post-2448615397917633646</guid><pubDate>Thu, 06 May 2010 17:50:00 +0000</pubDate><atom:updated>2010-05-26T01:42:48.869+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">address</category><category domain="http://www.blogger.com/atom/ns#">bash</category><category domain="http://www.blogger.com/atom/ns#">command</category><category domain="http://www.blogger.com/atom/ns#">Karmic Koala</category><category domain="http://www.blogger.com/atom/ns#">Ubuntu</category><title>Add commands to bash</title><description>This post is about adding user defined commands to bash so that you can run applications only using the command rather than specifying the whole path of the application executable.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The code provided here has been tested on &lt;code&gt;Ubuntu 9.10 (Karmic Koala)&lt;/code&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There are two ways to accomplish the mission, the first is to put your application is the default path that bash already looks into while trying to execute your command, and the second is to add another location as a path that bash must check.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For the first option, run &lt;code&gt;$PATH&lt;/code&gt; in the terminal. Your terminal output would look something like&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you put your scripts/executables in any of the above locations, bash will find it and execute it without you having to specify the whole path.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For the second option, you need to edit the &lt;code&gt;~/.bashrc&lt;/code&gt; file and add the location of the executable to the &lt;code&gt;PATH&lt;/code&gt; locations. Suppose this location is &lt;code&gt;/home/pbhat/bin/&lt;/code&gt;. Concatenate the following line to the end of &lt;code&gt;~/.bashrc&lt;/code&gt; file.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;PATH=$PATH:/home/pbhat/bin&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;export PATH&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Save and close the file and now run the following command in the terminal:&lt;/div&gt;&lt;div&gt;&lt;code&gt;source ~.bashrc&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Unless you run this command the updated path will not show up.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://whowhywhathow.blogspot.com/2010/05/add-commands-to-bash.html</link><author>noreply@blogger.com (Priya Bhat)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5324599319882973732.post-2896590705791177317</guid><pubDate>Thu, 06 May 2010 16:01:00 +0000</pubDate><atom:updated>2010-07-23T20:22:40.068+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">inflate</category><category domain="http://www.blogger.com/atom/ns#">tar</category><category domain="http://www.blogger.com/atom/ns#">tar.gz</category><category domain="http://www.blogger.com/atom/ns#">zip</category><title>Inflate multiple files with one command</title><description>If you have many multiple archives which have been compressed using different encryptions (&lt;code&gt;tar&lt;/code&gt;, &lt;code&gt;tar.gz&lt;/code&gt; or &lt;code&gt;zip&lt;/code&gt;) in one directory, you can use the script provided in this post to inflate them into the directories with the same name as the original archive, that is:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; &lt;code&gt;file1.zip&lt;/code&gt; will get inflated to &lt;code&gt;file1/&lt;/code&gt;&lt;/div&gt;&lt;div&gt; &lt;code&gt;file2.tar&lt;/code&gt; will get inflated to &lt;code&gt;file2/&lt;/code&gt;&lt;/div&gt;&lt;div&gt; &lt;code&gt;file3.tar.gz&lt;/code&gt; will get inflated to &lt;code&gt;file3/&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So here is the script:&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:monospace;font-size:100%;"&gt;&lt;span class="Apple-style-span"  style="font-size:13px;"&gt;&lt;span class="Apple-style-span"   style="font-family:Georgia, serif;font-size:130%;"&gt;&lt;span class="Apple-style-span"  style="font-size:16px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;div&gt;&lt;div&gt;#!/bin/bash&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;cd $1&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;for i in $(ls)&lt;/div&gt;&lt;div&gt;do&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;dir_name=$(echo $i | sed "s/\([^.]*\)[.].*/\1/")&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;if [[ "$i" =~ "zip" ]]; then&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;mkdir -p $dir_name&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;cd $dir_name; &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;unzip $i&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;cd ../&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;elif [[ "$i" =~ "tar.gz" ]]; then&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;mkdir -p $dir_name&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;cd $dir_name&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;tar -xzvf ../$i&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;cd ../&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;elif [[ "$i" =~ "tar" ]]; then&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;mkdir -p $dir_name&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;cd $dir_name&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;tar -xvf ../$i&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;cd ../&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;fi &lt;/div&gt;&lt;div&gt;done&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;The argument to this code is the full path of the directory that contains the archived files. Notice that the script searches for the strings, "tar", "zip" and "tar.gz" in the filenames. If you have other files in the directory which contain these strings in their names, they can get overwritten!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can save the script using a name of your choice (I have named it &lt;code&gt;open.sh&lt;/code&gt;, as indicated in the terminal output shown below) &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="  ;font-family:monospace;font-size:13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;code&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:monospace;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;terminal$ ls directory_path/&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;file1.tar  file2.zip  file3.tar.gz&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;terminal$ ./open.sh directory_path/&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;terminal$ ls directory_path/&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;file1  file1.tar  file2  file2.zip  file3  file3.tar.gz&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I would like to thank &lt;a href="http://www.acis.ufl.edu/~girish/"&gt;Girish Venkatasubramanian&lt;/a&gt; for advice on this script.&lt;/div&gt;</description><link>http://whowhywhathow.blogspot.com/2010/05/inflate-multiple-files-with-one-command.html</link><author>noreply@blogger.com (Priya Bhat)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5324599319882973732.post-315437131779260852</guid><pubDate>Thu, 06 May 2010 14:42:00 +0000</pubDate><atom:updated>2010-05-06T21:02:10.648+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">anacron</category><category domain="http://www.blogger.com/atom/ns#">backup</category><category domain="http://www.blogger.com/atom/ns#">cron</category><category domain="http://www.blogger.com/atom/ns#">rsync</category><title>Setting up automatic back-ups</title><description>&lt;span class="Apple-style-span"  style="font-size:small;"&gt;To set up automatic back-ups from your machine to a &lt;code&gt;remoteserver&lt;/code&gt; use &lt;code&gt;rsync&lt;/code&gt; and &lt;code&gt;cron/anacron&lt;/code&gt; commands that now come pre-installed on your Linux machine.&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://linuxgazette.net/104/odonovan.html"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Here&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; is the reference from the Linux gazette that I used to set up my backups. Since my machine is not necessarily turned on 24 hours a day, I used &lt;code&gt;anacron&lt;/code&gt; in stead of &lt;code&gt;cron&lt;/code&gt; to schedule my backups.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;To set-up a new job for &lt;code&gt;anacron&lt;/code&gt;, edit the &lt;code&gt;/etc/anacrontab&lt;/code&gt; file &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt; &lt;code&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; 1       20      backup rsync -r -e ssh --delete /home/username/thesis username@remoteserver:backups/thesis/thesis/&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;For the above command to run you should have the public/private key for password-less login to the &lt;code&gt;remoteserver&lt;/code&gt; set-up before hand.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;On the &lt;code&gt;remoteserver&lt;/code&gt;, you must set up cron-jobs to store timely snapshots of the backups. This would help if your current versions are corrupted and you would like to roll back to a previous version.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Here is the code that must be added to your cron file (edit it using &lt;/span&gt;&lt;code&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;crontab -e &lt;/span&gt;&lt;/code&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;) to do that (root access not required):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;# Back up mail files with snapshots of 6, 4, 3, 2, 1 months and 3, 2, 1 weeks&lt;br /&gt;# Order 4m-&gt;6m, 3m-&gt;4m, 2m-&gt;3m, 1m-&gt;2m, 3w-&gt;1m, 2w-&gt;3w, 1w-&gt;2w, mirror-&gt;1w&lt;br /&gt;&lt;br /&gt;# At 3am on the 1st of Jan,Mar,May,Jul,Sep,Nov copy the 4m to the 6m&lt;br /&gt;00 03 1 1,3,5,7,9,11 * cp -f /backups/thesis/backup/4month.tar.gz /backups/thesis/backup/6month.tar.gz&lt;br /&gt;&lt;br /&gt;# At 3.02am on the 1st of every month move the 3m to the 4m (and continue for other months)&lt;br /&gt;02 03 1 * * cp -f /backups/thesis/backup/3month.tar.gz /backups/thesis/backup/4month.tar.gz&lt;br /&gt;04 03 1 * * cp -f /backups/thesis/backup/2month.tar.gz /backups/thesis/backup/3month.tar.gz&lt;br /&gt;06 03 1 * * cp -f /backups/thesis/backup/1month.tar.gz /backups/thesis/backup/2month.tar.gz&lt;br /&gt;08 03 1 * * cp -f /backups/thesis/backup/3week.tar.gz  /backups/thesis/backup/1month.tar.gz&lt;br /&gt;&lt;br /&gt;# And then every Sunday take care of the weekly snapshots and the archiving of the mirror&lt;br /&gt;10 03 * * 0 cp -f /backups/thesis/backup/2week.tar.gz  /backups/thesis/backup/3week.tar.gz&lt;br /&gt;12 03 * * 0 cp -f /backups/thesis/backup/1week.tar.gz  /backups/thesis/backup/2week.tar.gz&lt;br /&gt;14 03 * * 0 rm -f /backups/thesis/backup/1week.tar.gz&lt;br /&gt;16 03 * * 0 tar zcf /backups/thesis/backup/1week.tar.gz /backups/thesis/thesis/*&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;code&gt;&lt;/code&gt;</description><link>http://whowhywhathow.blogspot.com/2010/05/setting-up-automatic-back-ups.html</link><author>noreply@blogger.com (Priya Bhat)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5324599319882973732.post-5952541079726316923</guid><pubDate>Wed, 21 Apr 2010 13:07:00 +0000</pubDate><atom:updated>2010-05-07T18:48:29.041+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">address</category><category domain="http://www.blogger.com/atom/ns#">IP</category><category domain="http://www.blogger.com/atom/ns#">sftp</category><category domain="http://www.blogger.com/atom/ns#">ssh</category><category domain="http://www.blogger.com/atom/ns#">translation</category><title>Translating from Names to IPs</title><description>To store the translation from a machine name to its IP go to &lt;code&gt;/etc/hosts&lt;/code&gt; under &lt;code&gt;Ubuntu Linux&lt;/code&gt;. You would need to &lt;code&gt;sudo&lt;/code&gt; to change the file. Add stuff like:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;192.X.X.X Xen1&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Doing this will make it easier to &lt;code&gt;ssh&lt;/code&gt;, &lt;code&gt;sftp&lt;/code&gt;, etc. as you don't need to remember the IP addresses of the machines and more easily memorizable mnemonics can be used instead&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For example now you could do:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;code&gt;ssh xen1&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;/span&gt; and your machine would know where you want to go !&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://whowhywhathow.blogspot.com/2010/04/translating-from-names-to-ips.html</link><author>noreply@blogger.com (Priya Bhat)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5324599319882973732.post-5667663049795518132</guid><pubDate>Fri, 06 Feb 2009 18:09:00 +0000</pubDate><atom:updated>2009-02-06T23:55:27.916+05:30</atom:updated><title>The tale of three Operating Systems</title><description>I have no qualms in admitting that I am pretty much a one-OS person. Having grown up with Windows, I have struggled, tripped, crawled and somehow managed to survive in this hopelessly zesty world of research where Linux has come to become a religion...&lt;br /&gt;&lt;br /&gt;You can just say that for a person who is so less inclined to find "discovering new commands" as a pleasure giving exercise, I have chosen the wrong profession...&lt;br /&gt;&lt;br /&gt;But here I am... with a (primitive) 30 GB hard disk machine which can boot into 3 Operating systems namely Windows, Ubuntu and Xen, (I need all three  to compare performance).... cyphering through the long list of configuration files.... and wondering if the solution to my whole research problem isn't simply for the whole world to accept one single OS that is just good enough...&lt;br /&gt;&lt;br /&gt;How much simpler would that be...</description><link>http://whowhywhathow.blogspot.com/2009/02/tale-of-three-operating-systems.html</link><author>noreply@blogger.com (Priya Bhat)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5324599319882973732.post-8879570147008242595</guid><pubDate>Thu, 21 Aug 2008 19:53:00 +0000</pubDate><atom:updated>2008-08-22T02:00:54.281+05:30</atom:updated><title>So what am I PhDing in?</title><description>Ahhh Academia! Here I am again....  Almost 15 months after leaving &lt;a href="http://cobweb.ecn.purdue.edu/RVL/Welcome.html"&gt;Robot Vision Laboratory, Purdue University&lt;/a&gt; and 2 months after leaving &lt;a href="http://www.read-ink.com/contactus.html"&gt;Read-Ink Technologies Pvt. Limited&lt;/a&gt;, Bangalore here I am at  &lt;a href="https://www.acis.ufl.edu/"&gt;Advanced Computing and Informations Systems Laboratory, University of Florida&lt;/a&gt;!&lt;br /&gt;&lt;br /&gt;And, btw my welcome-party here includes a surprise performance by Fay!&lt;br /&gt;&lt;br /&gt;My friend Mridul once narrated  a conversation that he had with his adviser regarding when is it too late for a person to think about doing a PhD. The conversation boiled down to this: "if you can name even three areas/topics/questions that intrigue you and which you want to grasp, you qualify!"&lt;br /&gt;&lt;br /&gt;Hmmm... on the question of inquisitiveness, &lt;span style="font-style: italic;"&gt;'ll, I ain't sure 'bout how hungry for knowledge I'm.... but 'sure 'm Mal-knowledge-ed!!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So to come to the question raised in the topic of this post and which so many people have asked me, the answer is "I don't know yet"...&lt;br /&gt;&lt;br /&gt;Its a whole new universe out here and for me the journey has just begun!</description><link>http://whowhywhathow.blogspot.com/2008/08/so-what-am-i-phding-in.html</link><author>noreply@blogger.com (Priya Bhat)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5324599319882973732.post-7354526460329121758</guid><pubDate>Wed, 18 Jun 2008 11:03:00 +0000</pubDate><atom:updated>2008-06-18T16:33:56.195+05:30</atom:updated><title>Last Day at Read-Ink …</title><description>&lt;p class="MsoNormal"&gt;Exactly a year ago, on this very day I walked into a white, three-storied building in Indiranagar, &lt;st1:city st="on"&gt;&lt;st1:place st="on"&gt;Bangalore&lt;/st1:place&gt;&lt;/st1:City&gt;-the office to a start-up called Read-Ink Technologies Private Limited. That was the beginning of my first job…. And today, I am bidding farewell to this place and all the wonderful people I met here.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;A lot changed over the last year; personally speaking, I got married, had a laptop blast in my house, realized a new local maximum of my ignorance, got banned, reached a new high in fitness, traveled, trekked, met some amazing people, made a few friends for life and lost a few dear ones to death…. &lt;span style=""&gt; &lt;/span&gt;To sum it up, it has been an eventful year! &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;But as I leave today I am not thinking about all the events that transpired over the last year or about the eventualities that I might have to face in the days to come… instead, my brain is working like a camera capturing humdrum moments of a ‘normal’ day here… things that will remain the same tomorrow as they were before I came… &lt;span style=""&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Maybe at some time in the future I will chalk out the balance sheets for how ‘useful’ this last year has been. But as of today, such algebra is beyond me…. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;In my life’s book another chapter is closing.... tomorrow there will be no office, no bantering over coffee, no peeping over the cubicle, no meetings, no walks, no ‘goodh foodh’….and no second lunches…&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Some how, the knowledge that we are going to leave soon does not stop us from making ourselves at home…. And that applies to life just the same.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Tomorrow will be a new chapter… beginning of new journeys… &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;But today, I feel like the narrator just gave the verdict… “Priya is dead! Priya is Mafia!!”&lt;i style=""&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;i style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;i style=""&gt;Damn! I have to sit out for the rest of the game… AGAIN!&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/p&gt;</description><link>http://whowhywhathow.blogspot.com/2008/06/last-day-at-read-ink.html</link><author>noreply@blogger.com (Priya Bhat)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5324599319882973732.post-9029406751147110184</guid><pubDate>Wed, 04 Jun 2008 11:03:00 +0000</pubDate><atom:updated>2008-06-05T14:53:18.042+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">C++</category><category domain="http://www.blogger.com/atom/ns#">Evil</category><category domain="http://www.blogger.com/atom/ns#">Matlab</category><title>MATLAB vs. C++? And the winner is….</title><description>&lt;o:p&gt;&lt;/o:p&gt;….C++, of course! And, for the simple reason that MATLAB IS EVIL!&lt;o:p&gt; &lt;/o:p&gt;    &lt;p class="MsoNormal"&gt;To all you pseudo-programmers, Simulink-flaunting ‘engineers’ and the like who swear by the ‘inbuilt functionality’ and ‘user-friendliness’ of MATLAB, I would just like to say… &lt;i style=""&gt;people, get a life&lt;/i&gt;! Its not that you don’t KNOW how stupid this application is- after all, you are the ones who sit there wiggling your toes while MATLAB takes minutes to run something C++ would do in micro-seconds; and you are the ones who get stymied, &lt;span style=""&gt; &lt;/span&gt;trying to make MATLAB understand even most simple Data Structures - then why not accept it? Why not, for once and for all, agree to the fact that C++ is superior and stop going ya-ya-ya about the ‘cool’ things about MATLAB!&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;People often tell me that MATLAB works better for engineers because of its inbuilt libraries and as a proof (by demonstration) they may type ‘14382^11.32’ on their command windows and lo-and-behold MATLAB tells you the answer! And then their argument may go something to the effect that to do the same thing with C++, you would need to write a function, maybe include a couple of libraries, debug, compile and run … too much headache for something MATLAB does in ONE line! Well, that is a fair argument…. only if you think that that is engineering… namely calculating random numbers to the power of random numbers…!&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/p&gt;      &lt;p class="MsoNormal"&gt;Honestly, that is anything but engineering! &lt;span style=""&gt; &lt;/span&gt;Engineering is about conceptualizing and it takes power to design elegant structures to translate those concepts to code… A good data structure is the difference between an understandable, well-organized, effectual program and useless, &lt;span class="resultbody"&gt;exasperating gobbledygook. But&lt;/span&gt; that is something MATLAB just does not understand. The ‘arrays’, ‘cell arrays’ and ‘structure’ that it provides address the problem of stucturing data with the same success rate as Bush is addressing the issue of ending the Iraq War!&lt;span class="resultbody"&gt;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;span class="resultbody"&gt;Engineering also needs checks and while I admit that C/C++ has its own shortcomings when it comes to &lt;/span&gt;security issues (memory leaks, garbage collection problems, etc.), MATLAB is just outright scary. For example, there are no type-checks as a variable can be redefined from an integer to a character, to an array, to a structure within the span of a single function! Further, MATLAB passes parameters only by value… which is totally sinful if you want to pass large arrays and structures… just think of how much time and space you are consuming!&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/p&gt;                  &lt;p class="MsoNormal"&gt;With C++ and a little more patience you can write code that is not only more efficient, it also better structured, more-understandable at any later date and therefore more reusable… I guess that’s why the latest (2008a) version of MATLAB had introduced object-oriented concepts and parameter passing by reference… But that’s something I am yet to get my hands dirty with….&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/p&gt;</description><link>http://whowhywhathow.blogspot.com/2008/06/matlab-vs-c-and-winner-is.html</link><author>noreply@blogger.com (Priya Bhat)</author></item></channel></rss>