<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>TechDiary</title><link>http://techdiary-viki.blogspot.com/</link><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Techdiary" /><description>~%~* sharing *~%~</description><language>en</language><managingEditor>noreply@blogger.com (Viki)</managingEditor><lastBuildDate>Sun, 27 Nov 2011 16:23:28 PST</lastBuildDate><generator>Blogger http://www.blogger.com</generator><openSearch:totalResults xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/">38</openSearch:totalResults><openSearch:startIndex xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/">1</openSearch:startIndex><openSearch:itemsPerPage xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/">25</openSearch:itemsPerPage><feedburner:info uri="techdiary" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><media:keywords>perl,scripting,shell,script</media:keywords><media:category scheme="http://www.itunes.com/dtds/podcast-1.0.dtd">Education/Educational Technology</media:category><media:category scheme="http://www.itunes.com/dtds/podcast-1.0.dtd">Technology</media:category><itunes:owner><itunes:email>vikas.nv@gmail.com</itunes:email><itunes:name>Viki</itunes:name></itunes:owner><itunes:author>Viki</itunes:author><itunes:explicit>no</itunes:explicit><itunes:keywords>perl,scripting,shell,script</itunes:keywords><itunes:subtitle>Perl: Tips &amp; Tutorials</itunes:subtitle><itunes:category text="Education"><itunes:category text="Educational Technology" /></itunes:category><itunes:category text="Technology" /><feedburner:emailServiceId>Techdiary</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item><title>Debian/LXDE running on Acer Iconia A500 tab</title><link>http://feedproxy.google.com/~r/Techdiary/~3/xKqpIZqOvaU/debianlxde-running-on-acer-iconia-a500.html</link><category>lxde</category><category>debian</category><category>android</category><category>hacking</category><author>vikas.nv@gmail.com (Viki)</author><pubDate>Wed, 24 Aug 2011 06:22:00 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3366815763976900792.post-1239981366687788113</guid><description>I got a chance to have this tablet for sometime, and since then I have been hacking it. The first thing to do is most obvious, to root the device. I have reloaded the tablet with Taboonay's ROM (1.1) based on the Android Honeycomb 3.1 stock ROM. It has it's cool features, about which you can read &lt;a href="http://forum.xda-developers.com/showthread.php?t=1138051"&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;And thanks to &lt;a href="http://lanrat.com/android/debian"&gt;lanrat &lt;/a&gt;for an article about this.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;*** Do this if you fully understand what you are doing***&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Now over to getting Debian on to the tablet.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Your device should be rooted. You need some free space on the SD card, about 1 GB is sufficient for this.&amp;nbsp;Secondly you have to prepare a base installer image of Debian, I did this on Ubuntu 11.04. If you do not have a Linux box don't sweat it, get&lt;a href="http://www.pendrivelinux.com/universal-usb-installer-easy-as-1-2-3/"&gt; Linux on a pen drive&lt;/a&gt; and boot from that.&amp;nbsp;And you need the Android terminal, also set it up such that your $PATH variable has /system/xbin in the beginning. For installing/configuring LXDE you need to have a mouse and keyboard connected to your tablet (I used an old bluetooth keyboard and mouse from Logitech EX100).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Once you are in Ubuntu open a terminal and do the following to create the base image -&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;sudo -s&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;apt-get install debootstrap&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;dd if=/dev/zero of=debian.img seek=1073741824 bs=1 count=1 # I use 1 GB image size **&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;mke2fs -F debian.img&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;mkdir debian&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;mount -o loop debian.img debian/&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;debootstrap --verbose --arch armel --foreign lenny debian http://ftp.us.debian.org/debian&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;umount debian/&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;rm -r debian/&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;** you can use lesser image size (800 MB) if you do not want to install LXDE.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;With that you have a Debian base installer image. Now download this &lt;a href="https://docs.google.com/document/pub?id=1XQe5zyelNj1lpMUAsROzySv1kYMxObiOxAZfAWrKWZw"&gt;chroot script&lt;/a&gt;, which will be used to set up environment to run Debian (save this file as bootdebian). Copy this image and the chroot script to the SD card, such that it lays in&amp;nbsp;&lt;/div&gt;&lt;div&gt;/mnt/external_sd&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Now put back the SD card into the tablet and power on. Following commands will make the chroot script&lt;/div&gt;&lt;div&gt;executable in Android terminal and turn it into a command, open Android terminal on the tablet and type -&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;su&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;mount -o remount,rw -t yaffs2 /dev/block/mmcblk0p3 /system&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;cat /mnt/external_sd/bootdebian &amp;gt; /system/xbin/bootdebian&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;dos2unix /system/xbin/bootdebian&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;rm /mnt/external_sd/bootdebian&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;chmod 777 /system/xbin/bootdebian&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;With that done, you have a command 'bootdebian' which can be run to set up to run Debian.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;After this you need to complete the Debian install, for that run the following commands on the Android terminal -&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;bootdebian&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;/debootstrap/debootstrap --second-stage&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;echo 'deb http://ftp.us.debian.org/debian lenny main' &amp;gt;/etc/apt/sources.list&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;apt-get autoclean&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;apt-get update&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;exit&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;This completes the Debian install. From now on if you want to work on a real Linux box, you just have to ope n the Android terminal and run 'bootdebian'.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Now, commands for installing LXDE -&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;bootdebian&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;apt-get install xdm&lt;/span&gt; # this downloads ~30 MB&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;apt-get install lxde&lt;/span&gt; # this downloads ~100 MB, so you can 'take wakelock' the terminal &amp;amp; go for a walk&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Once the apt-get completes the installations, it starts configuring the LXDE. This is the time you need your hardware keyboard (if not mouse) when it asks for some settings. Look for the place where it asks for which display manager and select 'xdm'.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Next you need to install the tightvncserver so as to create vnc session. For that, run&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;apt-get install tightvncserver&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Once done with that, you can start the session with these commands -&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;export USER=root&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;vncserver -geometry 1280x736 -depth 16&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Above command will ask you for setting up passwords. This creates a session on localhost:1, which is a basic desktop. To start LXDE in the session, you have to instruct the vncserver using the xstartup script. For doing this, run the following commands -&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;vncserver -kill :1&lt;/span&gt; &amp;nbsp;# first kill the running session&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;vi /root/.vnc/xstartup&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;This opens the vi editor loaded with the vncserver's start up script. Edit this script such that it looks something like this -&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: #f1c232;"&gt;#!/bin/sh&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: #f1c232;"&gt;xrdb $HOME/.Xresources&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: #f1c232;"&gt;xsetroot -solid grey&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: #f1c232;"&gt;#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &amp;amp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: #f1c232;"&gt;#x-window-manager &amp;amp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: #f1c232;"&gt;#/etc/X11/Xsession&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="background-color: #f1c232;"&gt;startlxde&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Save the file and close. Start the VNC session.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;To view the session, you can either use the AndroidVNC application on your tablet or any VNC viewer on your PC.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;This ends!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366815763976900792-1239981366687788113?l=techdiary-viki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/vtIzCiGUmbnWq6LK1T8fp7_wbLY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vtIzCiGUmbnWq6LK1T8fp7_wbLY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/vtIzCiGUmbnWq6LK1T8fp7_wbLY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vtIzCiGUmbnWq6LK1T8fp7_wbLY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=xKqpIZqOvaU:BQ0ai0qjBa0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=xKqpIZqOvaU:BQ0ai0qjBa0:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=xKqpIZqOvaU:BQ0ai0qjBa0:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=xKqpIZqOvaU:BQ0ai0qjBa0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=xKqpIZqOvaU:BQ0ai0qjBa0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=xKqpIZqOvaU:BQ0ai0qjBa0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=xKqpIZqOvaU:BQ0ai0qjBa0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=xKqpIZqOvaU:BQ0ai0qjBa0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=xKqpIZqOvaU:BQ0ai0qjBa0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=xKqpIZqOvaU:BQ0ai0qjBa0:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=xKqpIZqOvaU:BQ0ai0qjBa0:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=xKqpIZqOvaU:BQ0ai0qjBa0:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=xKqpIZqOvaU:BQ0ai0qjBa0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=xKqpIZqOvaU:BQ0ai0qjBa0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=xKqpIZqOvaU:BQ0ai0qjBa0:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Techdiary/~4/xKqpIZqOvaU" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-24T18:52:00.058+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://techdiary-viki.blogspot.com/2011/08/debianlxde-running-on-acer-iconia-a500.html</feedburner:origLink></item><item><title>Script to set the compatibility mode of executable files on Windows 7</title><link>http://feedproxy.google.com/~r/Techdiary/~3/xgwQOQiwSiY/script-to-set-compatibility-mode-of.html</link><category>windows compatibility mode script</category><category>python</category><category>windows</category><category>compatibility mode</category><category>python script set windows compatibility mode</category><category>script</category><author>vikas.nv@gmail.com (Viki)</author><pubDate>Thu, 28 Apr 2011 04:21:52 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3366815763976900792.post-6524511394391137982</guid><description>I wanted to install the portable Ubuntu on my Windows machine, and so I downloaded the executable from the &lt;a href="http://sourceforge.net/projects/portableubuntu/"&gt;sourceforge project site&lt;/a&gt;&amp;nbsp;and installed it.&lt;br /&gt;
&lt;br /&gt;
It did not work, I initially thought I have to change the compatibility mode of the executables and set it to Windows XP SP2. There were too many files for which I had to change, so I came up with a script.&lt;br /&gt;
&lt;br /&gt;
This script takes these options:&lt;br /&gt;
-p /--path &lt;span class="Apple-style-span" style="background-color: #ffe599;"&gt;for which you pass the path (all executable files under this path will be considered)&lt;/span&gt;&lt;br /&gt;
-m /--mode &lt;span class="Apple-style-span" style="background-color: #ffe599;"&gt;for which you pass the compatibility mode (list of valid modes given at the end of the post)&lt;/span&gt;&lt;br /&gt;
-a /--runasadmin &lt;span class="Apple-style-span" style="background-color: #ffe599;"&gt;which is a toggle option which enables/disables the "Run as Administrator" option (default: disabled)&lt;/span&gt;&lt;br /&gt;
-v /--verbose &lt;span class="Apple-style-span" style="background-color: #ffe599;"&gt;which is a toggle option which print more information (default: disabled)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The script did work :) ... but the portable Ubuntu did not :(&lt;br /&gt;
&lt;br /&gt;
You can download the script from &lt;a href="http://www.box.net/shared/noigp2zdal"&gt;here&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Don't worry to run this script on the same directory multiple times, the Windows registry takes care of duplicates by adding a file as a single entry.&lt;br /&gt;
&lt;br /&gt;
List of compatibility modes (that go with --mode/ -m option):&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;"WIN95": "Windows 95 compatibilty mode",&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;"WIN98": "Windows Millennium or 98 compatibility mode",&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;"NT4SP5": "NT 4.0 Service Pack 5 compatibility mode",&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;"WIN2000": "Windows 2K compatibility mode",&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;"WINXPSP2": "Windows XP Service Pack 2 compatibility mode",&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;"WINSRV03SP1": "Windows Server 2003 SP 1 compatibility mode"&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;EDIT:&lt;/b&gt;&lt;br /&gt;
How to run this script on Windows... ?&lt;br /&gt;
Firstly, install python on your Windows machine. For installation you should download an appropriate&lt;br /&gt;
setup file for your Windows machine from this &lt;a href="http://www.python.org/download/releases/2.7.1/"&gt;link&lt;/a&gt;, then double click the setup file and follow the on screen instructions.&lt;br /&gt;
Secondly, download the script from &lt;a href="http://www.box.net/shared/noigp2zdal"&gt;here&lt;/a&gt;. And here is how to run it:&lt;br /&gt;
Open a command terminal in Windows by hitting Windows+R keys and entering "cmd" (no quotes)&lt;br /&gt;
Then, navigate to the directory to which you downloaded the script (using 'cd'), when you are there&lt;br /&gt;
type these commands:&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: orange;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;python&amp;nbsp;compatibility_change.py --path "c:\\path\\to\\executables" --mode&amp;nbsp;WINXPSP2&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366815763976900792-6524511394391137982?l=techdiary-viki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/yckjICFldR7oZEGTm0Sia6re9Pc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yckjICFldR7oZEGTm0Sia6re9Pc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/yckjICFldR7oZEGTm0Sia6re9Pc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yckjICFldR7oZEGTm0Sia6re9Pc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=xgwQOQiwSiY:xMZkAjhbDfM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=xgwQOQiwSiY:xMZkAjhbDfM:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=xgwQOQiwSiY:xMZkAjhbDfM:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=xgwQOQiwSiY:xMZkAjhbDfM:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=xgwQOQiwSiY:xMZkAjhbDfM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=xgwQOQiwSiY:xMZkAjhbDfM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=xgwQOQiwSiY:xMZkAjhbDfM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=xgwQOQiwSiY:xMZkAjhbDfM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=xgwQOQiwSiY:xMZkAjhbDfM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=xgwQOQiwSiY:xMZkAjhbDfM:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=xgwQOQiwSiY:xMZkAjhbDfM:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=xgwQOQiwSiY:xMZkAjhbDfM:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=xgwQOQiwSiY:xMZkAjhbDfM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=xgwQOQiwSiY:xMZkAjhbDfM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=xgwQOQiwSiY:xMZkAjhbDfM:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Techdiary/~4/xgwQOQiwSiY" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-28T16:51:52.839+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://techdiary-viki.blogspot.com/2011/03/script-to-set-compatibility-mode-of.html</feedburner:origLink></item><item><title>IMDB API</title><link>http://feedproxy.google.com/~r/Techdiary/~3/khgBQtT0Vr0/imdb-api.html</link><category>movie details from imdb</category><category>python imdb api</category><category>python module movie details</category><category>imdb</category><category>extract movie details</category><category>imdb python api</category><category>imdb api</category><author>vikas.nv@gmail.com (Viki)</author><pubDate>Wed, 05 Oct 2011 06:03:50 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3366815763976900792.post-6617508622730511930</guid><description>[UPDATE: links are update]&lt;br /&gt;
&lt;br /&gt;
Here I present the module which provides APIs to get information about movies from IMDB.&lt;br /&gt;
&lt;br /&gt;
This is about a Python implementation of IMDB API.&lt;br /&gt;
&lt;br /&gt;
You don't have to download the IMDB's databases locally to use these APIs.&lt;br /&gt;
&lt;br /&gt;
I have used Peteris Krumins' xgoogle library along with the BeautifulSoup to develop this in Python.&lt;br /&gt;
&lt;br /&gt;
You may have to install the BeautifulSoup module (download from &lt;a href="http://www.crummy.com/software/BeautifulSoup/download/3.x/BeautifulSoup-3.2.0.tar.gz"&gt;here&lt;/a&gt;) and xgoogle library (from &lt;a href="http://www.box.net/shared/r218urokj2pq0dg988hs"&gt;here&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
And &lt;a href="http://www.box.net/shared/nekju4unfq"&gt;here&lt;/a&gt; is the link for &lt;a href="http://www.box.net/shared/nekju4unfq"&gt;IMDB API&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Here is a little bit of description about the usage:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; from pIMDB import pIMDB&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if len(sys.argv) &amp;lt; 2:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Usage: %s &lt;movie name=""&gt;" % sys.argv[0]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.exit(1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; movie = re.sub(r'[^a-zA-Z0-9\']+', ' ', sys.argv[1])&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; imdb = pIMDB(movie)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; imdb.parse_imdb_page()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "imdb link:\n\t", imdb.imdb_link&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "\nmovie name:\n\t", imdb.movie&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "\nmovie rating:\n\t%s/%s" % (imdb.rating, imdb.outof)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "\nmovie details:\n\t%s" % '\n\t'.join(imdb.details)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "\nmovie storyline:\n\t%s" % imdb.storyline&lt;/movie&gt;&lt;br /&gt;
&lt;br /&gt;
It also has an API to download the poster from the IMDB website, you can use it as here:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; imdb.download_poster('/tmp/destination.jpg')&lt;br /&gt;
&lt;br /&gt;
That's the end of the story :)&lt;br /&gt;
&lt;br /&gt;
PS: Write a comment on how you used this module&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366815763976900792-6617508622730511930?l=techdiary-viki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/tg0SLvT_WO6g-FwxDqPfYyy9DlA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tg0SLvT_WO6g-FwxDqPfYyy9DlA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/tg0SLvT_WO6g-FwxDqPfYyy9DlA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tg0SLvT_WO6g-FwxDqPfYyy9DlA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=khgBQtT0Vr0:KtAGnBuCw8g:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=khgBQtT0Vr0:KtAGnBuCw8g:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=khgBQtT0Vr0:KtAGnBuCw8g:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=khgBQtT0Vr0:KtAGnBuCw8g:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=khgBQtT0Vr0:KtAGnBuCw8g:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=khgBQtT0Vr0:KtAGnBuCw8g:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=khgBQtT0Vr0:KtAGnBuCw8g:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=khgBQtT0Vr0:KtAGnBuCw8g:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=khgBQtT0Vr0:KtAGnBuCw8g:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=khgBQtT0Vr0:KtAGnBuCw8g:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=khgBQtT0Vr0:KtAGnBuCw8g:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=khgBQtT0Vr0:KtAGnBuCw8g:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=khgBQtT0Vr0:KtAGnBuCw8g:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=khgBQtT0Vr0:KtAGnBuCw8g:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=khgBQtT0Vr0:KtAGnBuCw8g:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Techdiary/~4/khgBQtT0Vr0" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-05T18:33:50.511+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">6</thr:total><enclosure url="http://www.crummy.com/software/BeautifulSoup/download/3.x/BeautifulSoup-3.2.0.tar.gz" length="31056" type="application/x-gzip" /><media:content url="http://www.crummy.com/software/BeautifulSoup/download/3.x/BeautifulSoup-3.2.0.tar.gz" fileSize="31056" type="application/x-gzip" /><itunes:explicit>no</itunes:explicit><itunes:subtitle>[UPDATE: links are update] Here I present the module which provides APIs to get information about movies from IMDB. This is about a Python implementation of IMDB API. You don't have to download the IMDB's databases locally to use these APIs. I have used P</itunes:subtitle><itunes:author>Viki</itunes:author><itunes:summary>[UPDATE: links are update] Here I present the module which provides APIs to get information about movies from IMDB. This is about a Python implementation of IMDB API. You don't have to download the IMDB's databases locally to use these APIs. I have used Peteris Krumins' xgoogle library along with the BeautifulSoup to develop this in Python. You may have to install the BeautifulSoup module (download from here) and xgoogle library (from here) And here is the link for IMDB API Here is a little bit of description about the usage: &amp;nbsp;&amp;nbsp;&amp;nbsp; from pIMDB import pIMDB &amp;nbsp;&amp;nbsp;&amp;nbsp; if len(sys.argv) &amp;lt; 2: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Usage: %s " % sys.argv[0] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.exit(1) &amp;nbsp;&amp;nbsp;&amp;nbsp; movie = re.sub(r'[^a-zA-Z0-9\']+', ' ', sys.argv[1]) &amp;nbsp;&amp;nbsp;&amp;nbsp; imdb = pIMDB(movie) &amp;nbsp;&amp;nbsp;&amp;nbsp; imdb.parse_imdb_page() &amp;nbsp;&amp;nbsp;&amp;nbsp; print "imdb link:\n\t", imdb.imdb_link &amp;nbsp;&amp;nbsp;&amp;nbsp; print "\nmovie name:\n\t", imdb.movie &amp;nbsp;&amp;nbsp;&amp;nbsp; print "\nmovie rating:\n\t%s/%s" % (imdb.rating, imdb.outof) &amp;nbsp;&amp;nbsp;&amp;nbsp; print "\nmovie details:\n\t%s" % '\n\t'.join(imdb.details) &amp;nbsp;&amp;nbsp;&amp;nbsp; print "\nmovie storyline:\n\t%s" % imdb.storyline It also has an API to download the poster from the IMDB website, you can use it as here: &amp;nbsp;&amp;nbsp;&amp;nbsp; imdb.download_poster('/tmp/destination.jpg') That's the end of the story :) PS: Write a comment on how you used this module</itunes:summary><itunes:keywords>perl,scripting,shell,script</itunes:keywords><feedburner:origLink>http://techdiary-viki.blogspot.com/2011/03/imdb-api.html</feedburner:origLink></item><item><title>Configure Gmail on your N900</title><link>http://feedproxy.google.com/~r/Techdiary/~3/L2ZK_mSaWhU/configure-gmail-on-your-n900.html</link><category>gmail</category><category>n900</category><author>vikas.nv@gmail.com (Viki)</author><pubDate>Thu, 18 Nov 2010 07:04:14 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3366815763976900792.post-3843532486366081239</guid><description>Here is a little guide to setup Gmail on your N900 using the Email application that comes by default on N900.&lt;br /&gt;
&lt;br /&gt;
I am writing this because I could not find a working solution when I tried Google-ing "how to configure n900 for gmail".&lt;br /&gt;
&lt;br /&gt;
Basically, I just helped my N900 to resolve imap.gmail.com and smtp.gmail.com&lt;br /&gt;
So here goes the steps...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Connect to the internet on your PC/laptop and ping imap.gmail.com &amp;amp; smtp.gmail.com. Note down the IP addresses of both. Here is a screen shot of the command prompt&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_NQ1Ssrf_DXw/TOU3dEecxnI/AAAAAAAACjM/DeRuvOtYy4M/s1600/cmd-scrshot.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="164" src="http://4.bp.blogspot.com/_NQ1Ssrf_DXw/TOU3dEecxnI/AAAAAAAACjM/DeRuvOtYy4M/s320/cmd-scrshot.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;2. Now on your N900 launch the Terminal and gain root access (if you don't know what I am telling, read this &lt;a href="http://maemo.org/downloads/product/Maemo5/rootsh/"&gt;Rootsh&lt;/a&gt;)&lt;br /&gt;
3. Edit the file /etc/hosts (I use vi to edit)&lt;br /&gt;
4. Add following two lines to the file (do not delete any lines already existing in the file)&lt;br /&gt;
72.14.213.109&amp;nbsp;&amp;nbsp; imap.gmail.com&lt;br /&gt;
74.125.53.109 &amp;nbsp; smtp.gmail.com &lt;br /&gt;
(Replace the IP addresses in the above lines to what you noted down in the 1st step)&lt;br /&gt;
5. Save the file and exit the editor&lt;br /&gt;
6. Launch the Email application on N900. Follow the wizard that it shows by selecting Gmail in the list of providers that it shows.&lt;br /&gt;
7. Enter your user name and password and go till you click finish.&lt;br /&gt;
&lt;br /&gt;
The account you set up should work fine. If not, tap on Edit settings for the account and make sure the settings are as shown in the screen shot below&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_NQ1Ssrf_DXw/TOU_qEAOmZI/AAAAAAAACjQ/ARwSV0dfY_I/s1600/Screenshot-n900-gmail-settings.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/_NQ1Ssrf_DXw/TOU_qEAOmZI/AAAAAAAACjQ/ARwSV0dfY_I/s320/Screenshot-n900-gmail-settings.png" width="189" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366815763976900792-3843532486366081239?l=techdiary-viki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/4JXnTdLRyh_5LasgJeH5dvYunQY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4JXnTdLRyh_5LasgJeH5dvYunQY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/4JXnTdLRyh_5LasgJeH5dvYunQY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4JXnTdLRyh_5LasgJeH5dvYunQY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=L2ZK_mSaWhU:2gg4_n2obHQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=L2ZK_mSaWhU:2gg4_n2obHQ:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=L2ZK_mSaWhU:2gg4_n2obHQ:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=L2ZK_mSaWhU:2gg4_n2obHQ:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=L2ZK_mSaWhU:2gg4_n2obHQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=L2ZK_mSaWhU:2gg4_n2obHQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=L2ZK_mSaWhU:2gg4_n2obHQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=L2ZK_mSaWhU:2gg4_n2obHQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=L2ZK_mSaWhU:2gg4_n2obHQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=L2ZK_mSaWhU:2gg4_n2obHQ:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=L2ZK_mSaWhU:2gg4_n2obHQ:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=L2ZK_mSaWhU:2gg4_n2obHQ:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=L2ZK_mSaWhU:2gg4_n2obHQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=L2ZK_mSaWhU:2gg4_n2obHQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=L2ZK_mSaWhU:2gg4_n2obHQ:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Techdiary/~4/L2ZK_mSaWhU" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-18T20:34:14.316+05:30</app:edited><media:thumbnail url="http://4.bp.blogspot.com/_NQ1Ssrf_DXw/TOU3dEecxnI/AAAAAAAACjM/DeRuvOtYy4M/s72-c/cmd-scrshot.jpg" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://techdiary-viki.blogspot.com/2010/11/configure-gmail-on-your-n900.html</feedburner:origLink></item><item><title>Frozen Bubble on N900 :) !!!</title><link>http://feedproxy.google.com/~r/Techdiary/~3/UtUwk-u3WIA/frozen-bubble-on-n900.html</link><category>n900 games</category><category>frozen bubble</category><category>n900</category><author>vikas.nv@gmail.com (Viki)</author><pubDate>Wed, 06 Oct 2010 08:04:42 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3366815763976900792.post-10426932342475919</guid><description>Have you played this game, frozen bubble? Its the most addictive game I have ever played ... next to some games like bejeweled. I had this game on my previous phone Nokia 5800. So I was searching for this game ... hoping some one would have ported it to N900 (currently I own it). WOW I found it here http://maemo.org/packages/view/frozen-bubble/&lt;br /&gt;
&lt;br /&gt;
It is still in development repository but I have used it and it is working perfectly. It has great music and great graphics this time, and its called frozen bubble 2.&lt;br /&gt;
&lt;br /&gt;
Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366815763976900792-10426932342475919?l=techdiary-viki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/nQNzO3KqxHXlDgyCuwPRIaF2cXY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nQNzO3KqxHXlDgyCuwPRIaF2cXY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/nQNzO3KqxHXlDgyCuwPRIaF2cXY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nQNzO3KqxHXlDgyCuwPRIaF2cXY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=UtUwk-u3WIA:Y1QiU-okq_A:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=UtUwk-u3WIA:Y1QiU-okq_A:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=UtUwk-u3WIA:Y1QiU-okq_A:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=UtUwk-u3WIA:Y1QiU-okq_A:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=UtUwk-u3WIA:Y1QiU-okq_A:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=UtUwk-u3WIA:Y1QiU-okq_A:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=UtUwk-u3WIA:Y1QiU-okq_A:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=UtUwk-u3WIA:Y1QiU-okq_A:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=UtUwk-u3WIA:Y1QiU-okq_A:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=UtUwk-u3WIA:Y1QiU-okq_A:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=UtUwk-u3WIA:Y1QiU-okq_A:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=UtUwk-u3WIA:Y1QiU-okq_A:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=UtUwk-u3WIA:Y1QiU-okq_A:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=UtUwk-u3WIA:Y1QiU-okq_A:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=UtUwk-u3WIA:Y1QiU-okq_A:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Techdiary/~4/UtUwk-u3WIA" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-06T20:34:42.976+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://techdiary-viki.blogspot.com/2010/10/frozen-bubble-on-n900.html</feedburner:origLink></item><item><title>how to re-organize menu icons on N900 (with catorise)</title><link>http://feedproxy.google.com/~r/Techdiary/~3/m73gaWNPk80/how-to-re-organize-menu-icons-on-n900.html</link><author>vikas.nv@gmail.com (Viki)</author><pubDate>Sun, 29 Aug 2010 09:23:06 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3366815763976900792.post-2703602096263238545</guid><description>You can get the icons in the menu of your N900 organized into folders using an application called catorise.&lt;br /&gt;This app automatically groups the menu icons and puts them into different folders of meaningful names.&lt;br /&gt;But sometimes you feel ... hey this icon should be in the games folder why is it put into the ovi folder??? I felt this when i saw bounce in ovi folder after installing catorise.&lt;br /&gt;And so i launched the xterm and started looking for some kind of a config file or something where i can change the grouping. Went into the /opt folder to check out the installed apps ... there was a folder catorise cd into it and ls ... there was something very obviously named file 'menu'. But i need to be root to edit this, became root and opened this file using vi. It is a simple config file with this syntax -&gt;&lt;br /&gt;app name: folder name&lt;br /&gt;I changed -&gt;&lt;br /&gt;bounce: ovi&lt;br /&gt;to this -&gt;&lt;br /&gt;bounce: games&lt;br /&gt;Saved it and closed it.&lt;br /&gt;Then ran the perl script named catorise in pwd.&lt;br /&gt;This changed the grouping, bounce appears in games than in ovi :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366815763976900792-2703602096263238545?l=techdiary-viki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/DV8phLPzCKkrhKetzxWsqj08HaA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DV8phLPzCKkrhKetzxWsqj08HaA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/DV8phLPzCKkrhKetzxWsqj08HaA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DV8phLPzCKkrhKetzxWsqj08HaA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=m73gaWNPk80:3Flj4HRNlo0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=m73gaWNPk80:3Flj4HRNlo0:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=m73gaWNPk80:3Flj4HRNlo0:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=m73gaWNPk80:3Flj4HRNlo0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=m73gaWNPk80:3Flj4HRNlo0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=m73gaWNPk80:3Flj4HRNlo0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=m73gaWNPk80:3Flj4HRNlo0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=m73gaWNPk80:3Flj4HRNlo0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=m73gaWNPk80:3Flj4HRNlo0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=m73gaWNPk80:3Flj4HRNlo0:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=m73gaWNPk80:3Flj4HRNlo0:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=m73gaWNPk80:3Flj4HRNlo0:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=m73gaWNPk80:3Flj4HRNlo0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=m73gaWNPk80:3Flj4HRNlo0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=m73gaWNPk80:3Flj4HRNlo0:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Techdiary/~4/m73gaWNPk80" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-29T21:53:06.621+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://techdiary-viki.blogspot.com/2010/08/how-to-re-organize-menu-icons-on-n900.html</feedburner:origLink></item><item><title>PCron ---- portable cron :)</title><link>http://feedproxy.google.com/~r/Techdiary/~3/Z36ODvVzFQA/pcron-portable-cron.html</link><category>scheduler</category><category>portable scheduler</category><category>cron for windows</category><category>portable cron</category><category>crontab</category><author>vikas.nv@gmail.com (Viki)</author><pubDate>Thu, 25 Mar 2010 05:02:17 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3366815763976900792.post-6324283119672364167</guid><description>PCron&lt;br /&gt;&lt;br /&gt;Cron for Windows &amp;amp; ... :)&lt;br /&gt;&lt;br /&gt;Cron is basically a job scheduler available in Linux and its variants/flavors.&lt;br /&gt;I have tried to implement the functionality of Cron in Python so that it can be used in Windows and ....&lt;br /&gt;&lt;br /&gt;You should have Python 2.5 + installed to use this.&lt;br /&gt;&lt;br /&gt;Input for PCron is a plain text file (lets' call it pcrontab) with syntax/format similar to *nix crontab. pcrontab can have formats such as -&gt; */12 and 12-20&lt;br /&gt;Here is an example of a pcrontab:&lt;br /&gt;*/5      *      *       *       *       F:\Program Files (x86)\K-Lite Codec Pack\Media Player Classic\mpc-hc.exe&lt;br /&gt;57-59        18        *        *        *         F:\Program Files (x86)\Calc.exe&lt;br /&gt;&lt;br /&gt;In above example, first line instructs PCron to start the program mpc-hc.exe every 5 minutes.&lt;br /&gt;And the second line instructs PCron to start the program Calc.exe on 18:57, 18:58, 18:59&lt;br /&gt;&lt;br /&gt;To understand more on the syntax of pcrontab ... look at the picture below which  explains about crontab -&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_NQ1Ssrf_DXw/S6ooY5NJb8I/AAAAAAAACb4/uq2vUyRDt3I/s1600/crontab-syntax.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 130px;" src="http://1.bp.blogspot.com/_NQ1Ssrf_DXw/S6ooY5NJb8I/AAAAAAAACb4/uq2vUyRDt3I/s320/crontab-syntax.gif" alt="" id="BLOGGER_PHOTO_ID_5452214707023343554" border="0" /&gt;&lt;/a&gt;Usage:&lt;br /&gt;python pcron.py --taskfile &lt;full&gt;&lt;br /&gt;Examples:&lt;br /&gt;    python pcron.py --taskfile c:\\pcrontab.txt&lt;br /&gt;    python pcron.py --taskfile /home/vikas/pcrontab&lt;br /&gt;Currently it writes out logs to stdout, so you have to redirect it ... to say /dev/null or a file&lt;br /&gt;&lt;br /&gt;Limitations:&lt;br /&gt;Each time you add an entry into the pcrontab, you have to restart the script or wait until the script reloads the pcrontab (it reloads in every 5 minutes ~)&lt;br /&gt;Does not support entire format/syntax combinations as compared to crontab&lt;br /&gt;&lt;br /&gt;More things to come:&lt;br /&gt;An editor for pcrontab ... that would detect changes in pcrontab and initiates automatic reload in pcron&lt;br /&gt;Support for a timeout field in pcrontab, which enables us to run a program for a certain period of time&lt;br /&gt;&lt;br /&gt;You can download the scripts from here:&lt;br /&gt;&lt;a href="http://docs.google.com/leaf?id=0B0-iayzVpwJ3OTk4NDI0MjAtZGQzNy00N2I3LWFlMGYtMGYxZDQ1NjNlYjdk&amp;amp;hl=en"&gt;TimedPopenNT&lt;/a&gt;&lt;br /&gt;&lt;a href="http://docs.google.com/leaf?id=0B0-iayzVpwJ3YjRkMDAyN2MtODE3Zi00MDg5LWJhNmItODVkYThlOWQ0Yjkx&amp;amp;hl=en"&gt;Scheduler&lt;/a&gt;&lt;br /&gt;&lt;a href="http://docs.google.com/leaf?id=0B0-iayzVpwJ3NTAyNzk2YWQtM2Q2My00YTIyLWIxZGQtMDQ5OTdmZjUwMDIy&amp;amp;hl=en"&gt;pcron&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;On Windows you can generate a .exe file using py2exe and use that as standalone instead of the script.&lt;/full&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366815763976900792-6324283119672364167?l=techdiary-viki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/IUsELrV9Jl6-oMIRyUe93TL12uA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IUsELrV9Jl6-oMIRyUe93TL12uA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/IUsELrV9Jl6-oMIRyUe93TL12uA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IUsELrV9Jl6-oMIRyUe93TL12uA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Z36ODvVzFQA:gE4kcLovG60:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Z36ODvVzFQA:gE4kcLovG60:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Z36ODvVzFQA:gE4kcLovG60:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Z36ODvVzFQA:gE4kcLovG60:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Z36ODvVzFQA:gE4kcLovG60:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=Z36ODvVzFQA:gE4kcLovG60:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Z36ODvVzFQA:gE4kcLovG60:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Z36ODvVzFQA:gE4kcLovG60:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=Z36ODvVzFQA:gE4kcLovG60:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Z36ODvVzFQA:gE4kcLovG60:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=Z36ODvVzFQA:gE4kcLovG60:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Z36ODvVzFQA:gE4kcLovG60:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Z36ODvVzFQA:gE4kcLovG60:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=Z36ODvVzFQA:gE4kcLovG60:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Z36ODvVzFQA:gE4kcLovG60:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Techdiary/~4/Z36ODvVzFQA" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-25T17:32:17.400+05:30</app:edited><media:thumbnail url="http://1.bp.blogspot.com/_NQ1Ssrf_DXw/S6ooY5NJb8I/AAAAAAAACb4/uq2vUyRDt3I/s72-c/crontab-syntax.gif" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://techdiary-viki.blogspot.com/2010/03/pcron-portable-cron.html</feedburner:origLink></item><item><title>Extract or Reap or Download Pictures from HTML Web Pages</title><link>http://feedproxy.google.com/~r/Techdiary/~3/Ak-B_aBVvRM/extract-or-reap-images-from-html-web.html</link><category>jpeg reaper</category><category>extract jpeg files</category><category>extract pictures webpage</category><category>download pictures</category><category>web reaper</category><category>picture reaper</category><author>vikas.nv@gmail.com (Viki)</author><pubDate>Thu, 13 Aug 2009 04:08:13 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3366815763976900792.post-6279973689533908368</guid><description>&lt;span style="font-family:verdana;"&gt;I was exploring python and the HTML parsers that it has. I hit a page that explained about the SGMLParser and its uses.&lt;br /&gt;&lt;br /&gt;Using this package I had written a simple script that could extract pictures from simple HTML pages. While experimenting it with many websites I noticed some websites did not allow my script to reap or extract pictures.&lt;br /&gt;&lt;br /&gt;Then I found that it is because of the User-Agent string in the HTTP request. Some websites do not respond properly to HTTP requests that have unknown User-Agent string. I then used the urllib's FancyURLOpener to change the User-Agent to Firefox.&lt;br /&gt;&lt;br /&gt;Now that the script work on most of the websites, i would like to post the code here. Feel free to modify to make it more robust and reliable, post a comment or a link to your modified script.&lt;br /&gt;&lt;br /&gt;This script search pictures from web pages and download them for you. All you need to do is&lt;br /&gt;get the URL of the web page from which you want the pictures to be downloaded and pass it as&lt;br /&gt;an argument to this script. Here is how to use it:&lt;br /&gt;    0. Note that python is installed on your system to run this script (Windows/Linux/Solaris ... OS independent;)&lt;br /&gt;    1. Download this script and save it as gal_ext.py&lt;br /&gt;    2. Open a command-prompt (if Windows) or Terminal (if you use any *nix OS)&lt;br /&gt;    3. Type "python gal_ext.py 'http://URL'&lt;br /&gt;    4. Here note that the 'http://' is mandatory&lt;br /&gt;Using this script you can avoid downloading images with a web browser, which takes a long time and is annoying to right click on every image and save them. This way you can download picture from web faster and easier. Since this is a script it is open for modifications and is free to use. But if you modify, make a note to send it to me ;). Thanks&lt;br /&gt;&lt;br /&gt;The code is here (&lt;a href="http://docs.google.com/View?id=dg2jxmfs_51dsk6x7gv"&gt;or a link for you to download&lt;/a&gt;):&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre name="code" class="Python"&gt;&lt;br /&gt;from sgmllib import SGMLParser&lt;br /&gt;import sys&lt;br /&gt;import os&lt;br /&gt;import re&lt;br /&gt;import urllib&lt;br /&gt;from urllib import FancyURLopener&lt;br /&gt;from urlparse import urlparse&lt;br /&gt;&lt;br /&gt;class URLLister(SGMLParser):&lt;br /&gt;def reset(self):&lt;br /&gt;SGMLParser.reset(self)&lt;br /&gt;self.urls = []&lt;br /&gt;&lt;br /&gt;def start_a(self, attrs):&lt;br /&gt;href = [v for k, v in attrs if k=='href']&lt;br /&gt;if href:&lt;br /&gt;self.urls.extend(href)&lt;br /&gt;&lt;br /&gt;class MyURLOpener(FancyURLopener):&lt;br /&gt;version = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6'&lt;br /&gt;&lt;br /&gt;def url_mapper(var):&lt;br /&gt;regexp = re.compile('.+?(http://.+&amp;amp;?)', re.I)&lt;br /&gt;values = urlparse(var)&lt;br /&gt;if len(values) &gt;= 5 and values[4] != '':&lt;br /&gt;obj = regexp.search(values[4])&lt;br /&gt;if obj:&lt;br /&gt;values = urlparse(obj.group(1))&lt;br /&gt;else:&lt;br /&gt;if values[4] != '': print('Could not get real url from:' + values[4])&lt;br /&gt;site = re.sub('[^0-9a-zA-Z_/]', '_', values[1])&lt;br /&gt;location_file = re.findall('(.+)/(.+)', values[2])&lt;br /&gt;try:&lt;br /&gt;if len(location_file[0]) != 2:&lt;br /&gt;return ''&lt;br /&gt;except IndexError:&lt;br /&gt;return ''&lt;br /&gt;location = location_file[0][0]&lt;br /&gt;file = location_file[0][1]&lt;br /&gt;location = re.sub('\.{2,}/', '/', location)&lt;br /&gt;location = re.sub('[^0-9a-zA-Z_/]', '_', location)&lt;br /&gt;location = location + '/' + file&lt;br /&gt;return site + location&lt;br /&gt;&lt;br /&gt;if __name__ == '__main__':&lt;br /&gt;url_opener = MyURLOpener()&lt;br /&gt;parser = URLLister()&lt;br /&gt;sys.argv[1] = urllib.unquote(sys.argv[1])&lt;br /&gt;try:&lt;br /&gt;usock = url_opener.open(sys.argv[1])&lt;br /&gt;except IOError:&lt;br /&gt;print 'skipping ' + sys.argv[1]&lt;br /&gt;sys.exit(0)&lt;br /&gt;parser.feed(usock.read())&lt;br /&gt;parser.close()&lt;br /&gt;usock.close()&lt;br /&gt;count = 0&lt;br /&gt;urlfs = urlparse(sys.argv[1])&lt;br /&gt;print "Url fs: ", urlfs&lt;br /&gt;parent = urlfs[1]&lt;br /&gt;try:&lt;br /&gt;parent += urlfs[2]&lt;br /&gt;parent = re.search('(.+)/.+',parent).group(1)&lt;br /&gt;except IndexError:&lt;br /&gt;parent = urlfs[1]&lt;br /&gt;for img_url in parser.urls:&lt;br /&gt;if re.search('\.jpe?g$', img_url):&lt;br /&gt;print "looking at: " + img_url&lt;br /&gt;if not re.match('^http://', img_url):&lt;br /&gt;img_url = 'http://' + parent + '/' + img_url&lt;br /&gt;loc = url_mapper(img_url)&lt;br /&gt;if os.path.exists(loc): continue&lt;br /&gt;url_opener1 = MyURLOpener()&lt;br /&gt;retrieve = url_opener1.retrieve&lt;br /&gt;if loc == '':&lt;br /&gt;print "\turl_mapper returned NULL for " + img_url&lt;br /&gt;continue&lt;br /&gt;loc_dir = re.match('(.+)/.+', loc).group(1)&lt;br /&gt;try:&lt;br /&gt;print('\ttrying to save ' + img_url)&lt;br /&gt;if not os.path.exists(loc_dir):&lt;br /&gt; os.makedirs(loc_dir)&lt;br /&gt;retrieve(img_url, loc)&lt;br /&gt;except IOError:&lt;br /&gt;print('\tSkipping saving ' + img_url)&lt;br /&gt;continue&lt;br /&gt;count += 1&lt;br /&gt;print "\tImg fetched: ",count&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366815763976900792-6279973689533908368?l=techdiary-viki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/iD3uFbqAaijJMvNn68pRV666sts/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iD3uFbqAaijJMvNn68pRV666sts/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/iD3uFbqAaijJMvNn68pRV666sts/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iD3uFbqAaijJMvNn68pRV666sts/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Ak-B_aBVvRM:uZzoWmtu5xA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Ak-B_aBVvRM:uZzoWmtu5xA:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Ak-B_aBVvRM:uZzoWmtu5xA:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Ak-B_aBVvRM:uZzoWmtu5xA:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Ak-B_aBVvRM:uZzoWmtu5xA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=Ak-B_aBVvRM:uZzoWmtu5xA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Ak-B_aBVvRM:uZzoWmtu5xA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Ak-B_aBVvRM:uZzoWmtu5xA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=Ak-B_aBVvRM:uZzoWmtu5xA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Ak-B_aBVvRM:uZzoWmtu5xA:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=Ak-B_aBVvRM:uZzoWmtu5xA:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Ak-B_aBVvRM:uZzoWmtu5xA:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Ak-B_aBVvRM:uZzoWmtu5xA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=Ak-B_aBVvRM:uZzoWmtu5xA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Ak-B_aBVvRM:uZzoWmtu5xA:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Techdiary/~4/Ak-B_aBVvRM" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-13T16:38:13.967+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total><feedburner:origLink>http://techdiary-viki.blogspot.com/2009/06/extract-or-reap-images-from-html-web.html</feedburner:origLink></item><item><title>Installing andLinux on Windows Vista</title><link>http://feedproxy.google.com/~r/Techdiary/~3/sVB1iXxSgzg/installing-andlinux-on-windows-vista.html</link><category>problem installing andlinux on Windows Vista</category><category>linux emulator on windows</category><category>andlinux cannot connect to</category><category>Linux on Windows Vista</category><category>andlinux</category><category>Linux on Vista</category><author>vikas.nv@gmail.com (Viki)</author><pubDate>Fri, 29 May 2009 08:28:37 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3366815763976900792.post-8028371167936487863</guid><description>After downloading the &lt;a href="http://downloads.sourceforge.net/andlinux/andlinux-beta2-kde.exe"&gt;andLinux installer (KDE version)&lt;/a&gt;, launch the installer as Administrator. And follow the steps with default options set.&lt;br /&gt;&lt;br /&gt;Reboot/Restart machine after installation.&lt;br /&gt;&lt;br /&gt;Click on Unblock if the Firewall prompts.&lt;br /&gt;&lt;br /&gt;After the reboot, you click on Konsole (any) launcher on KDE Menu from system tray, you are likely to get this error "&lt;em&gt;could not launch ... could not connect to&lt;/em&gt; 192.168.11.150"&lt;br /&gt;&lt;br /&gt;So this guide explains how to fix this issue, for the launchers to work on Windows Vista.&lt;br /&gt;&lt;br /&gt;First thing to do is to go to the "Network and Sharing Center" from Control Panel. You can see the "customize" and "view status" links on "Unidentified Network". Click on the "view status", click on properties and double click "Internet Protocol Version 4". That should open up a dialog where you can change the IP and the subnet mask, change the IP to 192.168.10.1 and subnet mask to 255.255.254.0. Click on OK OK ....&lt;br /&gt;&lt;br /&gt;Secondly, open the "andlinux Console" get sudo access and edit the file /etc/network/interfaces.&lt;br /&gt;After edit the file should have IP of 192.168.10.150 and the mask 255.255.254.0 under eth1&lt;br /&gt;&lt;br /&gt;Thirdly edit file /etc/profile to have IPs set to 192.168.10.150&lt;br /&gt;&lt;br /&gt;Fourthly navigate to the andlinux installation folder goto Xming folder edit X0.hosts and add the following IPs 192.168.10.150 and 192.168.10.1&lt;br /&gt;&lt;br /&gt;Lastly few registry changes, regedit and navigate to \\HKEY_LOCAL_MACHINE\\SOFTWARE\\andLinux\\Launcher&lt;br /&gt;Here you find to keys "IP" and "Port" set them to 192.168.10.150 and 2081 respectively.&lt;br /&gt;(Remember to click on Decimal while editing Port value) And close the regedit.&lt;br /&gt;&lt;br /&gt;Finally kill  KDE Menu, Xming. Restart andLinux service, and then start Xming and KDE Menu.&lt;br /&gt;Now the launchers work fine.&lt;br /&gt;&lt;br /&gt;If clicking on a launcher does not start, you open the andLinux Console application and execute:&lt;br /&gt;"/etc/init.d/networking restart". After this any launcher should work fine.&lt;br /&gt;&lt;br /&gt;!Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366815763976900792-8028371167936487863?l=techdiary-viki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/E4vbOTQPAEh_UHs2xZ8aKNERggk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/E4vbOTQPAEh_UHs2xZ8aKNERggk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/E4vbOTQPAEh_UHs2xZ8aKNERggk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/E4vbOTQPAEh_UHs2xZ8aKNERggk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=sVB1iXxSgzg:UQCVYst-gNg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=sVB1iXxSgzg:UQCVYst-gNg:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=sVB1iXxSgzg:UQCVYst-gNg:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=sVB1iXxSgzg:UQCVYst-gNg:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=sVB1iXxSgzg:UQCVYst-gNg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=sVB1iXxSgzg:UQCVYst-gNg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=sVB1iXxSgzg:UQCVYst-gNg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=sVB1iXxSgzg:UQCVYst-gNg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=sVB1iXxSgzg:UQCVYst-gNg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=sVB1iXxSgzg:UQCVYst-gNg:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=sVB1iXxSgzg:UQCVYst-gNg:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=sVB1iXxSgzg:UQCVYst-gNg:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=sVB1iXxSgzg:UQCVYst-gNg:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=sVB1iXxSgzg:UQCVYst-gNg:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=sVB1iXxSgzg:UQCVYst-gNg:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Techdiary/~4/sVB1iXxSgzg" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-29T20:58:37.824+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total><enclosure url="http://downloads.sourceforge.net/andlinux/andlinux-beta2-kde.exe" length="563097803" type="application/x-msdos-program" /><media:content url="http://downloads.sourceforge.net/andlinux/andlinux-beta2-kde.exe" fileSize="563097803" type="application/x-msdos-program" /><itunes:explicit>no</itunes:explicit><itunes:subtitle>After downloading the andLinux installer (KDE version), launch the installer as Administrator. And follow the steps with default options set. Reboot/Restart machine after installation. Click on Unblock if the Firewall prompts. After the reboot, you click </itunes:subtitle><itunes:author>Viki</itunes:author><itunes:summary>After downloading the andLinux installer (KDE version), launch the installer as Administrator. And follow the steps with default options set. Reboot/Restart machine after installation. Click on Unblock if the Firewall prompts. After the reboot, you click on Konsole (any) launcher on KDE Menu from system tray, you are likely to get this error "could not launch ... could not connect to 192.168.11.150" So this guide explains how to fix this issue, for the launchers to work on Windows Vista. First thing to do is to go to the "Network and Sharing Center" from Control Panel. You can see the "customize" and "view status" links on "Unidentified Network". Click on the "view status", click on properties and double click "Internet Protocol Version 4". That should open up a dialog where you can change the IP and the subnet mask, change the IP to 192.168.10.1 and subnet mask to 255.255.254.0. Click on OK OK .... Secondly, open the "andlinux Console" get sudo access and edit the file /etc/network/interfaces. After edit the file should have IP of 192.168.10.150 and the mask 255.255.254.0 under eth1 Thirdly edit file /etc/profile to have IPs set to 192.168.10.150 Fourthly navigate to the andlinux installation folder goto Xming folder edit X0.hosts and add the following IPs 192.168.10.150 and 192.168.10.1 Lastly few registry changes, regedit and navigate to \\HKEY_LOCAL_MACHINE\\SOFTWARE\\andLinux\\Launcher Here you find to keys "IP" and "Port" set them to 192.168.10.150 and 2081 respectively. (Remember to click on Decimal while editing Port value) And close the regedit. Finally kill KDE Menu, Xming. Restart andLinux service, and then start Xming and KDE Menu. Now the launchers work fine. If clicking on a launcher does not start, you open the andLinux Console application and execute: "/etc/init.d/networking restart". After this any launcher should work fine. !Enjoy!</itunes:summary><itunes:keywords>perl,scripting,shell,script</itunes:keywords><feedburner:origLink>http://techdiary-viki.blogspot.com/2009/05/installing-andlinux-on-windows-vista.html</feedburner:origLink></item><item><title>Parsing and Storing parts or paragraphs of log file</title><link>http://feedproxy.google.com/~r/Techdiary/~3/0H0c-xfIUv4/parsing-and-storing-parts-or-paragraphs.html</link><category>Perl Regular Expressions</category><category>regular expression perl Perl regex options</category><category>data extraction</category><category>parse file extract multiple lines</category><category>parsing logs</category><author>vikas.nv@gmail.com (Viki)</author><pubDate>Sat, 09 May 2009 07:12:07 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3366815763976900792.post-5271467873355319502</guid><description>At many times we need to parse and store parts of a log file. Suppose an error log, you would like to parse all errors. If the errors span only one line, you could use a grep.&lt;br /&gt;&lt;br /&gt;But if the errors span multiple lines ... you need to put a little logic into your script. There are many ways to do this, but this script that i post here is more readable and can be modified to other's requirement.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://docs.google.com/Doc?id=dg2jxmfs_49hjdfdvc9"&gt;Link to the code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://docs.google.com/Doc?id=dg2jxmfs_50gm9mghfj"&gt;Link to a sample input&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In the example script i am parsing an error log (named 'input.txt'). The script stores all lines that start with "SQL0204N" till it finds an empty line. Likewise it extracts all errors, even if the error messages span multiple lines.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366815763976900792-5271467873355319502?l=techdiary-viki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/jvPOuKqMgkV-2e-Cj9__H9s-_T0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jvPOuKqMgkV-2e-Cj9__H9s-_T0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/jvPOuKqMgkV-2e-Cj9__H9s-_T0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jvPOuKqMgkV-2e-Cj9__H9s-_T0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=0H0c-xfIUv4:P4pCScnCdKY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=0H0c-xfIUv4:P4pCScnCdKY:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=0H0c-xfIUv4:P4pCScnCdKY:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=0H0c-xfIUv4:P4pCScnCdKY:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=0H0c-xfIUv4:P4pCScnCdKY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=0H0c-xfIUv4:P4pCScnCdKY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=0H0c-xfIUv4:P4pCScnCdKY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=0H0c-xfIUv4:P4pCScnCdKY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=0H0c-xfIUv4:P4pCScnCdKY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=0H0c-xfIUv4:P4pCScnCdKY:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=0H0c-xfIUv4:P4pCScnCdKY:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=0H0c-xfIUv4:P4pCScnCdKY:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=0H0c-xfIUv4:P4pCScnCdKY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=0H0c-xfIUv4:P4pCScnCdKY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=0H0c-xfIUv4:P4pCScnCdKY:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Techdiary/~4/0H0c-xfIUv4" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-09T19:42:07.625+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://techdiary-viki.blogspot.com/2009/05/parsing-and-storing-parts-or-paragraphs.html</feedburner:origLink></item><item><title>Perl script inside a DOS Batch file</title><link>http://feedproxy.google.com/~r/Techdiary/~3/myMKxf_uKeI/perl-script-inside-dos-batch-file.html</link><author>vikas.nv@gmail.com (Viki)</author><pubDate>Wed, 01 Apr 2009 03:46:03 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3366815763976900792.post-2367434498340904148</guid><description>Whenever I wanted to invoke a utility passing a file as an argument I used to create a shortcut of the utility in the Send To folder, as described here :&lt;br /&gt;&lt;h1 class="title"&gt;&lt;a href="http://support.microsoft.com/kb/310270"&gt;&lt;span style="font-size:100%;"&gt;How to Add Items to the "Send To" Menu&lt;/span&gt;&lt;/a&gt;&lt;/h1&gt;But how to have a Perl script in the "Send To" menu??&lt;br /&gt;&lt;br /&gt;I got an idea when browsing through this page :&lt;br /&gt;&lt;h1&gt;&lt;a href="http://www.dostips.com/DtCodeInterfacing.php"&gt;&lt;span style="font-size:100%;"&gt;DOS Batch - Interfacing non DOS Software&lt;/span&gt;&lt;/a&gt;&lt;/h1&gt;I created a batch script as described in the page. Then modified the part of the batch file where the Perl script actually starts.&lt;br /&gt;&lt;br /&gt;I wanted to have a utility that can encrypt/decrypt a text file. A basic encryption was sufficient, so considered the &lt;span style="font-weight: bold;"&gt;Caesar cipher.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;I completed the script and added it to the Send To menu&lt;span style="font-weight: bold;"&gt;.&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;a style="font-family: georgia;" href="http://docs.google.com/Doc?id=dg2jxmfs_46frvwj43t"&gt;Link to the script&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: georgia;"&gt;&lt;span&gt;A small modification to the above script to handle binary files. &lt;a href="http://docs.google.com/Doc?id=dg2jxmfs_47gchnbgfc"&gt;Here is the link.&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366815763976900792-2367434498340904148?l=techdiary-viki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/P3-rc18T7FU5IaH0ggCoHRtLOMQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/P3-rc18T7FU5IaH0ggCoHRtLOMQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/P3-rc18T7FU5IaH0ggCoHRtLOMQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/P3-rc18T7FU5IaH0ggCoHRtLOMQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=myMKxf_uKeI:3G1RPRhN93c:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=myMKxf_uKeI:3G1RPRhN93c:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=myMKxf_uKeI:3G1RPRhN93c:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=myMKxf_uKeI:3G1RPRhN93c:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=myMKxf_uKeI:3G1RPRhN93c:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=myMKxf_uKeI:3G1RPRhN93c:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=myMKxf_uKeI:3G1RPRhN93c:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=myMKxf_uKeI:3G1RPRhN93c:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=myMKxf_uKeI:3G1RPRhN93c:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=myMKxf_uKeI:3G1RPRhN93c:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=myMKxf_uKeI:3G1RPRhN93c:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=myMKxf_uKeI:3G1RPRhN93c:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=myMKxf_uKeI:3G1RPRhN93c:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=myMKxf_uKeI:3G1RPRhN93c:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=myMKxf_uKeI:3G1RPRhN93c:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Techdiary/~4/myMKxf_uKeI" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-01T16:16:03.371+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://techdiary-viki.blogspot.com/2009/04/perl-script-inside-dos-batch-file.html</feedburner:origLink></item><item><title>andLinux   ---    Run Linux from Windows</title><link>http://feedproxy.google.com/~r/Techdiary/~3/SG-ZkXKvILA/andlinux-run-linux-from-windows.html</link><category>linux from windows</category><category>emulated PC software</category><category>use windows and linux parallely</category><category>emulated Linux</category><category>parallel OS</category><author>vikas.nv@gmail.com (Viki)</author><pubDate>Sat, 13 Dec 2008 09:28:55 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3366815763976900792.post-5498531799646678577</guid><description>Have you ever had a feeling of using Linux when you are working on Windows???&lt;div&gt;Or&lt;/div&gt;&lt;div&gt;Felt like using those very useful Linux commands fromWindows???&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is possible ...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Everybody knows that you can have a Dual-Boot on your PC with Linux &amp;amp; Windows. In which you have to restart the PC to access the other OS. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But there are several other ways to have Other OS run right from Windows, that is for example use Linux when you have logged on to Windows... Yes... Virtual Machines (also popular as VM) is one of them. But running a VM requires that your hardware to be really good.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There is one more option, we now have emulated PC software like &lt;a href="http://www.andlinux.org/"&gt;andLinux&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There are many other softwares other than andLinux, such as CygwinX, MKS Toolkit, etc&lt;/div&gt;&lt;div&gt;But I found andLinux to be really very handy, straight-forward &amp;amp; useful.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Installing andLinux is as simple as installing other software ... clikcing Next, Next, Next ... &amp;amp; finnaly Finish :) there is a very &lt;a href="http://www.andlinux.org/install.php"&gt;elaborate tutorial&lt;/a&gt; on its web site&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However if you are the curious cat... you can also fiddle around &amp;amp; do the installation without the tutorial.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The home page of andLinux says &lt;span class="Apple-style-span" style="font-style: italic;"&gt;"a&lt;/span&gt;&lt;span class="Apple-style-span"  style=" ;font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;ndLinux is not just for development and runs almost all Linux applications without modification&lt;/span&gt;&lt;span class="Apple-style-span"  style=" ;font-family:Georgia;"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;". &lt;/span&gt;I have installed a lot many applications to andLinux, and its really true.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;After installation you can see the icons of andLinux in system tray. You may see these icons :&lt;/div&gt;&lt;div&gt;KDE menu (andLinux)&lt;/div&gt;&lt;div&gt;Xming (andLinux)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;While installing say you choose E: drive as destination. It gets installled in a folder E:\andLinux.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It will create some folders &amp;amp; files in E:\andLinux, I will list some folders &amp;amp; files with thier &lt;span class="Apple-style-span"  style="font-size:medium;"&gt;purposes:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;1. settings.txt, a plain-text file that will have some paths necessary for andLinux to work properly&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;2. srvstart.bat, batch file, that has the command to start the andLinux service&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;3. srvstop.bat, batch file, has the command to stop andLinux service&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;4. startup.bat, again a batch file used to start the andLinux as deamon&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;5. Drives, directory, where the andLinux's filesystem is stored as files (base.drv, mine is 4GB in size and swap.drv)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;6. Launcher, directory, where all the executables can be seen. A good place to check out what all linux apps you get after installing andLinux.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;7. There are other directories as well, netdriver, pulseaudio &amp;amp; Xming&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;One application that is very usefull after installing andLinux is the &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;synaptic.&lt;/span&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt; It is the application manager of andLinux. You can find this from KDE Menu / open a terminal &amp;amp; type &lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;synaptic.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There is a huge collection of linux applications that you can select &amp;amp; install. As i feel the GUI is staright-forward &amp;amp; easy to understand, compared to CygwinX. It is more responsive on my machine with 512 MB of RAM &amp;amp; Dual Core Intel.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It is still in Beta, you can go to the &lt;a href="http://www.andlinux.org/downloads.php"&gt;andLinux&lt;/a&gt; website to download it. There is a &lt;a href="http://linuxtracker.org/index.php?page=torrents&amp;amp;category=466"&gt;torrent tracker&lt;/a&gt; also.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;EnJoy ...&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366815763976900792-5498531799646678577?l=techdiary-viki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/YBZoHBlFPhjF9TX44pOZxntwP-E/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YBZoHBlFPhjF9TX44pOZxntwP-E/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/YBZoHBlFPhjF9TX44pOZxntwP-E/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YBZoHBlFPhjF9TX44pOZxntwP-E/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=SG-ZkXKvILA:Zzq8k5aWkOM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=SG-ZkXKvILA:Zzq8k5aWkOM:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=SG-ZkXKvILA:Zzq8k5aWkOM:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=SG-ZkXKvILA:Zzq8k5aWkOM:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=SG-ZkXKvILA:Zzq8k5aWkOM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=SG-ZkXKvILA:Zzq8k5aWkOM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=SG-ZkXKvILA:Zzq8k5aWkOM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=SG-ZkXKvILA:Zzq8k5aWkOM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=SG-ZkXKvILA:Zzq8k5aWkOM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=SG-ZkXKvILA:Zzq8k5aWkOM:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=SG-ZkXKvILA:Zzq8k5aWkOM:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=SG-ZkXKvILA:Zzq8k5aWkOM:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=SG-ZkXKvILA:Zzq8k5aWkOM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=SG-ZkXKvILA:Zzq8k5aWkOM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=SG-ZkXKvILA:Zzq8k5aWkOM:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Techdiary/~4/SG-ZkXKvILA" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-12-13T22:58:55.227+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://techdiary-viki.blogspot.com/2008/12/andlinux-run-linux-from-windows.html</feedburner:origLink></item><item><title>Script to comment parts of code in a source file</title><link>http://feedproxy.google.com/~r/Techdiary/~3/3ktrGqUqVCY/script-to-comment-parts-of-code-in.html</link><category>comment source code</category><category>comment other scripts</category><category>commenting script</category><category>script to comment source files</category><author>vikas.nv@gmail.com (Viki)</author><pubDate>Sat, 13 Dec 2008 08:41:50 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3366815763976900792.post-109124640280445146</guid><description>&lt;div&gt;A friend of mine wanted a script to comment parts of code in a source file. We were chatting &amp;amp; i gave him this solution:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; "&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;me: perl --i.bak -pe 's/^(.*)$/#$1/gi if ($. &gt;=start_line_number &amp;amp;&amp;amp; $. &lt;= end_line_number)' filename&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; "&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Try above command in terminal. Where start_line_number is the line number where u shud start commenting &amp;amp; end_line_number is where u want to stop commenting.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But he wanted that the script should take a function name as input rather than line numbers ... this is what he says: (name not published ;))&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;myfrend: hey vikas, i need a script to start commenting the codes without using line numbers, but using function name....is it possible?&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" ;font-size:13px;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;me: u mean to say u have function names ... &amp;amp; u want to comment the whole functions?&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;u mean to say u have function names ... &amp;amp; u want to comment the whole functions?&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;myfrend: yeah&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;s&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" ;font-size:13px;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;me: it is possible ... if u can get correct start&amp;amp;end boundaries for the functions&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" ;font-size:13px;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;myfrend: yeah..how to get it....its difficult&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" ;font-size:13px;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;me: how big can the file be .. that is MAX big file size?&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" ;font-size:13px;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;myfrend: say around 3000 lines&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I was asking a lot of questions about the source files like do they follow coding standards, etc .. &amp;amp; all that. So he suggested what he wanted to do ... i mean the logic ... he said:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;myfrend: my logic is : search for function name, then keep a counter to increment/decrement when { or } is found, when counter is zero, exit the prgm&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;me: this is holds good ... but u have to account for { } occuring on same line ... &amp;amp; account for comments, etc&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;myfrend: ok&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Got some free time to think about it ... &amp;amp; wrote a script for this. This may not be a complete solution, but a good starting point i guess.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here is the link to the script:&lt;/div&gt;&lt;div&gt;&lt;a id="publishedDocumentUrl" class="tabcontent" target="_blank" href="http://docs.google.com/Doc?id=dg2jxmfs_43gbtd2jfq"&gt;http://docs.google.com/Doc?id=dg2jxmfs_43gbtd2jfq&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;PS - myfrend :&lt;div&gt;If you permit I can publish your name ... with a hyperlink possibly to your blog ;)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366815763976900792-109124640280445146?l=techdiary-viki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/XvcQ3Or7-X9sc9t8UcUIiBGF6Mk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XvcQ3Or7-X9sc9t8UcUIiBGF6Mk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/XvcQ3Or7-X9sc9t8UcUIiBGF6Mk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XvcQ3Or7-X9sc9t8UcUIiBGF6Mk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=3ktrGqUqVCY:D2_EL165MqU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=3ktrGqUqVCY:D2_EL165MqU:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=3ktrGqUqVCY:D2_EL165MqU:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=3ktrGqUqVCY:D2_EL165MqU:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=3ktrGqUqVCY:D2_EL165MqU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=3ktrGqUqVCY:D2_EL165MqU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=3ktrGqUqVCY:D2_EL165MqU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=3ktrGqUqVCY:D2_EL165MqU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=3ktrGqUqVCY:D2_EL165MqU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=3ktrGqUqVCY:D2_EL165MqU:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=3ktrGqUqVCY:D2_EL165MqU:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=3ktrGqUqVCY:D2_EL165MqU:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=3ktrGqUqVCY:D2_EL165MqU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=3ktrGqUqVCY:D2_EL165MqU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=3ktrGqUqVCY:D2_EL165MqU:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Techdiary/~4/3ktrGqUqVCY" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-12-13T22:11:50.828+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://techdiary-viki.blogspot.com/2008/12/script-to-comment-parts-of-code-in.html</feedburner:origLink></item><item><title>Get Spiritual ...</title><link>http://feedproxy.google.com/~r/Techdiary/~3/jlkC__CrTZA/get-spiritual.html</link><category>temples</category><category>photo gallaries</category><category>vatsa</category><category>srivatsa shroff's photo galleries</category><author>vikas.nv@gmail.com (Viki)</author><pubDate>Thu, 21 Aug 2008 04:41:45 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3366815763976900792.post-2113603536724058090</guid><description>Get spiritual ...&lt;br /&gt;&lt;br /&gt;Take a look at the photo galleries shared by my good friend in his blog.&lt;br /&gt;&lt;br /&gt;http://srivatsashroff.blogspot.com&lt;br /&gt;&lt;br /&gt;Notice lot of temples in the galleries, that is all with getting spiritual :)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PS: Obviously, this is post has nothing to do with Perl | ;) |&lt;br /&gt;Viki&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366815763976900792-2113603536724058090?l=techdiary-viki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/6OocFv70bRAspcck1xKXC78n0VI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6OocFv70bRAspcck1xKXC78n0VI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/6OocFv70bRAspcck1xKXC78n0VI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6OocFv70bRAspcck1xKXC78n0VI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=jlkC__CrTZA:xqw1ohoSatY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=jlkC__CrTZA:xqw1ohoSatY:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=jlkC__CrTZA:xqw1ohoSatY:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=jlkC__CrTZA:xqw1ohoSatY:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=jlkC__CrTZA:xqw1ohoSatY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=jlkC__CrTZA:xqw1ohoSatY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=jlkC__CrTZA:xqw1ohoSatY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=jlkC__CrTZA:xqw1ohoSatY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=jlkC__CrTZA:xqw1ohoSatY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=jlkC__CrTZA:xqw1ohoSatY:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=jlkC__CrTZA:xqw1ohoSatY:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=jlkC__CrTZA:xqw1ohoSatY:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=jlkC__CrTZA:xqw1ohoSatY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=jlkC__CrTZA:xqw1ohoSatY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=jlkC__CrTZA:xqw1ohoSatY:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Techdiary/~4/jlkC__CrTZA" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-21T17:11:45.842+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://techdiary-viki.blogspot.com/2008/08/get-spiritual.html</feedburner:origLink></item><item><title>Example for use of grep(), map() and readdir()</title><link>http://feedproxy.google.com/~r/Techdiary/~3/nykuYk3P7Rk/example-for-use-of-grep-map-and-readdir.html</link><category>example for reading directory contents using readdir() in Perl</category><category>example for Perl map</category><category>use of Perl readdir()</category><category>example for Perl grep</category><category>reading directory contents</category><category>use of Perl map {}</category><category>use of Perl grep {}</category><author>vikas.nv@gmail.com (Viki)</author><pubDate>Tue, 28 Oct 2008 07:49:38 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3366815763976900792.post-6956100978769031771</guid><description>You should have used readdir() to read contents of a directory. For that you have to open a directory as in:&lt;br /&gt;&lt;br /&gt;opendir(DIR, "$directory_path");&lt;br /&gt;&lt;br /&gt;After which readdir(DIR) returns an entry or all directory entries depending on the context.&lt;br /&gt;&lt;br /&gt;my $file = readdir(DIR); # returns only single entry&lt;br /&gt;my @files = readdir(DIR); # returns all the directory entries&lt;br /&gt;&lt;br /&gt;But the values returned will not have the absolute path. For this reason, I use map to prefix the path for each entry ...&lt;br /&gt;&lt;br /&gt;my @files = map { "$directory_path/$_" } readdir(DIR);&lt;br /&gt;&lt;br /&gt;Now using the code given above all directory entries will have absolute paths.&lt;br /&gt;&lt;br /&gt;If you want to grep for a pattern &amp;amp; collect only those entries that match a pattern use grep {}, like this:&lt;br /&gt;&lt;br /&gt;my @files = grep { /pattern/ } map { "$directory_path/$_" } readdir(DIR);&lt;br /&gt;&lt;br /&gt;In the above example, using grep {} before or after map {} makes a difference.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366815763976900792-6956100978769031771?l=techdiary-viki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/kxwkvPp4ANcWdxIEZgGDB1XIOsU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/kxwkvPp4ANcWdxIEZgGDB1XIOsU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/kxwkvPp4ANcWdxIEZgGDB1XIOsU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/kxwkvPp4ANcWdxIEZgGDB1XIOsU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=nykuYk3P7Rk:Gs1ukkmUEJU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=nykuYk3P7Rk:Gs1ukkmUEJU:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=nykuYk3P7Rk:Gs1ukkmUEJU:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=nykuYk3P7Rk:Gs1ukkmUEJU:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=nykuYk3P7Rk:Gs1ukkmUEJU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=nykuYk3P7Rk:Gs1ukkmUEJU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=nykuYk3P7Rk:Gs1ukkmUEJU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=nykuYk3P7Rk:Gs1ukkmUEJU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=nykuYk3P7Rk:Gs1ukkmUEJU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=nykuYk3P7Rk:Gs1ukkmUEJU:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=nykuYk3P7Rk:Gs1ukkmUEJU:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=nykuYk3P7Rk:Gs1ukkmUEJU:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=nykuYk3P7Rk:Gs1ukkmUEJU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=nykuYk3P7Rk:Gs1ukkmUEJU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=nykuYk3P7Rk:Gs1ukkmUEJU:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Techdiary/~4/nykuYk3P7Rk" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-28T20:19:38.415+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://techdiary-viki.blogspot.com/2008/08/example-for-use-of-grep-map-and-readdir.html</feedburner:origLink></item><item><title>Sockets ... not the electrical ones ;)</title><link>http://feedproxy.google.com/~r/Techdiary/~3/viyDN8HEReI/sockets-not-electrical-ones.html</link><author>vikas.nv@gmail.com (Viki)</author><pubDate>Sat, 16 Aug 2008 07:56:38 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3366815763976900792.post-8272658834988387078</guid><description>&lt;span style="font-family:verdana;"&gt;This is my first script that used Sockets. Written around 2 years back, when I was still learning the various uses of Perl. Was very excited to see this work ... Check out the files :&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;The server script:&lt;/span&gt;&lt;br /&gt;&lt;a href="http://docs.google.com/Doc?id=dg2jxmfs_42hcxtq3fv"&gt;&lt;span style="font-family:verdana;"&gt;http://docs.google.com/Doc?id=dg2jxmfs_42hcxtq3fv&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;THe client script:&lt;/span&gt;&lt;br /&gt;&lt;a href="http://docs.google.com/Doc?id=dg2jxmfs_41cvcnk6d5"&gt;&lt;span style="font-family:verdana;"&gt;http://docs.google.com/Doc?id=dg2jxmfs_41cvcnk6d5&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Comments, questions ... welcome !&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366815763976900792-8272658834988387078?l=techdiary-viki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/oNRKDpK5lGsNiQTQ4I_Fy2ZG74U/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oNRKDpK5lGsNiQTQ4I_Fy2ZG74U/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/oNRKDpK5lGsNiQTQ4I_Fy2ZG74U/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oNRKDpK5lGsNiQTQ4I_Fy2ZG74U/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=viyDN8HEReI:Bs6uvUpuHvY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=viyDN8HEReI:Bs6uvUpuHvY:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=viyDN8HEReI:Bs6uvUpuHvY:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=viyDN8HEReI:Bs6uvUpuHvY:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=viyDN8HEReI:Bs6uvUpuHvY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=viyDN8HEReI:Bs6uvUpuHvY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=viyDN8HEReI:Bs6uvUpuHvY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=viyDN8HEReI:Bs6uvUpuHvY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=viyDN8HEReI:Bs6uvUpuHvY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=viyDN8HEReI:Bs6uvUpuHvY:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=viyDN8HEReI:Bs6uvUpuHvY:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=viyDN8HEReI:Bs6uvUpuHvY:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=viyDN8HEReI:Bs6uvUpuHvY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=viyDN8HEReI:Bs6uvUpuHvY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=viyDN8HEReI:Bs6uvUpuHvY:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Techdiary/~4/viyDN8HEReI" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-16T20:26:38.860+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://techdiary-viki.blogspot.com/2008/08/sockets-not-electrical-ones.html</feedburner:origLink></item><item><title>When data stored becomes very large ...</title><link>http://feedproxy.google.com/~r/Techdiary/~3/bJpGcuhLz_A/when-data-stored-becomes-very-large.html</link><category>very large memory used to store data in variables data structures</category><author>vikas.nv@gmail.com (Viki)</author><pubDate>Tue, 05 Aug 2008 07:51:11 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3366815763976900792.post-5392499358568093079</guid><description>&lt;span style="font-family: verdana;"&gt;There will be situations at which the data you store in memory (variables) is huge, &amp;amp; the script cribbs &amp;amp; might throw "Out of memory" error (happens if the available memory is very low) &amp;amp; exit.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;This had happened to me when extracting large amount of data &amp;amp; storing it into a data structure. The actual reason for this was not the data structure itself, but because of an array in which I used to read the entire files' contents (~35MB/file). The issue was solved once I started reading the file line-by-line.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;That was just a part of the topic I wanted to write here... Actually, in the process of lowering the memory usage I had used some new (at least, its new for me)  techniques of storing numerical data &amp;amp; that's what I want to write here.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;This is the data structure that I had used:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: verdana; font-style: italic;"&gt;%hash =  {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: verdana; font-style: italic;"&gt;                          "key1"  =&gt;   {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: verdana; font-style: italic;"&gt;                                                        "kkey1"  =&gt;   "vvalue1"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: verdana; font-style: italic;"&gt;                                                          ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: verdana; font-style: italic;"&gt;                                                },&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: verdana; font-style: italic;"&gt;                           ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: verdana; font-style: italic;"&gt;};&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;So that's the pictorial of my data structure. In this I had to store some numbers that had to be paired (there was a relationship b/w them) &amp;amp; also for these numbers I had to calculate the average &amp;amp; median. The number-pairs found to be larger than 999, so I had to use a glue character b/w then number-pair &amp;amp; store as "kkey1" &amp;amp; store the number of occurrences as the "vvalue1".&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;Since it was average &amp;amp; median to be calculated... I wrote these two neat subroutines:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;sub get_average {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;    my (%input_cnt) = @_;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;    my $count = 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;    my $sum = 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;    foreach my $input (keys %input_cnt) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;        $sum += ($input*$input_cnt{$input});&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;    foreach my $cnt (values %input_cnt) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;        $count += $cnt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;    my $average = $sum/$count;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;    return $average;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;sub get_median {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;    my (%inputs_cnt) = @_;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;    my @sorted = sort { $a &lt;=&gt; $b } keys %inputs_cnt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;    my %sorted_vals_index = ();        #    sorted_vals_index{delay}  =&gt;  'low_index:high_index'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;    my $index = 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;    foreach my $ele (@sorted) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;        my $h_i = $index + ($inputs_cnt{$ele}-1);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;        $sorted_vals_index{$ele} = "$index:$h_i";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;        $index = $h_i+1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;    my $mid_index = ($index-1)/2;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;    foreach my $ele (keys %sorted_vals_index) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;        my ($l_i, $h_i) = ($sorted_vals_index{$ele} =~ /(.+?):(.+)/);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;        if (($mid_index &gt;= $l_i) &amp;amp;&amp;amp; ($mid_index &lt;= $h_i)) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;            return $ele;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: verdana;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;Each subroutine takes a hash, where the key is the number &amp;amp; value is the number of occurrences.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;So the memory used became very less, since I avoided storing duplicate number-pairs.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366815763976900792-5392499358568093079?l=techdiary-viki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1o2MdX-Fl-jFg73dKCFFDI6bCKM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1o2MdX-Fl-jFg73dKCFFDI6bCKM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1o2MdX-Fl-jFg73dKCFFDI6bCKM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1o2MdX-Fl-jFg73dKCFFDI6bCKM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=bJpGcuhLz_A:jScuirHGIKU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=bJpGcuhLz_A:jScuirHGIKU:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=bJpGcuhLz_A:jScuirHGIKU:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=bJpGcuhLz_A:jScuirHGIKU:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=bJpGcuhLz_A:jScuirHGIKU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=bJpGcuhLz_A:jScuirHGIKU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=bJpGcuhLz_A:jScuirHGIKU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=bJpGcuhLz_A:jScuirHGIKU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=bJpGcuhLz_A:jScuirHGIKU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=bJpGcuhLz_A:jScuirHGIKU:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=bJpGcuhLz_A:jScuirHGIKU:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=bJpGcuhLz_A:jScuirHGIKU:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=bJpGcuhLz_A:jScuirHGIKU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=bJpGcuhLz_A:jScuirHGIKU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=bJpGcuhLz_A:jScuirHGIKU:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Techdiary/~4/bJpGcuhLz_A" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-05T20:21:11.036+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://techdiary-viki.blogspot.com/2008/08/when-data-stored-becomes-very-large.html</feedburner:origLink></item><item><title>Regular Expressions (more)</title><link>http://feedproxy.google.com/~r/Techdiary/~3/1uIc8Dm-Zrw/regular-expressions-more.html</link><category>regular expression perl Perl regex options</category><author>vikas.nv@gmail.com (Viki)</author><pubDate>Mon, 11 Aug 2008 01:52:03 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3366815763976900792.post-1947803384348689297</guid><description>&lt;span style="font-family:verdana;"&gt;There are many more options that can be used with PERL regular expressions.&lt;br /&gt;&lt;br /&gt;The different options that I have used are: g,i,s,m,o,x&lt;br /&gt;These options are to be specified like this:&lt;br /&gt;/reg-exp/options&lt;br /&gt;One or more options can be used, but one cant' use s &amp;amp; m simultaneously.&lt;br /&gt;&lt;br /&gt;So here are the meanings of these regular expressions ...&lt;br /&gt;&lt;br /&gt;g -&gt; Match Globally:&lt;br /&gt;This option can be used when you are trying to match a pattern in the whole string. As in this example :&lt;br /&gt;&lt;span style="font-style: italic;"&gt;$you_appeared++ while(/\s+you\s+/g);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;i -&gt; Ignore Case:&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;Use this when case of the pattern does not matter.&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;s -&gt; Treat Workspace As Single Line&lt;span style="font-style: italic;"&gt;:&lt;br /&gt;&lt;/span&gt;This option is used when you need to match "\n" with reg-exp special character '.'&lt;span style="font-style: italic;"&gt;. &lt;/span&gt;Or put simpl&lt;span style="font-style: italic;"&gt;e&lt;/span&gt;, you this option when the work space has "\n"'s and you want to match something considering "\n".&lt;span style="font-style: italic;"&gt;&lt;br /&gt;my $workspace = "I'am sure you are confused\nYou have to use it to understand it\n";&lt;br /&gt;if ($workspace =~ /use/s) {&lt;br /&gt;print "$&amp;amp;$'\n";&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:verdana;"&gt;&lt;span&gt;m -&gt; Treat workspace as multiple lines. This option differs from above, here '.' does not match a "\n" however, treats workspace as multiple lines.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana;"&gt;&lt;span&gt;o -&gt; compile the pattern once. The effect this produces is visible when you use a variable. Since the pattern is compiled only once, the variable will be replaced only once in the pattern - no matter how many times the pattern is used.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Verdana;"&gt;x -&gt; add comments inside the regexp, using '#'&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:Verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366815763976900792-1947803384348689297?l=techdiary-viki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BnG3qPGouEnoOEjjixfQpEiZsEw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BnG3qPGouEnoOEjjixfQpEiZsEw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BnG3qPGouEnoOEjjixfQpEiZsEw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BnG3qPGouEnoOEjjixfQpEiZsEw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=1uIc8Dm-Zrw:6ExOZQ9lRAo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=1uIc8Dm-Zrw:6ExOZQ9lRAo:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=1uIc8Dm-Zrw:6ExOZQ9lRAo:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=1uIc8Dm-Zrw:6ExOZQ9lRAo:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=1uIc8Dm-Zrw:6ExOZQ9lRAo:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=1uIc8Dm-Zrw:6ExOZQ9lRAo:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=1uIc8Dm-Zrw:6ExOZQ9lRAo:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=1uIc8Dm-Zrw:6ExOZQ9lRAo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=1uIc8Dm-Zrw:6ExOZQ9lRAo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=1uIc8Dm-Zrw:6ExOZQ9lRAo:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=1uIc8Dm-Zrw:6ExOZQ9lRAo:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=1uIc8Dm-Zrw:6ExOZQ9lRAo:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=1uIc8Dm-Zrw:6ExOZQ9lRAo:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=1uIc8Dm-Zrw:6ExOZQ9lRAo:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=1uIc8Dm-Zrw:6ExOZQ9lRAo:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Techdiary/~4/1uIc8Dm-Zrw" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-11T14:22:03.607+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://techdiary-viki.blogspot.com/2008/07/regular-expressions-more.html</feedburner:origLink></item><item><title>Reading ... Processing file paragraph by paragraph</title><link>http://feedproxy.google.com/~r/Techdiary/~3/cJDbVMrr47o/reading-file-paragraph-by-paragraph.html</link><category>perl read files in paragraph mode</category><category>paragraph by paragraph</category><author>vikas.nv@gmail.com (Viki)</author><pubDate>Sat, 09 May 2009 06:27:02 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3366815763976900792.post-5337814817276573831</guid><description>&lt;span style="font-family:verdana;"&gt;There are many situations you may want to process a text file paragraph by paragraph ...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;One such example was this, I wanted to delete those paragraphs from a text file that had a particular pattern. Like, delete all paragraphs that has text like 'copyright protected by blah blah'.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;First thing is to learn how to read a text file paragraph by paragraph, for that we will see how to open a file (named web_extract.txt):&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;open (FILE, "web_extract.txt") or die "Unable to open web_extract.txt: $!\n";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;This is how you can read the opened file line by line:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;while(my $line = &amp;lt;FILE&amp;gt; ) {&lt;br /&gt;             .... do something ...&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;But to read a file in paragraph mode, you have to reset (zero) the special variable $/, look at the code below:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;{&lt;br /&gt;       local $/ = &amp;#39;&amp;#39;;&lt;br /&gt;       @paragraphs = &amp;lt;FILE&amp;gt;;&lt;br /&gt;       chomp @paragraphs;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;So this will read the opened file in paragraph mode.&lt;/span&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;Don't worry about the block, it is used to localize resetting the $/ variable&lt;/span&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Now the variable @paragraphs has paragraphs as its elements. So you can loop around this variable and push the elements (to @filtered_paragraphs) that do not match your pattern. Then print that new array (@filtered_paragraphs) to the (same/another) file.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Done!!!&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366815763976900792-5337814817276573831?l=techdiary-viki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/pWHHlasC3xxdUVyFI23YKl_Lugo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pWHHlasC3xxdUVyFI23YKl_Lugo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/pWHHlasC3xxdUVyFI23YKl_Lugo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pWHHlasC3xxdUVyFI23YKl_Lugo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=cJDbVMrr47o:e0cHWCXHq_w:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=cJDbVMrr47o:e0cHWCXHq_w:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=cJDbVMrr47o:e0cHWCXHq_w:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=cJDbVMrr47o:e0cHWCXHq_w:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=cJDbVMrr47o:e0cHWCXHq_w:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=cJDbVMrr47o:e0cHWCXHq_w:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=cJDbVMrr47o:e0cHWCXHq_w:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=cJDbVMrr47o:e0cHWCXHq_w:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=cJDbVMrr47o:e0cHWCXHq_w:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=cJDbVMrr47o:e0cHWCXHq_w:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=cJDbVMrr47o:e0cHWCXHq_w:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=cJDbVMrr47o:e0cHWCXHq_w:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=cJDbVMrr47o:e0cHWCXHq_w:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=cJDbVMrr47o:e0cHWCXHq_w:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=cJDbVMrr47o:e0cHWCXHq_w:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Techdiary/~4/cJDbVMrr47o" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-09T18:57:02.272+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://techdiary-viki.blogspot.com/2008/07/reading-file-paragraph-by-paragraph.html</feedburner:origLink></item><item><title>To check the lists of file created between X-Y minutes</title><link>http://feedproxy.google.com/~r/Techdiary/~3/tjljesfAckM/to-check-lists-of-file-created-between.html</link><category>collect files</category><category>perl script to find files created between</category><category>files that were created</category><category>files created or modified between</category><category>what files were created or modified</category><author>vikas.nv@gmail.com (Viki)</author><pubDate>Mon, 11 Aug 2008 02:10:10 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3366815763976900792.post-6030916642908375276</guid><description>I have seen many questions on this -&gt;&lt;br /&gt;&lt;br /&gt;how to get a list of files that were created/modified between 30 to 60 minutes? or 1 to 2 hours ... etc.&lt;br /&gt;&lt;br /&gt;Here is a simple PERL script to do this job:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;use strict;&lt;br /&gt;use File::Find;&lt;br /&gt;&lt;br /&gt;my $path_to_start = $ARGV[0];&lt;br /&gt;my @files_bet_30_60 = ();&lt;br /&gt;my $thirty_mins_in_secs = 30*60;      # change the value of this var to decrease the lower limit&lt;br /&gt;my $sixty_mins_in_secs = 60*60;     # change the value if this var to increase the upper limit&lt;br /&gt;&lt;br /&gt;finddepth(\&amp;amp;wanted, $path_to_start);&lt;br /&gt;foreach my $file (@files_bet_30_60) {&lt;br /&gt;         print "$file\n";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;sub wanted {&lt;br /&gt;       my $file = $File::Find::name;&lt;br /&gt;       next unless (-f $file);&lt;br /&gt;&lt;br /&gt;        my $mtime = (stat($file))[9];&lt;br /&gt;       my $time_diff = time - $mtime;&lt;br /&gt;   push @files_bet_30_60, $file if (($time_diff &gt; $thirty_mins_in_secs) &amp;amp;&amp;amp; ($time_diff &lt; $sixty_mins_in_secs)); }  &lt;/span&gt;&lt;span&gt;Also following &lt;/span&gt;&lt;span&gt;shell command &lt;/span&gt;&lt;span&gt;can do&lt;/span&gt;&lt;span&gt; this:&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;find /path/to/files -type f \( -newer min60 -a ! -newer min30 \)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366815763976900792-6030916642908375276?l=techdiary-viki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/hJVXWqROQ6wp6jUjKaeZPiO0x0o/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hJVXWqROQ6wp6jUjKaeZPiO0x0o/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/hJVXWqROQ6wp6jUjKaeZPiO0x0o/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hJVXWqROQ6wp6jUjKaeZPiO0x0o/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=tjljesfAckM:uX5AAWCq78k:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=tjljesfAckM:uX5AAWCq78k:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=tjljesfAckM:uX5AAWCq78k:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=tjljesfAckM:uX5AAWCq78k:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=tjljesfAckM:uX5AAWCq78k:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=tjljesfAckM:uX5AAWCq78k:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=tjljesfAckM:uX5AAWCq78k:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=tjljesfAckM:uX5AAWCq78k:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=tjljesfAckM:uX5AAWCq78k:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=tjljesfAckM:uX5AAWCq78k:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=tjljesfAckM:uX5AAWCq78k:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=tjljesfAckM:uX5AAWCq78k:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=tjljesfAckM:uX5AAWCq78k:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=tjljesfAckM:uX5AAWCq78k:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=tjljesfAckM:uX5AAWCq78k:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Techdiary/~4/tjljesfAckM" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-11T14:40:10.636+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://techdiary-viki.blogspot.com/2008/07/to-check-lists-of-file-created-between.html</feedburner:origLink></item><item><title>Video: PERL tutorial that I found on YouTube</title><link>http://feedproxy.google.com/~r/Techdiary/~3/qU1R0WK4r2c/video-perl-tutorial-that-i-found-on_17.html</link><category>Perl Video tutorials</category><author>vikas.nv@gmail.com (Viki)</author><pubDate>Mon, 11 Aug 2008 01:55:16 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3366815763976900792.post-5286705935151746586</guid><description>&lt;object width="480" height="385"&gt;&lt;param name="movie" value="http://www.youtube.com/p/E7511681ABEA8635"&gt;&lt;embed src="http://www.youtube.com/p/E7511681ABEA8635" type="application/x-shockwave-flash" width="480" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366815763976900792-5286705935151746586?l=techdiary-viki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/DnWixAq1-k7xMyAtzdD4XkaoYTc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DnWixAq1-k7xMyAtzdD4XkaoYTc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/DnWixAq1-k7xMyAtzdD4XkaoYTc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DnWixAq1-k7xMyAtzdD4XkaoYTc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=qU1R0WK4r2c:qsDyhsWrmXY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=qU1R0WK4r2c:qsDyhsWrmXY:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=qU1R0WK4r2c:qsDyhsWrmXY:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=qU1R0WK4r2c:qsDyhsWrmXY:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=qU1R0WK4r2c:qsDyhsWrmXY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=qU1R0WK4r2c:qsDyhsWrmXY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=qU1R0WK4r2c:qsDyhsWrmXY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=qU1R0WK4r2c:qsDyhsWrmXY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=qU1R0WK4r2c:qsDyhsWrmXY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=qU1R0WK4r2c:qsDyhsWrmXY:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=qU1R0WK4r2c:qsDyhsWrmXY:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=qU1R0WK4r2c:qsDyhsWrmXY:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=qU1R0WK4r2c:qsDyhsWrmXY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=qU1R0WK4r2c:qsDyhsWrmXY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=qU1R0WK4r2c:qsDyhsWrmXY:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Techdiary/~4/qU1R0WK4r2c" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-11T14:25:16.102+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><enclosure url="http://www.youtube.com/p/E7511681ABEA8635" length="889" type="application/x-shockwave-flash" /><media:content url="http://www.youtube.com/p/E7511681ABEA8635" fileSize="889" type="application/x-shockwave-flash" /><itunes:explicit>no</itunes:explicit><itunes:author>Viki</itunes:author><itunes:keywords>perl,scripting,shell,script</itunes:keywords><feedburner:origLink>http://techdiary-viki.blogspot.com/2008/07/video-perl-tutorial-that-i-found-on_17.html</feedburner:origLink></item><item><title>Video Playlist: PERL tutorials that I found on YouTube</title><link>http://feedproxy.google.com/~r/Techdiary/~3/SZcEHJ5hwTk/video-perl-tutorial-that-i-found-on.html</link><category>Perl Video tutorials</category><author>vikas.nv@gmail.com (Viki)</author><pubDate>Mon, 11 Aug 2008 01:54:43 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3366815763976900792.post-8143299960569988555</guid><description>&lt;object width="480" height="385"&gt;&lt;param name="movie" value="http://www.youtube.com/p/E7511681ABEA8635"&gt;&lt;embed src="http://www.youtube.com/p/E7511681ABEA8635" type="application/x-shockwave-flash" width="480" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366815763976900792-8143299960569988555?l=techdiary-viki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BDjapcj3sMubxWm1EeJreIV87L0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BDjapcj3sMubxWm1EeJreIV87L0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BDjapcj3sMubxWm1EeJreIV87L0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BDjapcj3sMubxWm1EeJreIV87L0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=SZcEHJ5hwTk:07GmsCC4RyI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=SZcEHJ5hwTk:07GmsCC4RyI:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=SZcEHJ5hwTk:07GmsCC4RyI:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=SZcEHJ5hwTk:07GmsCC4RyI:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=SZcEHJ5hwTk:07GmsCC4RyI:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=SZcEHJ5hwTk:07GmsCC4RyI:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=SZcEHJ5hwTk:07GmsCC4RyI:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=SZcEHJ5hwTk:07GmsCC4RyI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=SZcEHJ5hwTk:07GmsCC4RyI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=SZcEHJ5hwTk:07GmsCC4RyI:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=SZcEHJ5hwTk:07GmsCC4RyI:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=SZcEHJ5hwTk:07GmsCC4RyI:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=SZcEHJ5hwTk:07GmsCC4RyI:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=SZcEHJ5hwTk:07GmsCC4RyI:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=SZcEHJ5hwTk:07GmsCC4RyI:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Techdiary/~4/SZcEHJ5hwTk" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-11T14:24:43.470+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><enclosure url="http://www.youtube.com/p/E7511681ABEA8635" length="892" type="application/x-shockwave-flash" /><media:content url="http://www.youtube.com/p/E7511681ABEA8635" fileSize="892" type="application/x-shockwave-flash" /><itunes:explicit>no</itunes:explicit><itunes:author>Viki</itunes:author><itunes:keywords>perl,scripting,shell,script</itunes:keywords><feedburner:origLink>http://techdiary-viki.blogspot.com/2008/07/video-perl-tutorial-that-i-found-on.html</feedburner:origLink></item><item><title>PERL script to check if a process is alive</title><link>http://feedproxy.google.com/~r/Techdiary/~3/Qkt7xqM_bPI/perl-script-to-check-if-process-is.html</link><category>process check</category><category>check if a process is alive else execute it</category><category>check if process is open</category><author>vikas.nv@gmail.com (Viki)</author><pubDate>Mon, 11 Aug 2008 02:07:46 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3366815763976900792.post-8729969405795992674</guid><description>&lt;span style="font-family:verdana;"&gt;Below i have a perl script that checks if a given process (passed as command-line argument) is alive or not. If the process had died for some reason, it re-invokes it.&lt;br /&gt;&lt;br /&gt;Put this in crontab &amp;amp; schedule it to run every 1 hour or so.&lt;/span&gt;&lt;span style="font-family:verdana;"&gt; This will take to keep your ever running processes alive&lt;/span&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;The script:&lt;/span&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;&lt;br /&gt;&lt;br /&gt;#!/usr/bin/perl&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;my $process_to_check = $ARGV[0] or die "Usage: $0 &lt;full-path&gt;\n";&lt;/full-path&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;open(PS,"/bin/ps -aef|") || die "Can't Open PS: $!\n";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;while(&lt;ps&gt;) {&lt;/ps&gt;&lt;/span&gt;&lt;br /&gt;             &lt;span style="font-style: italic;font-family:verdana;" &gt;chomp;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;          if (/\Q$process_to_check\E/) { close PS; exit;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;close PS;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;system("&lt;/span&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;$process_to_check&lt;/span&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;");&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366815763976900792-8729969405795992674?l=techdiary-viki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/60UadJBZp6kbHHAQE5eNwCvDo_c/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/60UadJBZp6kbHHAQE5eNwCvDo_c/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/60UadJBZp6kbHHAQE5eNwCvDo_c/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/60UadJBZp6kbHHAQE5eNwCvDo_c/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Qkt7xqM_bPI:QI3-xht14eM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Qkt7xqM_bPI:QI3-xht14eM:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Qkt7xqM_bPI:QI3-xht14eM:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Qkt7xqM_bPI:QI3-xht14eM:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Qkt7xqM_bPI:QI3-xht14eM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=Qkt7xqM_bPI:QI3-xht14eM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Qkt7xqM_bPI:QI3-xht14eM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Qkt7xqM_bPI:QI3-xht14eM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=Qkt7xqM_bPI:QI3-xht14eM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Qkt7xqM_bPI:QI3-xht14eM:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=Qkt7xqM_bPI:QI3-xht14eM:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Qkt7xqM_bPI:QI3-xht14eM:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Qkt7xqM_bPI:QI3-xht14eM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=Qkt7xqM_bPI:QI3-xht14eM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=Qkt7xqM_bPI:QI3-xht14eM:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Techdiary/~4/Qkt7xqM_bPI" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-11T14:37:46.503+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://techdiary-viki.blogspot.com/2008/07/perl-script-to-check-if-process-is.html</feedburner:origLink></item><item><title>Collect files that were created/modified in last 30 to 60 minutes</title><link>http://feedproxy.google.com/~r/Techdiary/~3/OqNYOO5FNE0/collect-files-that-were-createdmodified.html</link><category>perl script to find files created between</category><category>files created or modified between</category><category>collect files that were created in last N minutes</category><author>vikas.nv@gmail.com (Viki)</author><pubDate>Mon, 11 Aug 2008 01:57:46 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3366815763976900792.post-4141039262276951684</guid><description>&lt;span style="font-family:verdana;"&gt;I actually wrote this script in reply to a &lt;/span&gt;&lt;a style="font-family: verdana;" href="http://www.unix.com/shell-programming-scripting/73429-check-lists-file-created-between-30-60-min.html"&gt;post&lt;/a&gt;&lt;span style="font-family:verdana;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;This is what it does ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Given a path (as command-line argument), the script will search through the file system &amp;amp; lists the files that were created/modified in last 30-60 minutes.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;The script:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;use strict;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt; use File::Find;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt; my $path_to_start = $ARGV[0];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt; my @files_bet_30_60 = ();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt; my $thirty_mins_in_secs = 30*60;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt; my $sixty_mins_in_secs = 60*60;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt; finddepth(\&amp;amp;wanted, $path_to_start);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt; foreach my $file (@files_bet_30_60) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;               print "$file\n";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt; sub wanted {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;              my $file = $File::Find::name;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;             next unless (-f $file);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;            my $mtime = (stat($file))[9];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;             my $time_diff = time - $mtime;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;             push @files_bet_30_60, $file if &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;                      (($time_diff &gt; $thirty_mins_in_secs) &amp;amp;&amp;amp; ($time_diff &lt; $sixty_mins_in_secs));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt; }&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366815763976900792-4141039262276951684?l=techdiary-viki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/plsZclUy_5LNTvvh0KJ4uZ6ECV8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/plsZclUy_5LNTvvh0KJ4uZ6ECV8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/plsZclUy_5LNTvvh0KJ4uZ6ECV8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/plsZclUy_5LNTvvh0KJ4uZ6ECV8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=OqNYOO5FNE0:wLLWvPONoW8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=OqNYOO5FNE0:wLLWvPONoW8:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=OqNYOO5FNE0:wLLWvPONoW8:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=OqNYOO5FNE0:wLLWvPONoW8:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=OqNYOO5FNE0:wLLWvPONoW8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=OqNYOO5FNE0:wLLWvPONoW8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=OqNYOO5FNE0:wLLWvPONoW8:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=OqNYOO5FNE0:wLLWvPONoW8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=OqNYOO5FNE0:wLLWvPONoW8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=OqNYOO5FNE0:wLLWvPONoW8:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=OqNYOO5FNE0:wLLWvPONoW8:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=OqNYOO5FNE0:wLLWvPONoW8:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=OqNYOO5FNE0:wLLWvPONoW8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=OqNYOO5FNE0:wLLWvPONoW8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=OqNYOO5FNE0:wLLWvPONoW8:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Techdiary/~4/OqNYOO5FNE0" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-11T14:27:46.420+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://techdiary-viki.blogspot.com/2008/07/collect-files-that-were-createdmodified.html</feedburner:origLink></item><item><title>A Little Guide to PERL Regular Expressions</title><link>http://feedproxy.google.com/~r/Techdiary/~3/iNofhDA3OUk/little-guide-to-perl-regular.html</link><category>Perl Regular Expressions</category><category>Perl regex guide</category><author>vikas.nv@gmail.com (Viki)</author><pubDate>Mon, 11 Aug 2008 01:58:19 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3366815763976900792.post-9018087789864856808</guid><description>&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:verdana;" &gt;Why RegExp?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Regular Expressions are powerful tools for pattern matching and it is also PERL’s powerful tool.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:verdana;" &gt;Starting with Regular Expressions:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Before introducing to Regular Expression, we shall see what is &lt;span style="font-style: italic;"&gt;$_&lt;/span&gt; and how it is relevant to regular expressions.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-style: italic;"&gt;$_&lt;/span&gt; is a PERL special variable which is the default workspace for the regular expression operator.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;However, &lt;span style="font-style: italic;"&gt;$_&lt;/span&gt; is also the default workspace for many commands in PERL. For example, if you just say &lt;span style="font-style: italic;"&gt;print&lt;/span&gt; in your script it would print the contents in &lt;span style="font-style: italic;"&gt;$_&lt;/span&gt;, same with &lt;span style="font-style: italic;"&gt;chop, chomp&lt;/span&gt;, etc.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Coming back to our topic, we shall start with the pattern match operator of PERL &lt;span style="font-style: italic;"&gt;/pattern/&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;It is as “powerful” as “simple to see”.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-style: italic;"&gt;/pattern/&lt;/span&gt; can be used if the workspace of regular expression is $_. If you want to match a pattern against a variable then the operator is &lt;span style="font-style: italic;"&gt;$variable =~ /pattern/&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Let us see some simple regular expressions examples:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;1.    Match vikas in this line “my name is vikas”:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;       &lt;span style="font-style: italic;"&gt;$variable = “my name is vikas”;   # variable to match&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-style: italic;"&gt;       $variable =~ /vikas/;                      # matching the pattern ‘vikas’ in &lt;/span&gt;$variable&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;2.    The above example if workspace is $_:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt; &lt;span style="font-style: italic;"&gt;      $_ = “my name is vikas”;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;       /vikas/;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:verdana;" &gt;How to use this actually?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;These operators can be used with if, while &amp;amp; even foreach constructs. I will explain the usage with an example:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:verdana;" &gt;Scenario:    [Extracting data by matching a pattern from a log file]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Say you have a log file that saved your chat &amp;amp; it is important to get all your friend’s chat ids. The log is very big … maybe because it logs all sessions in a single file.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;With that story told … you decide to use regular expressions to extract that all the chat ids.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Now all that you have to do is to get a pattern from the log, which you will have to match … You open the file &amp;amp; you see this line:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;##### Start of chat with xyz@bahoo at 05:00 PM 25-01-08 #####&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;For every chat above format is repeated. So your pattern can be:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;/^\s*#+\s+ Start of chat with\s+(\w+\@\w+)\s+/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;This pattern uses many other RegExp &lt;span style="font-style: italic;"&gt;anchor characters, repetitions, braces &amp;amp; character classes&lt;/span&gt; which I will explain.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;So … here are the &lt;span style="font-weight: bold;"&gt;anchor characters&lt;/span&gt; that you can use:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-style: italic;"&gt;^ Or \A&lt;/span&gt;             Match beginning of the string/line -- used in my example&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-style: italic;"&gt;$ Or \Z&lt;/span&gt;             Match end of the string/line&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-style: italic;"&gt;\z&lt;/span&gt;                    End of string in any match mode&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-style: italic;"&gt;\b&lt;/span&gt;                    Match word boundary&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-style: italic;"&gt;\B&lt;/span&gt;                    Match non-word boundary&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Here are the &lt;span style="font-weight: bold;"&gt;repetition characters&lt;/span&gt;:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-style: italic;"&gt;?&lt;/span&gt;     Zero or one occurrence of the previous item&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-style: italic;"&gt;* &lt;/span&gt;    Zero or more occurrences of the previous item – used in my example&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-style: italic;"&gt;+&lt;/span&gt;    One or more occurrences of the previous item – used in my example&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;There is more repetition operators, which I do not want to, put up here.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Here are the &lt;span style="font-weight: bold;"&gt;braces/capturing groups&lt;/span&gt;:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-style: italic;"&gt;(...)&lt;/span&gt;    Group several characters together for later use or capture as a single unit, and the matched values will be stored in special variables named $1, $2, $3 …&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;All this said, we will move on to our example &amp;amp; look at the code:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;# first open the log file&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;open (LOG, ”chat. log”) or die “Unable to open chat.log: $!\n”;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;my @all_contents = &lt;log&gt;;    # read all contents into an array&lt;/log&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;close LOG;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;foreach my $line (@all_contents) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;    if ($line =~ /^\s*#+\s+ Start of chat with\s+(\w+\@\w+)\s+/) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;        print ”$1\n”;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;" &gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;The above script will print all the chat ids that the log contains. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;For more about regular expressions visit this link: &lt;a href="http://perldoc.perl.org/perlre.html"&gt;http://perldoc.perl.org/perlre.html&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366815763976900792-9018087789864856808?l=techdiary-viki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/iSwC7Ba0sePfZR3UZ6LRxfyhYfw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iSwC7Ba0sePfZR3UZ6LRxfyhYfw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/iSwC7Ba0sePfZR3UZ6LRxfyhYfw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iSwC7Ba0sePfZR3UZ6LRxfyhYfw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=iNofhDA3OUk:_X3i9-0N2MU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=iNofhDA3OUk:_X3i9-0N2MU:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=iNofhDA3OUk:_X3i9-0N2MU:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=iNofhDA3OUk:_X3i9-0N2MU:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=iNofhDA3OUk:_X3i9-0N2MU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=iNofhDA3OUk:_X3i9-0N2MU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=iNofhDA3OUk:_X3i9-0N2MU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=iNofhDA3OUk:_X3i9-0N2MU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=iNofhDA3OUk:_X3i9-0N2MU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=iNofhDA3OUk:_X3i9-0N2MU:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=iNofhDA3OUk:_X3i9-0N2MU:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=iNofhDA3OUk:_X3i9-0N2MU:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=iNofhDA3OUk:_X3i9-0N2MU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?i=iNofhDA3OUk:_X3i9-0N2MU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techdiary?a=iNofhDA3OUk:_X3i9-0N2MU:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techdiary?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Techdiary/~4/iNofhDA3OUk" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-11T14:28:19.269+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://techdiary-viki.blogspot.com/2008/07/little-guide-to-perl-regular.html</feedburner:origLink></item><media:credit role="author">Viki</media:credit><media:rating>nonadult</media:rating><media:description type="plain">Perl: Tips &amp; Tutorials</media:description></channel></rss>

