<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2949289869462608781</id><updated>2011-10-22T20:25:37.100+05:30</updated><category term='UNIX'/><category term='Art'/><category term='GNU'/><category term='Creativity'/><title type='text'>Harsha's Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://indhare.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2949289869462608781/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://indhare.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Harsha</name><uri>http://www.blogger.com/profile/13630782981482768077</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2949289869462608781.post-3044899099987376191</id><published>2010-08-02T02:16:00.005+05:30</published><updated>2010-08-02T21:42:12.772+05:30</updated><title type='text'></title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O9rclT6oFB4/TFXetEm4YCI/AAAAAAAABDI/3CPT5I7Wj-o/s1600/Perceptions.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 320px;" src="http://4.bp.blogspot.com/_O9rclT6oFB4/TFXetEm4YCI/AAAAAAAABDI/3CPT5I7Wj-o/s320/Perceptions.jpg" alt="" id="BLOGGER_PHOTO_ID_5500547385815228450" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Photograph never was the person.&lt;br /&gt;A stepping stone is not the journey.&lt;br /&gt;A musical score is not the sound.&lt;br /&gt;There is no magic, only magicians and people's perceptions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2949289869462608781-3044899099987376191?l=indhare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://indhare.blogspot.com/feeds/3044899099987376191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2949289869462608781&amp;postID=3044899099987376191' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2949289869462608781/posts/default/3044899099987376191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2949289869462608781/posts/default/3044899099987376191'/><link rel='alternate' type='text/html' href='http://indhare.blogspot.com/2010/08/photograph-never-was-person.html' title=''/><author><name>Harsha</name><uri>http://www.blogger.com/profile/13630782981482768077</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_O9rclT6oFB4/TFXetEm4YCI/AAAAAAAABDI/3CPT5I7Wj-o/s72-c/Perceptions.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2949289869462608781.post-5641793908371826997</id><published>2009-08-22T00:44:00.002+05:30</published><updated>2010-02-26T23:04:18.869+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='UNIX'/><title type='text'>UNIX File System ACLs</title><content type='html'>After a long pause of no technical adventure, today I came across an interesting  problem. There is an activity happening in my office, it involves reassigning a new UNIX user id (&lt;a href="http://en.wikipedia.org/wiki/User_identifier_%28Unix%29"&gt;uid&lt;/a&gt;) for each UNIX user and files owned by that user.&lt;br /&gt;&lt;br /&gt;The list of users across the UNIX machines are common, hence the users names and the respective home directories are being re-used using NFS and NIS technology.&lt;br /&gt;&lt;br /&gt;The assignment of new &lt;a href="http://en.wikipedia.org/wiki/User_identifier_%28Unix%29"&gt;uid &lt;/a&gt;(call it conversion) is happening sequentially on each machine. Since the home directories are being reused, it so happened that the machine(s) on which the conversion had happened, became inaccessible via &lt;a href="http://www.netsarang.com/products/enterprise.html"&gt;Xmanager &lt;/a&gt;(Xmanager is a client t0 remote accesses the graphical user interface of  UNIX).&lt;br /&gt;&lt;br /&gt;The reason for such a behavior is that the server which facilitates NIS and NFS technology is yet to be converted. Because of which the home directory of each user had old uid set on them. The converted servers are aware of  only the new uids. This blocked the converted ones from re-using the home directory for writing the file that are using to maintain state of the session.&lt;br /&gt;&lt;br /&gt;My initial idea is a very vague one, I assumed that each home directory contains a kind of start-up file and that it gets executed as soon as I try to log-in. My rough guess was that it could be either .bashrc or .xinitrc. I thought of adding a statement into these files that changes the home directory path depending on the system that I use to log in into.&lt;br /&gt;&lt;br /&gt;i.e., if I log-in into any of the converted server my home directory should be set to say -/new/home/indhare instead of /home/indhare&lt;br /&gt;&lt;br /&gt;But my idea remained an idea, the solution did not best work for me. I then contacted my friend Anas, I explained him that gist of the problem I was trying to solve. He then introduced to an UNIX command named '&lt;a href="http://www.freebsd.org/cgi/man.cgi?query=setfacl&amp;amp;apropos=0&amp;amp;sektion=0&amp;amp;manpath=FreeBSD+5.0-RELEASE&amp;amp;format=html"&gt;setfacl&lt;/a&gt;'. Until then I was not aware that &lt;a href="http://www.freebsd.org/doc/en/books/handbook/fs-acl.html"&gt;UNIX file systems support ACLs&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I have to say that, '&lt;a href="http://www.freebsd.org/cgi/man.cgi?query=setfacl&amp;amp;apropos=0&amp;amp;sektion=0&amp;amp;manpath=FreeBSD+5.0-RELEASE&amp;amp;format=html"&gt;setfacl&lt;/a&gt;' is one amazing command. It allows extend the ACLs on a UNIX file (I am treating directory also as file). By setting ACL on a file, It is possible to make that file operated by an user who is having more than one uid.&lt;br /&gt;&lt;br /&gt;  setfacl -m u:509:rwx /home/indhare&lt;br /&gt;  setfacl -m u:11801/rwx /home/indhare&lt;br /&gt;&lt;br /&gt;These command makes the directory to be able to accessed by user whose uid is 509 or 11801.&lt;br /&gt;&lt;br /&gt;Exploring further I figured out that the command 'getfacl' indicates the ACLs set on a file object.&lt;br /&gt;&lt;br /&gt;I felt this as cool idea that makes life much easy. I now am able to access the GUI of any UNIX using Xmanager on my laptop.&lt;br /&gt;&lt;br /&gt;Thank you Anas!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2949289869462608781-5641793908371826997?l=indhare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://indhare.blogspot.com/feeds/5641793908371826997/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2949289869462608781&amp;postID=5641793908371826997' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2949289869462608781/posts/default/5641793908371826997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2949289869462608781/posts/default/5641793908371826997'/><link rel='alternate' type='text/html' href='http://indhare.blogspot.com/2009/06/unix-file-system-acls.html' title='UNIX File System ACLs'/><author><name>Harsha</name><uri>http://www.blogger.com/profile/13630782981482768077</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2949289869462608781.post-8186907893526167290</id><published>2009-02-08T20:51:00.002+05:30</published><updated>2010-02-26T23:09:26.722+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Creativity'/><category scheme='http://www.blogger.com/atom/ns#' term='Art'/><title type='text'>Sun - tooth-wheel - synergy :)</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O9rclT6oFB4/SY74pQC9ybI/AAAAAAAAA2E/3Rb_38pX3wQ/s1600-h/Sun.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 240px;" src="http://3.bp.blogspot.com/_O9rclT6oFB4/SY74pQC9ybI/AAAAAAAAA2E/3Rb_38pX3wQ/s320/Sun.jpg" alt="" id="BLOGGER_PHOTO_ID_5300447199027382706" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;How does this craft looks like?&lt;br /&gt;&lt;br /&gt;1. Sun.&lt;br /&gt;2. Tooth-wheel.&lt;br /&gt;3. Any other manifestation.&lt;br /&gt;&lt;br /&gt;My friend recently showed me an image having an assembly of three tooth-wheels and told me that their rotation in unison represents "Synergy" :)&lt;br /&gt;&lt;br /&gt;This divine thought of my friend, made me to remember this paper craft which I had learnt when I was a kid :)&lt;br /&gt;&lt;br /&gt;For me this craft was "Sun", from today I have learnt to see it as tooth-wheel, as Synergy.&lt;br /&gt;&lt;br /&gt;For me this is a lateral thought.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2949289869462608781-8186907893526167290?l=indhare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://indhare.blogspot.com/feeds/8186907893526167290/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2949289869462608781&amp;postID=8186907893526167290' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2949289869462608781/posts/default/8186907893526167290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2949289869462608781/posts/default/8186907893526167290'/><link rel='alternate' type='text/html' href='http://indhare.blogspot.com/2009/02/sun-tooth-wheel-synergy.html' title='Sun - tooth-wheel - synergy :)'/><author><name>Harsha</name><uri>http://www.blogger.com/profile/13630782981482768077</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_O9rclT6oFB4/SY74pQC9ybI/AAAAAAAAA2E/3Rb_38pX3wQ/s72-c/Sun.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2949289869462608781.post-127640506298466364</id><published>2008-11-07T23:33:00.001+05:30</published><updated>2010-02-26T23:09:51.783+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='GNU'/><title type='text'>Power of GNU Coreutils!!</title><content type='html'>Recently, I came across few interesting requirements. Here I will be telling each requirement and the way I tackled them using GNU coreutils commands.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;1. A directory with nearly 4096 files, with each filename having only Japanese characters in it.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Create a new directory&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;br /&gt;mkdir 4096dir&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I browsed for a website having japanese content only, copied the Japanese text into a text file (say jp-utf8)&lt;br /&gt;create shell script out of this text file, have two temporary files. tmp1 and tmp2. Say all these three files reside in the directory created above.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;    &lt;/span&gt;&lt;span style="font-style: italic;"&gt;cat jp-uft8 | tr "\r\n" "" &gt; tmp1&lt;/span&gt; &lt;span style="font-style: italic;"&gt;    cat tmp1 | tr "\n" " " &gt; tmp2&lt;/span&gt; &lt;span style="font-style: italic;"&gt;    cat tmp2 | tr "\r" " " &gt; tmp1&lt;/span&gt; &lt;span style="font-style: italic;"&gt;    cat tmp1 | sed 's/\ //g' &gt; jp-utf8&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The above commands will remove any CRLF, LF, CR end of the line markers from the file. After running the these command the file - jp-utf will have a single line.&lt;br /&gt;&lt;br /&gt;Now induce LF after each 7 characters like this&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;    &lt;/span&gt;&lt;span style="font-style: italic;"&gt;cat jp-utf8 | sed 's/......./&amp;amp;\n/g' &gt; tmp1&lt;/span&gt; &lt;span style="font-style: italic;"&gt;    cat tmp1 | uniq -u &gt; jp-utf8&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;After running these two command the file - jp-utf8, will have only unique set of lines with each line having 7 characters.&lt;br /&gt;Replace each LF mark in the file, with a space and add the command "touch" in the begining of the line.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;    &lt;/span&gt;&lt;span style="font-style: italic;"&gt;cat jp-utf8 | tr "\n" " " &gt; tmp1&lt;/span&gt; &lt;span style="font-style: italic;"&gt;    cat tmp1 | sed 's/^/touch\ /g' &gt; jp-utf8&lt;/span&gt; &lt;span style="font-style: italic;"&gt;    chmod 755 jp-utf8&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now the file jp-utf8 has transformed into a shell script, running this script will create few set of files in the directory - 4096dir.&lt;br /&gt;&lt;br /&gt;Count the number of files that are created&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;    &lt;/span&gt;&lt;span style="font-style: italic;"&gt;ls -1 | wa -m&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Rest, can be easily managed right? ;-)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;2. Create a 200 level deep directory hirearchy&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Copy few Japanese characters into a flat file - dir200&lt;br /&gt;Remove all kinds of End of the line(s) (EOFs) (do you know the command?)&lt;br /&gt;Insert LF after each character, filter the file to contain unique lines with the commands&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;    &lt;/span&gt;&lt;span style="font-style: italic;"&gt;cat dir200 | sed 's/./&amp;amp;\n/g' &gt; tmp1&lt;/span&gt; &lt;span style="font-style: italic;"&gt;    cat tmp1 | uniq -u &gt; tmp2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In a text editor open the file - tmp2 and retain only 200 characters in it.&lt;br /&gt;Now, in tmp2 replace each LF with the "forward slash" characters and append the command "mkdirhier" to the beginning of the line.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;    &lt;/span&gt;&lt;span style="font-style: italic;"&gt;cat tmp2 | tr "\n" "\/" &gt; tmp1&lt;/span&gt; &lt;span style="font-style: italic;"&gt;    cat tmp1 | sed 's/^/mkdirhier\ /g' &gt; dir200&lt;/span&gt; &lt;span style="font-style: italic;"&gt;    chmod 755 dir200&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now the file dir200 has transformed into a shell script, running this script will create - A 200 level deep directory hirearchy.&lt;br /&gt;&lt;br /&gt;Note:&lt;br /&gt;&lt;br /&gt;I have skipped the obvious details - use your imagination ;-)&lt;br /&gt;This is just my engineering style, I am not a magician!! are you?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2949289869462608781-127640506298466364?l=indhare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://indhare.blogspot.com/feeds/127640506298466364/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2949289869462608781&amp;postID=127640506298466364' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2949289869462608781/posts/default/127640506298466364'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2949289869462608781/posts/default/127640506298466364'/><link rel='alternate' type='text/html' href='http://indhare.blogspot.com/2008/11/power-of-coreutils.html' title='Power of GNU Coreutils!!'/><author><name>Harsha</name><uri>http://www.blogger.com/profile/13630782981482768077</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2949289869462608781.post-2748969583673202706</id><published>2008-10-31T19:37:00.000+05:30</published><updated>2008-10-31T20:57:47.352+05:30</updated><title type='text'>I baked my own Perl!!</title><content type='html'>Recently, I had a nice experience compiling Perl 5.10 source code on, my laptop loaded with Windows XP.&lt;br /&gt;&lt;br /&gt;I have a tiny collection of windows compatible GNU and Open source tools. I have grouped them together to form a harmonized system, I call it "Schel". For the sake of compiling the Perl source code, I had to add two more tools to Schel - MinGW and dmake.&lt;br /&gt;&lt;br /&gt;MinGW offers GNU C compiler, related headers and libraries etcetera. I was surprised to know that Perl uses dmake as the default make tool instead of GNU make. With things set in place I compiled Perl  in seven steps, isn't cool!!! ?? :-D&lt;br /&gt;&lt;br /&gt;Here goes those seven commands -&lt;br /&gt;&lt;br /&gt;wget http://www.cpan.org/src/perl-5.10.0.tar.gz&lt;br /&gt;bsdtar -xvzf perl-5.10.0.tar.gz&lt;br /&gt;cd perl-5.10.0\win32&lt;br /&gt;makefile.mk (this is an self explanatory file).&lt;br /&gt;dmake -f makefile.mk&lt;br /&gt;dmake -f makefile.mk test&lt;br /&gt;dmake -f makefile.mk install&lt;br /&gt;&lt;br /&gt;The last command copies the compiled Perl binaries to the location that I specify in the makefile.mk.&lt;br /&gt;&lt;br /&gt;I sanitized the perl source location by running -&lt;br /&gt;&lt;br /&gt;dmake -f makefile.mk clean&lt;br /&gt;&lt;br /&gt;It deletes the intermediate files/objects that were created during compile time.&lt;br /&gt;&lt;br /&gt;Things were back to normal with a positive gain!!&lt;br /&gt;&lt;br /&gt;I suggest to bake Perl indigenously.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2949289869462608781-2748969583673202706?l=indhare.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://indhare.blogspot.com/feeds/2748969583673202706/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2949289869462608781&amp;postID=2748969583673202706' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2949289869462608781/posts/default/2748969583673202706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2949289869462608781/posts/default/2748969583673202706'/><link rel='alternate' type='text/html' href='http://indhare.blogspot.com/2008/10/i-baked-my-own-perl.html' title='I baked my own Perl!!'/><author><name>Harsha</name><uri>http://www.blogger.com/profile/13630782981482768077</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry></feed>
