<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>*NIX Tricks</title>
	<atom:link href="http://nixtricks.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://nixtricks.wordpress.com</link>
	<description>Useful *nix tricks and tips</description>
	<lastBuildDate>Fri, 20 Jan 2012 21:31:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='nixtricks.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/dac93bd00ab7bdce22bac04efd46740b?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>*NIX Tricks</title>
		<link>http://nixtricks.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://nixtricks.wordpress.com/osd.xml" title="*NIX Tricks" />
	<atom:link rel='hub' href='http://nixtricks.wordpress.com/?pushpress=hub'/>
		<item>
		<title>2011 in review</title>
		<link>http://nixtricks.wordpress.com/2012/01/06/2011-in-review/</link>
		<comments>http://nixtricks.wordpress.com/2012/01/06/2011-in-review/#comments</comments>
		<pubDate>Sat, 07 Jan 2012 01:28:51 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[Announcement]]></category>
		<category><![CDATA[announcement]]></category>
		<category><![CDATA[nontech]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=1168</guid>
		<description><![CDATA[The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog. Here&#8217;s an excerpt: Madison Square Garden can seat 20,000 people for a concert. This blog was viewed about 62,000 times in 2011. If it were a concert at Madison Square Garden, it would take about 3 sold-out performances for that many people [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=1168&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog.</p>
<p><a href="/2011/annual-report/"><img src="http://www.wordpress.com/wp-content/mu-plugins/annual-reports/img/emailteaser.jpg" alt="" width="100%" /></a></p>
<p>Here&#8217;s an excerpt:</p>
<blockquote><p>Madison Square Garden can seat 20,000 people for a concert. This blog was viewed about <strong>62,000</strong> times in 2011. If it were a concert at Madison Square Garden, it would take about 3 sold-out performances for that many people to see it.</p></blockquote>
<p><a href="/2011/annual-report/">Click here to see the complete report.</a></p>
<br />Filed under: <a href='http://nixtricks.wordpress.com/category/announcement/'>Announcement</a> Tagged: <a href='http://nixtricks.wordpress.com/tag/announcement-2/'>announcement</a>, <a href='http://nixtricks.wordpress.com/tag/nontech/'>nontech</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/1168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/1168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/1168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/1168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/1168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/1168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/1168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/1168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/1168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/1168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/1168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/1168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/1168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/1168/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=1168&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2012/01/06/2011-in-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>

		<media:content url="http://www.wordpress.com/wp-content/mu-plugins/annual-reports/img/emailteaser.jpg" medium="image" />
	</item>
		<item>
		<title>[vim] Automatically jump to the last visited line when a file is reopened</title>
		<link>http://nixtricks.wordpress.com/2012/01/05/vim-automatically-jump-to-the-last-visited-line-when-a-file-is-reopened/</link>
		<comments>http://nixtricks.wordpress.com/2012/01/05/vim-automatically-jump-to-the-last-visited-line-when-a-file-is-reopened/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 09:08:02 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[vim]]></category>
		<category><![CDATA[cursor]]></category>
		<category><![CDATA[cursor movement]]></category>
		<category><![CDATA[editor]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=1156</guid>
		<description><![CDATA[Put the following in your .vimrc file to automatically jump to the last visited line when a file is reopened using vim: " This allows Vim to jump to the last position when " reopening a file if has("autocmd") au BufReadPost * if line("'\"") &#62; 0 &#38;&#38; line("'\"") Alternatively, you could just reopen the file [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=1156&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Put the following in your <code>.vimrc</code> file to automatically jump to the last visited line when a file is reopened using vim:</p>
<div style="border:1px dotted black;background-color:#DCDCDC;padding:1em;">
<pre>

" This allows Vim to jump to the last position when
" reopening a file

if has("autocmd")
  au BufReadPost * if line("'\"") &gt; 0 &amp;&amp; line("'\"")
</pre>
</div>
<p>Alternatively, you could just reopen the file normally and then hit <code>" '0 "</code> (that is, single quote followed by the number zero) to get the same result.</p>
<p>Source: <a href="http://stackoverflow.com/questions/774560/in-vim-how-do-i-get-a-file-to-open-at-the-same-line-number-i-closed-it-at-last" target="_blank">Stack Overflow</a></p>
<br />Filed under: <a href='http://nixtricks.wordpress.com/category/vim/'>vim</a> Tagged: <a href='http://nixtricks.wordpress.com/tag/cursor/'>cursor</a>, <a href='http://nixtricks.wordpress.com/tag/cursor-movement/'>cursor movement</a>, <a href='http://nixtricks.wordpress.com/tag/editor/'>editor</a>, <a href='http://nixtricks.wordpress.com/tag/vim/'>vim</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/1156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/1156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/1156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/1156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/1156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/1156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/1156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/1156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/1156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/1156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/1156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/1156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/1156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/1156/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=1156&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2012/01/05/vim-automatically-jump-to-the-last-visited-line-when-a-file-is-reopened/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[security] Encrypt a PDF file in the command line</title>
		<link>http://nixtricks.wordpress.com/2011/12/16/security-encrypt-a-pdf-file-in-the-command-line/</link>
		<comments>http://nixtricks.wordpress.com/2011/12/16/security-encrypt-a-pdf-file-in-the-command-line/#comments</comments>
		<pubDate>Fri, 16 Dec 2011 15:33:01 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[security]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[encrypt]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[pdftk]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=1145</guid>
		<description><![CDATA[There are a few command line tools to encrypt/ password-protect a file, for example OpenSSL, GnuPG. However, if you want to send someone an encrypted PDF who does not have access to these CLI tools, then that&#8217;s not cool for the recipient at all! Pdftk is another open-source command line tool that can encrypt a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=1145&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There are a few command line tools to encrypt/ password-protect a file, for example <a title="[security] Encrypt files in the command line using OpenSSL" href="http://nixtricks.wordpress.com/2009/10/03/security-encrypt-files-in-the-command-line-using-openssl/" target="_blank">OpenSSL</a>, <a title="[security] Introduction to encryption of  files using GPG" href="http://nixtricks.wordpress.com/2009/10/04/introduction-to-encryption-of-files-using-gpg/" target="_blank">GnuPG</a>. However, if you want to send someone an encrypted PDF who does not have access to these CLI tools, then that&#8217;s not cool for the recipient at all! <a href="http://www.pdflabs.com/docs/pdftk-cli-examples/" target="_blank">Pdftk</a> is another open-source command line tool that can encrypt a PDF file which can be decrypted using either Pdftk in the commandline or entering the password in a GUI pop-up box when the  recipient tries to open the PDF file using a PDF viewer (for example, Adobe Reader).</p>
<h3>Examples (taken from <a href="http://www.pdflabs.com/docs/pdftk-cli-examples/" target="_blank">PDF Labs</a>):</h3>
<blockquote>
<h6>1. Encrypt a PDF using 128-Bit Strength (the Default) and Withhold All Permissions (the Default)</h6>
<p><tt>$ pdftk mydoc.pdf output mydoc.128.pdf owner_pw foopass</tt></p>
<h6>2. Same as Above, Except a Password is Required to Open the PDF</h6>
<p><tt>$ pdftk mydoc.pdf output mydoc.128.pdf owner_pw foo user_pw baz</tt></p>
<h6>3. Same as Above, Except Printing is Allowed (after the PDF is Open)</h6>
<p><tt>$ pdftk mydoc.pdf output mydoc.128.pdf owner_pw foo user_pw baz allow printing</tt></p>
<h6>4. Decrypt a PDF</h6>
<p><tt>$ pdftk secured.pdf input_pw foopass output unsecured.pdf</tt>
</p></blockquote>
<p>
<strong><br />
NOTE:</strong> Setting an owner password prevents the document from being modified unless the password is provided. In the same way, setting a user password prevents the user to view the file.</p>
<br />Filed under: <a href='http://nixtricks.wordpress.com/category/security/'>security</a> Tagged: <a href='http://nixtricks.wordpress.com/tag/cli/'>cli</a>, <a href='http://nixtricks.wordpress.com/tag/encrypt/'>encrypt</a>, <a href='http://nixtricks.wordpress.com/tag/encryption/'>encryption</a>, <a href='http://nixtricks.wordpress.com/tag/pdf/'>pdf</a>, <a href='http://nixtricks.wordpress.com/tag/pdftk/'>pdftk</a>, <a href='http://nixtricks.wordpress.com/tag/security/'>security</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/1145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/1145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/1145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/1145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/1145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/1145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/1145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/1145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/1145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/1145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/1145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/1145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/1145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/1145/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=1145&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2011/12/16/security-encrypt-a-pdf-file-in-the-command-line/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[shell] Repoint an existing symbolic link (symlink) to a different target</title>
		<link>http://nixtricks.wordpress.com/2011/08/29/shell-repoint-an-existing-symbolic-link-symlink-to-a-different-target/</link>
		<comments>http://nixtricks.wordpress.com/2011/08/29/shell-repoint-an-existing-symbolic-link-symlink-to-a-different-target/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 17:42:53 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[csh]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[zsh]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[ln]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=1137</guid>
		<description><![CDATA[Credit: Commandline-fu. Filed under: bash, cli, csh, linux, shell, unix, zsh Tagged: cli, link, ln, shell<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=1137&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><pre class="brush: bash;">
$  ln -nsf &lt;TARGET&gt;  &lt;LINK&gt;
</pre></p>
<p><strong>Credit: </strong><a href="http://www.commandlinefu.com/commands/view/8833/repoint-an-existing-symlink-to-a-new-location" target="_blank">Commandline-fu</a>.</p>
<br />Filed under: <a href='http://nixtricks.wordpress.com/category/bash/'>bash</a>, <a href='http://nixtricks.wordpress.com/category/cli/'>cli</a>, <a href='http://nixtricks.wordpress.com/category/csh/'>csh</a>, <a href='http://nixtricks.wordpress.com/category/linux/'>linux</a>, <a href='http://nixtricks.wordpress.com/category/shell/'>shell</a>, <a href='http://nixtricks.wordpress.com/category/unix/'>unix</a>, <a href='http://nixtricks.wordpress.com/category/zsh/'>zsh</a> Tagged: <a href='http://nixtricks.wordpress.com/tag/cli/'>cli</a>, <a href='http://nixtricks.wordpress.com/tag/link/'>link</a>, <a href='http://nixtricks.wordpress.com/tag/ln/'>ln</a>, <a href='http://nixtricks.wordpress.com/tag/shell/'>shell</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/1137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/1137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/1137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/1137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/1137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/1137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/1137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/1137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/1137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/1137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/1137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/1137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/1137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/1137/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=1137&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2011/08/29/shell-repoint-an-existing-symbolic-link-symlink-to-a-different-target/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[perl] Access shell environmental variables in your Perl script</title>
		<link>http://nixtricks.wordpress.com/2011/08/26/perl-access-shell-environmental-variables-in-your-perl-script/</link>
		<comments>http://nixtricks.wordpress.com/2011/08/26/perl-access-shell-environmental-variables-in-your-perl-script/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 15:34:04 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[associative array]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[env]]></category>
		<category><![CDATA[environment variable]]></category>
		<category><![CDATA[hash]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[shell variable]]></category>
		<category><![CDATA[variable]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=1123</guid>
		<description><![CDATA[The environmental variables are stored in %ENV hash (&#8220;associative array&#8221;). Now if you want to access a shell variable, say $HOME, in your Perl script, then you need to refer to it as $ENV{'HOME'}: Don&#8217;t forget the curly braces and the single quotes! Reference: Devdaily blog. Filed under: perl Tagged: array, associative array, editor, env, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=1123&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The environmental variables are stored in <code>%ENV</code> hash (&#8220;associative array&#8221;). Now if you want to access a shell variable, say <code>$HOME</code>, in your Perl script, then you need to refer to it as <code>$ENV{'HOME'}</code>:</p>
<p><pre class="brush: perl;">
#!/usr/bin/perl
$my_home_dir = &quot;$ENV{'HOME'}&quot; ;
$my_shell = &quot;$ENV{'SHELL'}&quot; ;
$my_editor = &quot;$ENV{'EDITOR'}&quot; ;
</pre></p>
<p>Don&#8217;t forget the curly braces and the single quotes!</p>
<p><strong>Reference:</strong> <a href="http://www.devdaily.com/perl/edu/articles/pl020002" target="_blank">Devdaily blog</a>.</p>
<br />Filed under: <a href='http://nixtricks.wordpress.com/category/perl/'>perl</a> Tagged: <a href='http://nixtricks.wordpress.com/tag/array/'>array</a>, <a href='http://nixtricks.wordpress.com/tag/associative-array/'>associative array</a>, <a href='http://nixtricks.wordpress.com/tag/editor/'>editor</a>, <a href='http://nixtricks.wordpress.com/tag/env/'>env</a>, <a href='http://nixtricks.wordpress.com/tag/environment-variable/'>environment variable</a>, <a href='http://nixtricks.wordpress.com/tag/hash/'>hash</a>, <a href='http://nixtricks.wordpress.com/tag/perl/'>perl</a>, <a href='http://nixtricks.wordpress.com/tag/scripting/'>scripting</a>, <a href='http://nixtricks.wordpress.com/tag/shell/'>shell</a>, <a href='http://nixtricks.wordpress.com/tag/shell-variable/'>shell variable</a>, <a href='http://nixtricks.wordpress.com/tag/variable/'>variable</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/1123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/1123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/1123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/1123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/1123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/1123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/1123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/1123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/1123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/1123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/1123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/1123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/1123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/1123/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=1123&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2011/08/26/perl-access-shell-environmental-variables-in-your-perl-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[pdf] Resize a picture in the command line using ImageMagick (convert) and save it as a PDF</title>
		<link>http://nixtricks.wordpress.com/2011/03/25/pdf-resize-a-picture-in-the-command-lineusing-imagemagick-convert-and-save-it-as-pdf/</link>
		<comments>http://nixtricks.wordpress.com/2011/03/25/pdf-resize-a-picture-in-the-command-lineusing-imagemagick-convert-and-save-it-as-pdf/#comments</comments>
		<pubDate>Fri, 25 Mar 2011 08:21:50 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[cli]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[ImageMagick]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[picture]]></category>
		<category><![CDATA[print]]></category>
		<category><![CDATA[resize]]></category>
		<category><![CDATA[size]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=1107</guid>
		<description><![CDATA[Resize a picture or PDF file by 50% of its original form and save it as a PDF: $ convert rose.jpg -resize 50% rose.pdf Well, &#8216;convert&#8217; may be used to convert between most of the known image formats &#8212;- not just JPG and PDF! N.B. 1. More options may be found at the ImageMagick website. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=1107&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Resize a picture or PDF file by 50% of its original form and save it as a PDF:</p>
<p><code>$ convert rose.jpg -resize 50% rose.pdf</code></p>
<p>Well, &#8216;convert&#8217; may be used to convert between most of the known image formats &#8212;- not just JPG and PDF!</p>
<p><strong>N.B. </strong><strong>1. </strong>More options may be found at the ImageMagick <a title="ImageMagick" href="http://www.imagemagick.org/script/convert.php">website</a>. More information on how to specify the geometry may be found <a title="geometry" href="http://www.imagemagick.org/script/command-line-processing.php#geometry" target="_blank">here</a>. (If you don&#8217;t have ImgeMagick you need to install it first &#8212; see the first link for more information on installation!).</p>
<p><strong>2.</strong> Here is a <a title="Usage" href="http://www.imagemagick.org/Usage/" target="_blank">list</a> of other useful options/ examples on how to make the best out of &#8216;convert&#8217;.</p>
<p><strong>3.</strong> If you&#8217;re at playing with PDFs you may also be interested in joining and removing pages from a PDF document using Ghostscript &#8212; see a previous post <a href="http://nixtricks.wordpress.com/2009/09/01/cli-combine-or-remove-pages-from-a-pdf-document-using-ghostscript/" target="_blank">here</a>.</p>
<br />Filed under: <a href='http://nixtricks.wordpress.com/category/cli/'>cli</a>, <a href='http://nixtricks.wordpress.com/category/linux/'>linux</a>, <a href='http://nixtricks.wordpress.com/category/osx/'>osx</a>, <a href='http://nixtricks.wordpress.com/category/ubuntu/'>ubuntu</a>, <a href='http://nixtricks.wordpress.com/category/unix/'>unix</a> Tagged: <a href='http://nixtricks.wordpress.com/tag/convert/'>convert</a>, <a href='http://nixtricks.wordpress.com/tag/graphics/'>graphics</a>, <a href='http://nixtricks.wordpress.com/tag/imagemagick/'>ImageMagick</a>, <a href='http://nixtricks.wordpress.com/tag/pdf/'>pdf</a>, <a href='http://nixtricks.wordpress.com/tag/picture/'>picture</a>, <a href='http://nixtricks.wordpress.com/tag/print/'>print</a>, <a href='http://nixtricks.wordpress.com/tag/resize/'>resize</a>, <a href='http://nixtricks.wordpress.com/tag/size/'>size</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/1107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/1107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/1107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/1107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/1107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/1107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/1107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/1107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/1107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/1107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/1107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/1107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/1107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/1107/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=1107&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2011/03/25/pdf-resize-a-picture-in-the-command-lineusing-imagemagick-convert-and-save-it-as-pdf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[f77] Concatenate a string with another string or an integer in fortran 77</title>
		<link>http://nixtricks.wordpress.com/2011/03/23/f77-concatenate-a-string-with-another-string-or-an-integer-in-fortran-77/</link>
		<comments>http://nixtricks.wordpress.com/2011/03/23/f77-concatenate-a-string-with-another-string-or-an-integer-in-fortran-77/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 21:52:35 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[fortran]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[character]]></category>
		<category><![CDATA[f77]]></category>
		<category><![CDATA[fortran 77]]></category>
		<category><![CDATA[integer to character]]></category>
		<category><![CDATA[integer to string]]></category>
		<category><![CDATA[string]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=1103</guid>
		<description><![CDATA[Let&#8217;s assume that we have defined two strings as str1 = 'abc' str2 = 'pqr' and an  integer integ = 25 (Make sure str1 and str2, and integ are defined as character strings, and integer, respectively) 1. Concatenate str1 and str2 into str3 (make sure you define str3 first as a character string) str3 = [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=1103&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s assume that we have defined two strings as</p>
<p><code>str1 = 'abc'</code></p>
<p><code> </code></p>
<p><code>str2 = 'pqr'</code></p>
<p>and an  integer</p>
<p><code>integ = 25</code></p>
<p>(Make sure str1 and str2, and integ are defined as character strings, and integer, respectively)</p>
<p><strong>1. Concatenate str1 and str2 into str3 (make sure you define str3 first as a character string)</strong></p>
<p><code>str3 = str1//str2</code></p>
<p><strong>2. Concatenate str1 and integ into str3 (again make sure str3 is defined as a character string)</strong></p>
<p><em>step a: </em>convert integer to a string first (make sure str4 is defined as a character string and not initialized, i.e. it&#8217;s so far an empty string)</p>
<p><code>write(str4,'(I5)') integ<br />
</code><br />
<em>step b: c</em>oncatenate str1 and str4 into str3</p>
<p><code>str3 = str1//str4</code></p>
<br />Filed under: <a href='http://nixtricks.wordpress.com/category/fortran/'>fortran</a>, <a href='http://nixtricks.wordpress.com/category/programming/'>programming</a> Tagged: <a href='http://nixtricks.wordpress.com/tag/character/'>character</a>, <a href='http://nixtricks.wordpress.com/tag/f77/'>f77</a>, <a href='http://nixtricks.wordpress.com/tag/fortran/'>fortran</a>, <a href='http://nixtricks.wordpress.com/tag/fortran-77/'>fortran 77</a>, <a href='http://nixtricks.wordpress.com/tag/integer-to-character/'>integer to character</a>, <a href='http://nixtricks.wordpress.com/tag/integer-to-string/'>integer to string</a>, <a href='http://nixtricks.wordpress.com/tag/programming/'>programming</a>, <a href='http://nixtricks.wordpress.com/tag/string/'>string</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/1103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/1103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/1103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/1103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/1103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/1103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/1103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/1103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/1103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/1103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/1103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/1103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/1103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/1103/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=1103&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2011/03/23/f77-concatenate-a-string-with-another-string-or-an-integer-in-fortran-77/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[bash] Substitute dots by hyphens using &#8220;tr&#8221;</title>
		<link>http://nixtricks.wordpress.com/2011/03/13/bash-substitute-dots-by-hyphens-using-tr/</link>
		<comments>http://nixtricks.wordpress.com/2011/03/13/bash-substitute-dots-by-hyphens-using-tr/#comments</comments>
		<pubDate>Mon, 14 Mar 2011 03:23:31 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[csh]]></category>
		<category><![CDATA[zsh]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[string manipulation]]></category>
		<category><![CDATA[substitute]]></category>
		<category><![CDATA[substitution]]></category>
		<category><![CDATA[tr]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=1093</guid>
		<description><![CDATA[If you want to replace dots in a string, for example &#8220;a.string.with.dots&#8221;, by hyphens use the following trick &#160; $ echo "a.string.with.dots" &#124; tr "." "-" That&#8217;s it! &#160; Needless to say, other characters may also be substituted this way. Filed under: bash, cli, csh, zsh Tagged: string, string manipulation, substitute, substitution, tr<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=1093&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you want to replace dots in a string, for example &#8220;a.string.with.dots&#8221;, by hyphens use the following trick</p>
<p>&nbsp;</p>
<pre>$ echo "a.string.with.dots" | tr  "."  "-"</pre>
<p>That&#8217;s it!</p>
<p>&nbsp;</p>
<p>Needless to say, other characters may also be substituted this way.</p>
<br />Filed under: <a href='http://nixtricks.wordpress.com/category/bash/'>bash</a>, <a href='http://nixtricks.wordpress.com/category/cli/'>cli</a>, <a href='http://nixtricks.wordpress.com/category/csh/'>csh</a>, <a href='http://nixtricks.wordpress.com/category/zsh/'>zsh</a> Tagged: <a href='http://nixtricks.wordpress.com/tag/string/'>string</a>, <a href='http://nixtricks.wordpress.com/tag/string-manipulation/'>string manipulation</a>, <a href='http://nixtricks.wordpress.com/tag/substitute/'>substitute</a>, <a href='http://nixtricks.wordpress.com/tag/substitution/'>substitution</a>, <a href='http://nixtricks.wordpress.com/tag/tr/'>tr</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/1093/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/1093/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/1093/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/1093/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/1093/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/1093/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/1093/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/1093/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/1093/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/1093/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/1093/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/1093/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/1093/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/1093/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=1093&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2011/03/13/bash-substitute-dots-by-hyphens-using-tr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[svn] List subversion commits by a user for a given date range</title>
		<link>http://nixtricks.wordpress.com/2011/03/10/svn-list-subversion-commits-by-a-user-for-a-given-date-range/</link>
		<comments>http://nixtricks.wordpress.com/2011/03/10/svn-list-subversion-commits-by-a-user-for-a-given-date-range/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 07:10:42 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[csh]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[zsh]]></category>
		<category><![CDATA[commit]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[version]]></category>
		<category><![CDATA[version-control]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=1080</guid>
		<description><![CDATA[In connection to my previous post on SVN intro, here&#8217;s a neat trick to list SVN commits by a user for a given date range: Note: It does not work in t/csh shells since you need a different looping structure (see a recent post on t/csh loops). &#160; Reference: Command-Line-Fu. Filed under: bash, csh, svn, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=1080&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In connection to my <a href="http://nixtricks.wordpress.com/2011/03/08/svn-beginners-guide-to-version-control-using-subversion/">previous</a> post on SVN intro, here&#8217;s a neat trick to list SVN commits by a user for a given date range:</p>
<p><pre class="brush: bash;">
$ for i in `svn log -r{2011-02-01}:HEAD | awk '$3 == &quot;user&quot; {print $1}'`; do svn log -v -$i;done
</pre></p>
<p><strong>Note: </strong>It does not work in t/csh shells since you need a different looping structure (see a recent <a href="http://nixtricks.wordpress.com/2011/03/03/simple-loops-in-csh-ortcsh/">post</a> on t/csh loops).</p>
<p>&nbsp;</p>
<p><strong>Reference:</strong> <a href="http://www.commandlinefu.com/commands/view/8010/list-svn-commits-by-user-for-a-date-range">Command-Line-Fu</a>.</p>
<br />Filed under: <a href='http://nixtricks.wordpress.com/category/bash/'>bash</a>, <a href='http://nixtricks.wordpress.com/category/csh/'>csh</a>, <a href='http://nixtricks.wordpress.com/category/svn/'>svn</a>, <a href='http://nixtricks.wordpress.com/category/zsh/'>zsh</a> Tagged: <a href='http://nixtricks.wordpress.com/tag/commit/'>commit</a>, <a href='http://nixtricks.wordpress.com/tag/subversion/'>subversion</a>, <a href='http://nixtricks.wordpress.com/tag/svn/'>svn</a>, <a href='http://nixtricks.wordpress.com/tag/version/'>version</a>, <a href='http://nixtricks.wordpress.com/tag/version-control/'>version-control</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/1080/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/1080/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/1080/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/1080/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/1080/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/1080/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/1080/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/1080/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/1080/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/1080/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/1080/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/1080/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/1080/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/1080/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=1080&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2011/03/10/svn-list-subversion-commits-by-a-user-for-a-given-date-range/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[svn] Beginners&#8217; guide to version-control using subversion</title>
		<link>http://nixtricks.wordpress.com/2011/03/08/svn-beginners-guide-to-version-control-using-subversion/</link>
		<comments>http://nixtricks.wordpress.com/2011/03/08/svn-beginners-guide-to-version-control-using-subversion/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 06:48:04 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[cli]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[sync]]></category>
		<category><![CDATA[version-control]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=1056</guid>
		<description><![CDATA[While programming a large code (or a set of codes) it&#8217;s important to keep track of changes along the way. Subversion (SVN) does precisely that. Its main difference with the popular alternative git, is that SVN keeps a single copy of the &#8220;repository&#8221; &#8212; where all the changes are stored. Here&#8217;s a brief outline of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=1056&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>While programming a large code (or a set of codes) it&#8217;s important to keep track of changes along the way. Subversion (<a href="http://artis.imag.fr/~Xavier.Decoret/resources/svn/index.html" target="_blank">SVN</a>) does precisely that. Its main <a href="http://git.or.cz/course/svn.html" target="_blank">difference</a> with the popular alternative <a href="http://www.kernel.org/pub/software/scm/git/docs/v1.2.6/tutorial.html" target="_blank">git</a>, is that SVN keeps a single copy of the &#8220;repository&#8221; &#8212; where all the changes are stored. Here&#8217;s a brief outline of the main features and usage of SVN.</p>
<p style="text-align:center;">&nbsp;</p>
<p style="text-align:center;"><strong>I. GETTING THINGS READY</strong></p>
<p style="text-align:center;"><strong><br />
</strong></p>
<p><strong>a) Create the directory where the repository will be stored (let&#8217;s say ~/svn_repos/big_project)</strong></p>
<p><code>$ mkdir ~/svn_repos &amp;&amp; mkdir ~/svn_repos/big_project</code></p>
<p><strong>b) &#8220;Create&#8221; the SVN repository</strong></p>
<p><code>$ svnadvin create  --fs-type fsfs ~/svn_repos/big_project</code></p>
<p>This will create a few files in the directory ~/svn_repos/big_project. Have a look at this <a href="http://svnbook.red-bean.com/nightly/en/svn.reposadmin.basics.html">link</a> for an explanation of all the files created.</p>
<p><strong>c)  Start a project and put it (or an existing project) under version control</strong></p>
<p>A typical project directory usually contains three subdirectories: (1) trunk, (2) branches ( and (3) tags. The &#8216;trunk&#8217; contains the main working copy of the project. The &#8216;branches&#8217; directory as the name suggests contains other ideas related to the project which initially started off of the main branch but now has significant deviation and are worth considering later. The &#8216;tag&#8217; holds the snapshots (which you think might be considered to be good versions worth comparing with). So, if you are just starting you need to  create the file structure first:</p>
<p><code>$ mkdir ~/project  &amp;&amp; cd ~/project &amp;&amp; mkdir trunk branches tag</code></p>
<p>and then create a file in the trunk for fun!</p>
<p><code>$ touch ~/project/trunk/my_program.cpp<br />
</code><br />
It&#8217;s recommended that the whole &#8216;project&#8217; directory be put under version control (but that&#8217;s not mandatory!). You can do it as follows (assuming &#8220;~/  &#8221;  or the user&#8217;s &#8220;$HOME&#8221; variable expands as &#8220;/usr/username&#8221;, and both &#8220;~/svn_repos&#8221; and &#8220;~/project&#8221; directories are on the same machine):</p>
<p><code>$ svn import ~/project <span style="color:#ff0000;">file://<span style="color:#000000;">/</span></span>usr/username/svn_repos/big_project -m 'Initial import'</code></p>
<p>The &#8220;-m&#8221; flags lets you enter a message along with the import.</p>
<p>If you want to import only &#8216;trunk&#8217; you can do so by replacing &#8220;~/project&#8221; by &#8220;~/project/trunk&#8221;.</p>
<p>However, if the the ~/projects and ~/svn_repos reside on different machines (say, local.com and remote.com, respectively) we need to use svn+ssh instead:</p>
<p><code>$ svn import ~/project  <span style="color:#ff0000;">svn+ssh://</span>remote_username@remote.com/usr/remote_username/svn_repos/big_project -m 'Initial import'<br />
</code><br />
assuming that we are on the local machine and remote_username, as the name suggests, is the username on remote.com.</p>
<p>The initial import will be labeled as &#8216;revision 1&#8242;.</p>
<p><strong>c) Copying the repository to somewhere else</strong><em><strong><br />
</strong></em></p>
<p>You may want to copy the repository to a different place or even to a different machine:<br />
<code>$ svnadmin dump /path/to/reponame &gt; /tmp/reponame.dump ; scp -rp /tmp/reponame.dump user@server.domain.com:/tmp/</code></p>
<p>Have a look at the Arch wiki <a href="https://wiki.archlinux.org/index.php/Subversion_backup_and_restore" target="_blank">link</a> for a thorough description.<br />
<strong> </strong></p>
<p style="text-align:center;">&nbsp;</p>
<p style="text-align:center;"><strong>II. LIFE WITH SVN</strong></p>
<p style="text-align:center;"><strong><br />
</strong></p>
<p><strong>a) Check out a copy from the repository</strong></p>
<p>If  you want to check out  revision N from the repo into the ~/codes directory <strong>on the same machine </strong>where the repo resides, then</p>
<p><code>$ svn checkout -r N  <span style="color:#ff0000;">file://</span>/usr/username/svn_repo/big_project  ~/codes/new_project</code></p>
<p>which will check out the Nth revision of the &#8220;trunk&#8221;, &#8220;branches&#8221; and &#8220;tags&#8221; in the &#8220;~/codes/new_project&#8221; directory.</p>
<p>However, if the repository is <strong>on a different machine</strong> (remote.com), then use the following to checkout the Nth revision in &#8220;~/codes/new_project&#8221;</p>
<p><code>$ svn checkout -r N  <span style="color:#ff0000;">svn+ssh://</span>remote_username@remote.com/usr/remote_username/svn_repos/big_project ~/codes/new_project</code></p>
<p><em><strong>Notes:</strong></em></p>
<ol>
<li>&#8220;co&#8221; is synonymous to checkout.</li>
<li>If you skip &#8220;-r N&#8221;, then you&#8217;ll check out the latest revision.</li>
<li>If you want to check out only &#8220;trunk&#8221; as the &#8220;new_project&#8221;, then replace &#8220;big_project&#8221; above by &#8220;big_project/trunk&#8221;.</li>
</ol>
<p>For the time being we&#8217;ll assume that you are the only person who&#8217;s working on the project and you&#8217;re working solely in the directory &#8220;~/new_project/trunk&#8221;.</p>
<p><em>(At this point you can delete the original &#8220;~/project&#8221; directory &#8212; it&#8217;s of no use to us any more since all its information is stored in the repo)</em></p>
<p><strong>b) Get more information about the repo: [svn info]</strong></p>
<p><code>$ svn info</code></p>
<p><strong>c) Check the files currently under version control: [svn ls]</strong></p>
<p><code>$ svn ls</code></p>
<p><strong>d) Make changes and commit: [svn commit]</strong></p>
<p>Make some  changes to &#8220;my_program.c&#8221;, and <em>if you think it&#8217;s worth saving</em> in the repo then do the following</p>
<p><code>$ svn commit -m 'The first big change is made'</code></p>
<p>Again the &#8220;-m&#8221; lets you add an informative comment.</p>
<p><strong>e) Add another file under version control: [svn add]</strong></p>
<p>Create another file in same directory</p>
<p><code>$ vi dummy.cpp</code></p>
<p>and add something to it, and then add it to the repository</p>
<p><code>$ svn add dummy.cpp</code></p>
<p><strong>f) Remove a file from version control: [svn rm]</strong></p>
<p><code>$ svn rm dummy.cpp</code></p>
<p><strong>g) Put a copy of a version-controlled file under version control: [svn cp]</strong></p>
<p><code>$ svn cp my_program.cpp our_program.cpp</code></p>
<p><strong>h) Check the current status of the working copy (i.e., how does it differ from the copy in the repo?): [svn status]</strong></p>
<p><code>$ svn status</code></p>
<p>Have a look at the <a href="http://svnbook.red-bean.com/en/1.0/re26.html" target="_blank">list</a> of codes which describes the status of the file(s).</p>
<p><strong>i) Check the SVN log containing information about the revisions: [svn log]</strong></p>
<p><code>$ svn log</code></p>
<p>The optional flag &#8220;&#8211;verbose&#8221; will print will print verbose information.</p>
<p><strong>j) Compare the differences: [svn diff]</strong></p>
<p>To find the difference in &#8220;my_program.cpp&#8221; between revisions M and N</p>
<p><code>$ svn diff -r M:N my_program.cpp &gt; diff_file</code></p>
<p>The output is redirected to a file  &#8221;diff_file&#8221; for easy browsing. If you want to know all the differences (in all the files) between these two revisions, then skip the file name.</p>
<p>On the other hand to find the difference between revision N and the working copy of &#8220;my_program.cpp&#8221;:</p>
<p><code>$ svn diff -r N my_program.cpp  &gt; diff_file-2</code></p>
<p><strong>k) Revert to a previous revision: [svn revert]</strong></p>
<p>If you want to revert to the last committed version of my_program.cpp</p>
<p><code>$ svn revert my_program.cpp</code></p>
<p>You may revert more than one files this way (just type the file names after my_program.cpp). If you want to revert to the last saved copy of the working directory, replace &#8220;my_program.cpp&#8221; with a &#8220;.&#8221; (dot).</p>
<p><strong>l) Help is on the way: [svn help]</strong></p>
<p><code>$ svn help unknown_command<br />
</code><br />
will help you with the use of the command, &#8220;unknown_command&#8221;.</p>
<p style="text-align:center;">&nbsp;</p>
<p style="text-align:center;"><strong>III. SHARING THE WORKLOAD WITH OTHERS USING SVN</strong></p>
<p style="text-align:center;"><strong><br />
</strong></p>
<p style="text-align:left;"><strong>a) Obaining copies and making changes<br />
</strong></p>
<p>If you are a collaborator you should first check out a version of the repo in the same way as described in Section II(a) above. Then you can do all the other things described in Section II to the checked out files. For example, you can make changes to the files uncder version control and commit the changes to the repository using the commit command as in II(d).</p>
<p><strong>b) Confilict resolution</strong></p>
<p>There may be a conflict during  &#8216;committing&#8217; a file if some other collaborator has already saved (committed) an updated version of the file to the repo. The command, &#8216;svn commit&#8217;, won&#8217;t let you commit if there are conflicting changes between the file in the repo (say, with a revision number 6) and the one that you modified from an older version (e.g., 5). In that case you have to resolve conflict first before you can commit. To avoid such a scenario you should always start your work before you update your copy to the latest version in the repo:</p>
<p><code>$ svn update</code></p>
<p>However, in some cases conflict may be unavoidable. You have a few options in such a case:</p>
<p><strong><em>Option 1: </em></strong>Skip your changes and revert to the updated version in the repo</p>
<p><code>$ svn revert my_program.cpp</code></p>
<p>Then make the changes and try to &#8216;commit&#8217; it.</p>
<p><strong><em>Option 2: </em></strong>Merge the changes (yours and the one in the repo)</p>
<p>After a failed attempt in commiting (due to conflicts), there will be four &#8216;special&#8217; files in the working direcotry</p>
<p>1. my_program.cpp (the original with markers showing conflicts)</p>
<p>2. my_program.cpp.mine (your updated version which you&#8217;re trying to commit)</p>
<p>3. my_program.cpp.5 (the original that you started to work on)</p>
<p>4. my_program.cpp.6 (the one in the repository)</p>
<p>Labelling the file my_program.cpp &#8216;resolved&#8217;  will merge the changes</p>
<p><code>$ svn resolved my_program.cpp</code></p>
<p>Next do an &#8216;svn update&#8217; to make sure that there isn&#8217;t any other conflict, and then you can proceed with the &#8216;svn commit&#8217;.</p>
<p><strong><em>Option 3:</em></strong> Throw away all the changes made by others&#8217; and save only your changes:</p>
<p><code>$ cp my_program.cpp.mine my_program.cpp</code></p>
<p>$ svn resolved my_program.cpp</p>
<p>In the same way as above, the next thing to do is an &#8216;svn update&#8217; to make sure that there isn&#8217;t any other conflict, and then proceed with the &#8216;svn commit&#8217;.</p>
<p>&nbsp;</p>
<p><em><strong>Note: </strong></em>It&#8217;s always a good idea to start with &#8216;svn update&#8217; before you modify a file under version control by SVN!</p>
<p style="text-align:left;">&nbsp;</p>
<p style="text-align:left;"><strong>References:</strong></p>
<p>1. SVN tutorials: <a href="http://artis.imag.fr/~Xavier.Decoret/resources/svn/" target="_blank">here</a> and <a href="http://www.rubyrobot.org/tutorial/subversion-with-mac-os-x" target="_blank">here</a>; and a more thorough one <a href="http://svnbook.red-bean.com/nightly/en/index.html" target="_blank">here</a>.</p>
<p>2. List of useful commands: <a href="http://www.yolinux.com/TUTORIALS/Subversion.html" target="_blank">here</a>.</p>
<p>3. Conflict resolution: <a href="http://ariejan.net/2007/07/04/how-to-resolve-subversion-conflicts/" target="_blank">here</a>.</p>
<br />Filed under: <a href='http://nixtricks.wordpress.com/category/cli/'>cli</a>, <a href='http://nixtricks.wordpress.com/category/svn/'>svn</a> Tagged: <a href='http://nixtricks.wordpress.com/tag/subversion/'>subversion</a>, <a href='http://nixtricks.wordpress.com/tag/svn/'>svn</a>, <a href='http://nixtricks.wordpress.com/tag/sync/'>sync</a>, <a href='http://nixtricks.wordpress.com/tag/version-control/'>version-control</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/1056/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/1056/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/1056/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/1056/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/1056/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/1056/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/1056/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/1056/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/1056/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/1056/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/1056/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/1056/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/1056/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/1056/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=1056&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2011/03/08/svn-beginners-guide-to-version-control-using-subversion/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[csh] Simple loops in csh or tcsh</title>
		<link>http://nixtricks.wordpress.com/2011/03/03/simple-loops-in-csh-ortcsh/</link>
		<comments>http://nixtricks.wordpress.com/2011/03/03/simple-loops-in-csh-ortcsh/#comments</comments>
		<pubDate>Thu, 03 Mar 2011 08:17:44 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[csh]]></category>
		<category><![CDATA[foreach]]></category>
		<category><![CDATA[loop]]></category>
		<category><![CDATA[tcsh]]></category>
		<category><![CDATA[while]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=1034</guid>
		<description><![CDATA[If you are stuck with a c-shell and you want to print (or execute a command) for an increment, say of 5,  in a variable (for example, $x), then do either of the following: They both print the numbers 1 to 20 in steps of 5. If you want to use it in the command [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=1034&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you are stuck with a c-shell and you want to print (or execute a command) for an increment, say of 5,  in a variable (for example, $x), then do either of the following:</p>
<p><pre class="brush: bash;">
#!/bin/csh
# Exammple: 1
foreach x (`seq 1 5 20`)
     echo $x
end
#EOF</pre></p>
<p><pre class="brush: bash;">
#!/bin/csh
# Example: 2
@ x = 1
while ($x &lt;= 20)
     echo $x
@ x += 5
end
#EOF</pre></p>
<p>They both print the numbers 1 to 20 in steps of 5. If you want to use it in the command line, then you need to type each line (of course, except  <code>#!/bin/csh</code> and <code>#EOF</code>) and hit enter .</p>
<p>If you know all the possible elements (numbers, characters or strings) of the array passed on to <code>x</code> for each <code>foreach</code>, then you may  choose to use the following </p>
<p><pre class="brush: bash;">
#!/bin/csh
# Example: 3
foreach x (1 2 9 40)
     echo $x
end
#EOF</pre></p>
<p>when the elements are 1, 2, 9 and 40; or</p>
<p><pre class="brush: bash;">
#!/bin/csh
# Example: 4
foreach x (*.cpp)
     echo $x
end
#EOF</pre><br />
when the elements are all the filenames ending with .cpp in the current directory.</p>
<p><strong>Update:</strong> The second option (Example: 2) spits out some syntax error message when used in the command line (in the same way as mentioned above). However, it works fine in a script file.</p>
<br />Filed under: <a href='http://nixtricks.wordpress.com/category/csh/'>csh</a> Tagged: <a href='http://nixtricks.wordpress.com/tag/csh/'>csh</a>, <a href='http://nixtricks.wordpress.com/tag/foreach/'>foreach</a>, <a href='http://nixtricks.wordpress.com/tag/loop/'>loop</a>, <a href='http://nixtricks.wordpress.com/tag/tcsh/'>tcsh</a>, <a href='http://nixtricks.wordpress.com/tag/while/'>while</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/1034/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/1034/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/1034/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/1034/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/1034/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/1034/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/1034/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/1034/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/1034/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/1034/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/1034/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/1034/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/1034/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/1034/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=1034&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2011/03/03/simple-loops-in-csh-ortcsh/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[latex] Customize LaTeX table of contents (toc)</title>
		<link>http://nixtricks.wordpress.com/2011/02/19/latex-customize-latex-table-of-contents-toc/</link>
		<comments>http://nixtricks.wordpress.com/2011/02/19/latex-customize-latex-table-of-contents-toc/#comments</comments>
		<pubDate>Sat, 19 Feb 2011 06:51:49 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[latex]]></category>
		<category><![CDATA[publishing]]></category>
		<category><![CDATA[spacing]]></category>
		<category><![CDATA[toc]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=1020</guid>
		<description><![CDATA[Get rid of dots in the LaTeX table of contents (toc): \makeatletter \renewcommand{\@dotsep}{10000} \makeatother &#160; Control horizontal spacing in the TOC entries: \makeatletter \renewcommand*\l@section{\@dottedtocline{1}{0em}{1.8em}} \renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.0em}} \renewcommand*\l@subsubsection{\@dottedtocline{3}{4.3em}{3.0em}} \makeatother The first argument (with 1, 2, and 3) indicates section (1), subsection (2) or subsubsection (3). The second argument indicates the indent from the left and the third [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=1020&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Get rid of dots in the LaTeX table of contents (toc):</p>
<pre>\makeatletter
        \renewcommand{\@dotsep}{10000}
\makeatother</pre>
<p>&nbsp;</p>
<p>Control horizontal spacing in the TOC entries:</p>
<pre>\makeatletter
     \renewcommand*\l@section{\@dottedtocline{1}{0em}{1.8em}}
     \renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.0em}}
     \renewcommand*\l@subsubsection{\@dottedtocline{3}{4.3em}{3.0em}}
\makeatother</pre>
<p>The first argument (with 1, 2, and 3) indicates section (1), subsection (2) or subsubsection (3). The second argument indicates the indent from the left and the third the separation between the number and the text.</p>
<p><strong>Note: </strong>Put these in the &#8220;preamble&#8221; of your LaTeX source code.</p>
<br />Filed under: <a href='http://nixtricks.wordpress.com/category/latex/'>latex</a> Tagged: <a href='http://nixtricks.wordpress.com/tag/latex/'>latex</a>, <a href='http://nixtricks.wordpress.com/tag/publishing/'>publishing</a>, <a href='http://nixtricks.wordpress.com/tag/spacing/'>spacing</a>, <a href='http://nixtricks.wordpress.com/tag/toc/'>toc</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/1020/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/1020/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/1020/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/1020/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/1020/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/1020/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/1020/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/1020/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/1020/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/1020/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/1020/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/1020/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/1020/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/1020/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=1020&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2011/02/19/latex-customize-latex-table-of-contents-toc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[cli] Find out linux distribution and version number</title>
		<link>http://nixtricks.wordpress.com/2010/10/20/cli-find-out-linux-distribution-and-version-number/</link>
		<comments>http://nixtricks.wordpress.com/2010/10/20/cli-find-out-linux-distribution-and-version-number/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 23:53:15 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[cli]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[cat]]></category>
		<category><![CDATA[distro]]></category>
		<category><![CDATA[proc]]></category>
		<category><![CDATA[version]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=1011</guid>
		<description><![CDATA[Use the following command in a terminal: $ cat /proc/version Filed under: cli, linux Tagged: cat, cli, distro, proc, version<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=1011&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Use the following command in a terminal:</p>
<pre>$ cat /proc/version
</pre>
<br />Filed under: <a href='http://nixtricks.wordpress.com/category/cli/'>cli</a>, <a href='http://nixtricks.wordpress.com/category/linux/'>linux</a> Tagged: <a href='http://nixtricks.wordpress.com/tag/cat/'>cat</a>, <a href='http://nixtricks.wordpress.com/tag/cli/'>cli</a>, <a href='http://nixtricks.wordpress.com/tag/distro/'>distro</a>, <a href='http://nixtricks.wordpress.com/tag/proc/'>proc</a>, <a href='http://nixtricks.wordpress.com/tag/version/'>version</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/1011/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/1011/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/1011/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/1011/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/1011/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/1011/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/1011/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/1011/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/1011/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/1011/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/1011/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/1011/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/1011/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/1011/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=1011&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2010/10/20/cli-find-out-linux-distribution-and-version-number/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[mutt] Multiple email accounts using hooks</title>
		<link>http://nixtricks.wordpress.com/2010/05/20/mutt-multiple-email-accounts-using-hooks/</link>
		<comments>http://nixtricks.wordpress.com/2010/05/20/mutt-multiple-email-accounts-using-hooks/#comments</comments>
		<pubDate>Thu, 20 May 2010 23:06:08 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[account-hook]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[folder-hook]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[imap]]></category>
		<category><![CDATA[multiple email]]></category>
		<category><![CDATA[multiple imap]]></category>
		<category><![CDATA[multiple smtp]]></category>
		<category><![CDATA[mutt]]></category>
		<category><![CDATA[smtp]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=996</guid>
		<description><![CDATA[This is a continuation of my effort to configure mutt. This post explains how to set up multiple IMAP and SMTP accounts using account-hook and folder-hook. All the configurations go into the file ~/.mutt/muttrc (or ~/.muttrc, if you prefer). I am assuming that you want to setup mutt for two gmail accounts user1@gmail.com and user2@gmail.com [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=996&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a continuation of my effort to configure mutt. This post explains how to set up multiple IMAP and SMTP accounts using account-hook and folder-hook. All the configurations go into the file ~/.mutt/muttrc  (or ~/.muttrc, if you prefer).</p>
<p>I am assuming that you want to setup mutt for two gmail accounts user1@gmail.com and user2@gmail.com with passwords pass1 and pass2, respectively. I am also assuming that you have saved the passwords in an encrypted file .passwd.gpg in the ~/.secret directory which contains the passwords in the second column as (refer to the <a href="http://nixtricks.wordpress.com/2010/05/05/mutt-configure-mutt-to-receive-email-via-imap-and-send-via-smtp/" target="_blank">previous post</a>):</p>
<pre>GMail1:  pass1
Gmail2:  pass2</pre>
<p>as well as the corresponding signatures  in user1.sig and user2.sig files in ~/.mutt directory.</p>
<p>With the above setup our <code>~/.mutt/muttrc</code> now becomes:</p>
<pre>#-----------------------------------------
# ~/.mutt/muttrc settings for <span style="color:#ff0000;">mutt 1.5.20</span>
# Process the password file first
#-----------------------------------------
set my_tmp=`gpg -o ~/.secret/.tmp -d ~/.secret/.passwd.gpg`
set my_pass1=`awk '/GMail1:/ {print $2}' ~/.secret/.tmp`
set my_pass2=`awk '/GMail2:/ {print $2}' ~/.secret/.tmp`
set my_del=`rm -f ~/.secret/.tmp`
#
#-------------------------------------
# Account Hooks
#-------------------------------------
account-hook . 'unset imap_user <del datetime="2010-10-06T06:33:44+00:00">unset</del> imap_pass' # unset first!
account-hook 'imaps://user1@imap.gmail.com/' "\
              set imap_user=user1 imap_pass=$my_pass1 "
account-hook 'imaps://user2@imap.gmail.com/' "\
              set imap_user=user2 imap_pass=$my_pass2 "
#
#-------------------------------------
# Folders, mailboxes and folder hooks
#-------------------------------------
# Setup for user1:
set folder="imaps://user1@imap.gmail.com/"
mailboxes =INBOX =[Gmail]/Drafts =[Gmail]/'Sent Mail' =[Gmail]/Spam
folder-hook 'imaps://user1@imap.gmail.com' " \
        set     folder=imaps://user1@imap.gmail.com/ \
                postponed=+[Gmail]/Drafts \
                record=+[Gmail]/'Sent Mail' \
                smtp_url=smtps://user1@smtp.gmail.com \
                smtp_pass=$my_pass1 \
                signature=~/.mutt/user1.sig \
                from='User One &lt;user1@gmail.com&gt; ' \
                realname='User One' "
#
# Setup for user2:
set folder="imaps://user2@imap.gmail.com/"
mailboxes =INBOX =[Gmail]/Drafts =[Gmail]/'Sent Mail' =[Gmail]/Spam
folder-hook 'imaps://user2@imap.gmail.com' " \
        set     folder=imaps://user2@imap.gmail.com/ \
                postponed=+[Gmail]/Drafts \
                record=+[Gmail]/'Sent Mail' \
                smtp_url=smtps://user2@smtp.gmail.com \
                smtp_pass=$my_pass2 \
                signature=~/.mutt/user2.sig \
                from='User Two &lt;user2@gmail.com&gt; ' \
                realname='User Two' "
#
#-------------------------------------
# Macros to make life easier
#-------------------------------------
macro index &lt;esc&gt;1 "y1&lt;return&gt;&lt;return&gt;" # ESC+1 takes to first INBOX
macro index &lt;esc&gt;2 "y5&lt;return&gt;&lt;return&gt;" # ESC+2 takes to the second
#
#-------------------------------------
# Mail-check preferences
#-------------------------------------
set timeout=60	#Check for mail every minute
set mail_check=5
#
# EOF</pre>
<p>To configure other nifty options (e.g. color, editor) please refer to the <a href="http://nixtricks.wordpress.com/2010/05/05/mutt-configure-mutt-to-receive-email-via-imap-and-send-via-smtp/" target="_blank">previous post</a>.</p>
<br />Filed under: <a href='http://nixtricks.wordpress.com/category/linux/'>linux</a>, <a href='http://nixtricks.wordpress.com/category/osx/'>osx</a>, <a href='http://nixtricks.wordpress.com/category/unix/'>unix</a> Tagged: <a href='http://nixtricks.wordpress.com/tag/account-hook/'>account-hook</a>, <a href='http://nixtricks.wordpress.com/tag/email/'>email</a>, <a href='http://nixtricks.wordpress.com/tag/folder-hook/'>folder-hook</a>, <a href='http://nixtricks.wordpress.com/tag/hook/'>hook</a>, <a href='http://nixtricks.wordpress.com/tag/imap/'>imap</a>, <a href='http://nixtricks.wordpress.com/tag/multiple-email/'>multiple email</a>, <a href='http://nixtricks.wordpress.com/tag/multiple-imap/'>multiple imap</a>, <a href='http://nixtricks.wordpress.com/tag/multiple-smtp/'>multiple smtp</a>, <a href='http://nixtricks.wordpress.com/tag/mutt/'>mutt</a>, <a href='http://nixtricks.wordpress.com/tag/smtp/'>smtp</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/996/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/996/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/996/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/996/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/996/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/996/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/996/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/996/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/996/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/996/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/996/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/996/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/996/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/996/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=996&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2010/05/20/mutt-multiple-email-accounts-using-hooks/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[emacs] Absolute basics — one step at a time: files, buffers, windows</title>
		<link>http://nixtricks.wordpress.com/2010/05/19/emacs-absolute-basics-%e2%80%94-one-step-at-a-time-files-bufferswindows/</link>
		<comments>http://nixtricks.wordpress.com/2010/05/19/emacs-absolute-basics-%e2%80%94-one-step-at-a-time-files-bufferswindows/#comments</comments>
		<pubDate>Wed, 19 May 2010 20:15:13 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[buffer]]></category>
		<category><![CDATA[minibuffer]]></category>
		<category><![CDATA[window]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=983</guid>
		<description><![CDATA[Manipulate files: 1. C-x C-f Find a file (allows TAB completion) 2.  C-x C-s Save a copy of the current buffer to the corresponding file. If the buffer is not associated with a file, it'll prompt for a file name. 3. C-x s Save some buffers with the option of selectively saving them. Manipulate buffers: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=983&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Manipulate files:</strong></p>
<pre>1. C-x C-f Find a file (allows TAB completion)
2.  C-x C-s Save a copy of the current buffer to
     the corresponding file. If the buffer is not associated
     with a file, it'll prompt for a file name.
3. C-x s Save some buffers with the option of selectively
    saving them.</pre>
<p><strong> Manipulate buffers: </strong></p>
<pre>1. C-x C-b List all buffers
   (then C-x 1 to kill the window showing the list)
2. C-x b Prompts for the buffer to go to (allows tab completion)
3. C-x k Prompts for the buffer name to kill
4. C-x C-q Toggle read-only mode</pre>
<p><strong>Manipulate windows:</strong></p>
<pre>1. C-x 0 Delete current window
2. C-x 1 Delete all but the current window
3. C-x 2 Split the window vertically
    (with a horizontal line in the middle)
4. C-x 3 Split the window horizontally
   (with a vertical line in the middle)
5. C-x o Move to the other window
6. C-M-v Scroll the other window</pre>
<p><strong> Reference: </strong><a href="http://www2.lib.uchicago.edu/keith/tcl-course/emacs-tutorial.html" target="_blank">A tutorial introduction to emacs</a>.</p>
<br />Filed under: <a href='http://nixtricks.wordpress.com/category/emacs/'>emacs</a> Tagged: <a href='http://nixtricks.wordpress.com/tag/buffer/'>buffer</a>, <a href='http://nixtricks.wordpress.com/tag/emacs/'>emacs</a>, <a href='http://nixtricks.wordpress.com/tag/minibuffer/'>minibuffer</a>, <a href='http://nixtricks.wordpress.com/tag/window/'>window</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/983/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/983/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/983/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/983/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/983/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/983/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/983/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/983/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/983/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/983/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/983/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/983/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/983/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/983/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=983&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2010/05/19/emacs-absolute-basics-%e2%80%94-one-step-at-a-time-files-bufferswindows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[emacs] Absolute basics — one step at a time: delete, kill, yank and undo</title>
		<link>http://nixtricks.wordpress.com/2010/05/19/emacs-absolute-basics-%e2%80%94-one-step-at-a-time-delete-kill-yank-and-undo/</link>
		<comments>http://nixtricks.wordpress.com/2010/05/19/emacs-absolute-basics-%e2%80%94-one-step-at-a-time-delete-kill-yank-and-undo/#comments</comments>
		<pubDate>Wed, 19 May 2010 09:16:09 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[kill]]></category>
		<category><![CDATA[undo]]></category>
		<category><![CDATA[yank]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=978</guid>
		<description><![CDATA[Delete (non-retrievable)/ kill (retrievable) Character: 1. C-d forward delete a character 2. Delback backward delete a character Word: 3. M-d forward kill a word 4. M-delback kill the word immediately before the cursor Line: 5. C-k kills upto the end of the line not including the newline charcacter 6. C-u 0 C-k kills upto the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=978&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Delete (non-retrievable)/ kill (retrievable)</strong></p>
<p><em>Character:</em></p>
<pre>   1. C-d forward delete a character
   2. Delback backward delete a character</pre>
<p><em>Word:</em></p>
<pre>   3. M-d forward kill a word
   4. M-delback kill the word immediately before the cursor</pre>
<p><em> Line:</em>
<pre>
   5. C-k  kills upto the end of the line
         not including the newline charcacter
   6. C-u 0 C-k  kills upto the beginning of the line
        not including newline character
        (You may replace "C-u 0" by "M-0", too)</pre>
<p><em> Sentence:</em>
<pre>
   7. M-k  kills upto the end of the sentence
   8. C-u -1 M-k kills upto the beginning of the current sentence</pre>
<p><em> Region:</em>
<pre>
   9. C-spc Set a mark at the current cursor position
  10. C-w kill the region between the current cursor position and
      the previous mark set by C-spc.</pre>
<p><strong>Undo </strong></p>
<pre>   1. C-x u
   2. C-_
   3. C-/</pre>
<p><strong>Yank</strong></p>
<pre>   2. C-y yank previous kill
   3. M-y replace text inserted by previous C-y by the next entry in the "kill ring".</pre>
<p><strong>N.B. </strong></p>
<pre>      1. M-5 C-/ undo last 5 changes
      2. M-2 C-y Yank last kill 5 times
      3. C-x C-s Save all the changes in the current file.</pre>
<br />Filed under: <a href='http://nixtricks.wordpress.com/category/emacs/'>emacs</a> Tagged: <a href='http://nixtricks.wordpress.com/tag/delete/'>delete</a>, <a href='http://nixtricks.wordpress.com/tag/editor/'>editor</a>, <a href='http://nixtricks.wordpress.com/tag/emacs/'>emacs</a>, <a href='http://nixtricks.wordpress.com/tag/kill/'>kill</a>, <a href='http://nixtricks.wordpress.com/tag/undo/'>undo</a>, <a href='http://nixtricks.wordpress.com/tag/yank/'>yank</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/978/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/978/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/978/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/978/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/978/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/978/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/978/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/978/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/978/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/978/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/978/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/978/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/978/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/978/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=978&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2010/05/19/emacs-absolute-basics-%e2%80%94-one-step-at-a-time-delete-kill-yank-and-undo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[emacs] Absolute basics &#8212; one step at a time: cursor movement</title>
		<link>http://nixtricks.wordpress.com/2010/05/19/emacs-absolute-basics-one-step-at-a-time-cursor-movement/</link>
		<comments>http://nixtricks.wordpress.com/2010/05/19/emacs-absolute-basics-one-step-at-a-time-cursor-movement/#comments</comments>
		<pubDate>Wed, 19 May 2010 07:55:45 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[cursor movement]]></category>
		<category><![CDATA[editor]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=966</guid>
		<description><![CDATA[This is a continuation of my effort to get used to emacs editor. I just realized that there is no point in listing all the commands together at one post &#8212; simply because I missed a lot of useful ones the first time. So, let&#8217;s do it step-wise &#8212; one category at a time. Today, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=966&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a continuation of my <a href="http://nixtricks.wordpress.com/category/emacs/" target="_self">effort</a> to get used to emacs editor. I just realized that there is no point in listing all the commands together at one post &#8212; simply because I missed a lot of useful ones the first time. So, let&#8217;s do it step-wise &#8212; one category at a time. Today, just the &#8216;cursor movement&#8217;: (Hit <code>C-h t</code> to get to the inbuilt tutorial)</p>
<p><strong>Lines (vertically):</strong>
<pre>
    1. C-n next line
    2. C-p previous line</pre>
<p><strong>Lines (Horizontally):</strong>
<pre>
    3. C-a Move to the beginning of a line
    4. C-e Move to the end of a line

    5. C-f move forward one character
    6. C-b move backward one character

    7. M-f move forward one word
    8. M-b Move backward one word</pre>
<p><strong>Sentences: </strong></p>
<pre>    5. M-a Move to the beginning of a sentence
    6. M-e Move to the end of a sentence</pre>
<p><strong>Paragraphs:</strong></p>
<pre>    7. M-{ Beginning of a paragraph
    8. M-} End of a paragraph</pre>
<p><strong> Pages: </strong>
<pre>
     9. C-x [ Beginning of the page
   10. C-x ] End of the page</pre>
<p><strong> Buffers:</strong></p>
<pre>   11. M-&lt; Move to the beginning of the current buffer
   12. M-&gt; Move to the end of the current buffer</pre>
<p><strong>N.B.</strong> &#8220;<code>C-u &lt;n&gt;"</code> or <code>"M-&lt;n&gt;"</code> is the command for numeric argument, i.e.</p>
<pre>   1. C-u 7 *  Inserts "*" seven times
   2. M-8 C-f forwards the cursor 8 letters</pre>
<br />Filed under: <a href='http://nixtricks.wordpress.com/category/emacs/'>emacs</a> Tagged: <a href='http://nixtricks.wordpress.com/tag/cursor-movement/'>cursor movement</a>, <a href='http://nixtricks.wordpress.com/tag/editor/'>editor</a>, <a href='http://nixtricks.wordpress.com/tag/emacs/'>emacs</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/966/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/966/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/966/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/966/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/966/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/966/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/966/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/966/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/966/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/966/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/966/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/966/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/966/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/966/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=966&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2010/05/19/emacs-absolute-basics-one-step-at-a-time-cursor-movement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[mutt] Add a signature at the end of outgoing messages in mutt</title>
		<link>http://nixtricks.wordpress.com/2010/05/08/mutt-add-a-signature-at-the-end-of-outgoing-messages-in-mutt/</link>
		<comments>http://nixtricks.wordpress.com/2010/05/08/mutt-add-a-signature-at-the-end-of-outgoing-messages-in-mutt/#comments</comments>
		<pubDate>Sat, 08 May 2010 07:15:08 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[messages]]></category>
		<category><![CDATA[mutt]]></category>
		<category><![CDATA[signaute]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=960</guid>
		<description><![CDATA[Just add your signature in a file, say, ~/.signature and update the ~/.muttrc (or ~/.mutt/muttrc file, depending on where you put all your mutt aliases) by adding the following line: set signature="~/.signature" Filed under: linux, osx, unix Tagged: email, messages, mutt, signaute<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=960&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Just add your signature in a file, say, <code>~/.signature</code> and update the ~/.muttrc (or ~/.mutt/muttrc file, depending on where you put all your mutt aliases) by adding the following line:</p>
<pre>
set signature="~/.signature"
</pre>
<pre></pre>
<br />Filed under: <a href='http://nixtricks.wordpress.com/category/linux/'>linux</a>, <a href='http://nixtricks.wordpress.com/category/osx/'>osx</a>, <a href='http://nixtricks.wordpress.com/category/unix/'>unix</a> Tagged: <a href='http://nixtricks.wordpress.com/tag/email/'>email</a>, <a href='http://nixtricks.wordpress.com/tag/messages/'>messages</a>, <a href='http://nixtricks.wordpress.com/tag/mutt/'>mutt</a>, <a href='http://nixtricks.wordpress.com/tag/signaute/'>signaute</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/960/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/960/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/960/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/960/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/960/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/960/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/960/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/960/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/960/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/960/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/960/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/960/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/960/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/960/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=960&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2010/05/08/mutt-add-a-signature-at-the-end-of-outgoing-messages-in-mutt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[mutt] Configure mutt to receive email via IMAP and send via SMTP</title>
		<link>http://nixtricks.wordpress.com/2010/05/05/mutt-configure-mutt-to-receive-email-via-imap-and-send-via-smtp/</link>
		<comments>http://nixtricks.wordpress.com/2010/05/05/mutt-configure-mutt-to-receive-email-via-imap-and-send-via-smtp/#comments</comments>
		<pubDate>Wed, 05 May 2010 21:50:59 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[.mailcap]]></category>
		<category><![CDATA[.muttrc]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[esmtp]]></category>
		<category><![CDATA[gnupg]]></category>
		<category><![CDATA[gpg]]></category>
		<category><![CDATA[imap]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[mutt]]></category>
		<category><![CDATA[sendmail]]></category>
		<category><![CDATA[smtp]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=946</guid>
		<description><![CDATA[“All mail clients suck. This one [mutt] just sucks less.” Michael Elkins, ca. 1995 Actually I have tried a lot of desktop email clients (viz., Outlook, thunderbird, seamonkey, sylpheed, pine, alpine, claws email, kmail, evolution, opera) and in the long run they all starts sucking at the RAM. Now to be precise, I must tell [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=946&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<blockquote><p>“All mail clients suck. This one [mutt] just sucks less.” Michael Elkins, ca. 1995</p></blockquote>
<p>Actually I have tried a lot of desktop email clients (viz., Outlook, thunderbird, seamonkey, sylpheed, pine, alpine, claws email, kmail, evolution, opera) and in the long run they all starts sucking at the RAM. Now to be precise, I must tell you that it&#8217;s not a full-fledged mail-transfer agent (<a href="http://en.wikipedia.org/wiki/Mail_transfer_agent">MTA</a>), but rather a mail user agent (<a href="http://en.wikipedia.org/wiki/Mail_user_agent">MUA</a>), i.e. just an email client just like those previously mentioned.</p>
<p><span style="font-weight:bold;">Step 1:</span> Create a password file, say ~/.secret/.passwd. Enter the passwords in it as follows and save the file (don&#8217;t worry, we&#8217;re going to encrypt it soon!):</p>
<pre>GMail:    passwd1
Yahoo:    passwd2</pre>
<p><strong>Step 2:</strong> Now encrypt the file with your gpg key (refer to the <a href="http://nixtricks.wordpress.com/2009/10/04/introduction-to-encryption-of-files-using-gpg/" target="_blank">previous post</a> for details). Don&#8217;t forget to delete the unencrypted file.</p>
<pre>$ cd ~/.secret
$ gpg -e .passwd -o .passwd.gpg
$ rm -f .passwd</pre>
<p><span style="font-weight:bold;">Step 3a: </span> back to the home direcotory and modify the ~/.muttrc file: (you may equivalently do the same in ~/.mutt/muttrc)</p>
<pre># Process the password files first
#-------------------------------------
set my_tmpsecret=`gpg -o ~/.secret/.tmp -d ~/.secret/.passwd.gpg`
set my_gpass=`awk '/GMail:/ {print $2}' ~/.secret/.tmp`
set my_ypass=`awk '/Yahoo:/ {print $2}' ~/.secret/.tmp`
set my_del=`rm -f ~/.secret/.tmp`</pre>
<p><strong><em>Note:</em></strong><em> </em>All user-defined variable must start with &#8220;my_&#8221;.</p>
<p><span style="font-weight:bold;">Step 3b: </span>Now set up mutt for IMAP: (let&#8217;s say for GMail)</p>
<pre>set imap_user="gmail.username@gmail.com"
set imap_pass=$my_gpass
set folder="imaps://gmail.username@imap.gmail.com:993/"
set spoolfile="+INBOX"
set postponed="+[Gmail]/Drafts"
set record=+[Gmail]/"Sent Mail"</pre>
<p><span style="font-weight:bold;">Step 3c: </span>Now let&#8217;s say we want to use Yahoo&#8217;s SMTP service to send emails: here&#8217;s how to set it up in ~/.muttrc:</p>
<pre>set smtp_pass=$my_ypass
set smtp_url = "smtp://smtp.yahoo.com:587"  # using port 587 for TLS
set from="yahoo_username@yahoo.com"
set realname="Your Real_Name"</pre>
<p><span style="font-weight:bold;">Step 3d: </span>Set your favorite editor to compose emails next in ~/.muttrc (mine is vim, so&#8230;.)</p>
<pre>set editor='vim + -c "set textwidth=72" -c "set wrap" -c "set nocp" -c "?^$"'</pre>
<p><span style="font-weight:bold;">Step 3e:</span> Other necessary things to put in ~/.muttrc:</p>
<pre>set header_cache=~/.mutt/cache/headers
set message_cachedir=~/.mutt/cache/bodies
set certificate_file=~/.mutt/certificates</pre>
<p><span style="font-weight:bold;">Step 3f: </span>Now time for some pretty color: (add these too to ~/.muttrc)</p>
<p><pre class="brush: bash;">
color  body            brightyellow    black    (((ht|f)tps?)|mailto):(//)?[^\ &quot;\t]*|www\.[-a-z0-9.]+)[^\ .,;\t&amp;gt;&quot;&amp;gt;]
mono   body            bold                     (((ht|f)tps?)|mailto):(//)?[^\ &quot;\t]*|www\.[-a-z0-9.]+)[^\ .,;\t&amp;gt;&quot;&amp;gt;]
color  body            brightmagenta   black   &quot;[-a-z_0-9.]+@[-a-z_0-9.]+&quot;
mono   body            bold                    &quot;[-a-z_0-9.]+@[-a-z_0-9.]+&quot;
color  body            brightyellow    black   &quot;^Good signature&quot;
mono   body            bold                    &quot;^Good signature&quot;
color  body            brightwhite     red     &quot;^Bad signature from.*&quot;
mono   body            bold                    &quot;^Bad signature from.*&quot;
</pre></p>
<p><span style="font-weight:bold;">Step 3g: </span>Some other customizations to put in ~/.muttrc:</p>
<pre>set smart_wrap = yes
set sort = 'threads'
set sort_aux = 'last-date-received'
set imap_check_subscribed
#
ignore "Authentication-Results:"
ignore "DomainKey-Signature:"
ignore "DKIM-Signature:"
hdr_order Date From To Cc
#
set timeout=60	#Check for mail every minute
set mail_check=5</pre>
<p><span style="font-weight:bold;">Step 3h: </span>Now save the file in your home directory and make it readable by none but the current user (you of course!):</p>
<pre>$ chmod 700 ~/.muttrc</pre>
<p><span style="font-weight:bold;">Step 4:</span>Next create the these two directories to save mutt related stuffs:</p>
<pre>$ mkdir .mutt
$ mkdir .mutt/cache</pre>
<p><span style="font-weight:bold;">Step 5:</span>To render the HTML/etc messages correctly create another file ~/.mailcap with the following as its content make it readable by you only (use chmod as above)</p>
<pre>text/html; lynx -dump %s ; copiousoutput</pre>
<p>Change lynx to links/links2/elinks depending what you actually have on your system.</p>
<p><del><span style="font-weight:bold;">Things to do:</span></del><br />
<del> I still cannot use multiple IMAP inboxes at a time &#8212; the account-hook / folder-hook does not seem to work. I need to spend some more time on it.</del></p>
<p>Here&#8217;s <a href="http://nixtricks.wordpress.com/2010/05/20/mutt-multiple-email-accounts-using-hooks/" target="_blank">how</a> to use multiple IMAP accounts in mutt.</p>
<p><span style="font-weight:bold;">References for this post:</span> <a href="http://crunchbanglinux.org/wiki/howto/howto_setup_mutt_with_gmail_imap" target="_blank">Crunchbang Linux site</a> (my latest favorite distro!),<a href="http://www.muttrcbuilder.org/" target="_blank"> muttrc builder</a>, and <a href="http://www.mutt.org/doc/manual/manual.html#toc1" target="_blank">mutt.org</a>, of course. Another <a href="http://ubuntu-tutorials.com/2007/07/08/configuring-mutt-to-use-an-alternate-mta-esmtp/" target="_blank">old reference</a> from the days when mutt wouldn&#8217;t do SMTP. Also look at the references at the end of this wikipedia <a href="http://en.wikipedia.org/wiki/Mutt_(e-mail_client)">page</a>. To build mutt from the source, refer to <a href="http://www.linuxfromscratch.org/blfs/view/svn/basicnet/mutt.html">this</a>.</p>
<p><span style="font-weight:bold;">References for to-do:</span> <a href="http://www.mail-archive.com/mutt-users@mutt.org/msg28399.html" target="_blank">Derkeller </a>and <a href="http://www.mail-archive.com/mutt-users@mutt.org/msg28399.html" target="_blank">mutt-users</a> forum (from 2002!).</p>
<br />Filed under: <a href='http://nixtricks.wordpress.com/category/linux/'>linux</a>, <a href='http://nixtricks.wordpress.com/category/osx/'>osx</a>, <a href='http://nixtricks.wordpress.com/category/unix/'>unix</a> Tagged: <a href='http://nixtricks.wordpress.com/tag/mailcap/'>.mailcap</a>, <a href='http://nixtricks.wordpress.com/tag/muttrc/'>.muttrc</a>, <a href='http://nixtricks.wordpress.com/tag/email/'>email</a>, <a href='http://nixtricks.wordpress.com/tag/encryption/'>encryption</a>, <a href='http://nixtricks.wordpress.com/tag/esmtp/'>esmtp</a>, <a href='http://nixtricks.wordpress.com/tag/gnupg/'>gnupg</a>, <a href='http://nixtricks.wordpress.com/tag/gpg/'>gpg</a>, <a href='http://nixtricks.wordpress.com/tag/imap/'>imap</a>, <a href='http://nixtricks.wordpress.com/tag/mail/'>mail</a>, <a href='http://nixtricks.wordpress.com/tag/mutt/'>mutt</a>, <a href='http://nixtricks.wordpress.com/tag/sendmail/'>sendmail</a>, <a href='http://nixtricks.wordpress.com/tag/smtp/'>smtp</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/946/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/946/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/946/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/946/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/946/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/946/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/946/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/946/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/946/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/946/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/946/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/946/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/946/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/946/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=946&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2010/05/05/mutt-configure-mutt-to-receive-email-via-imap-and-send-via-smtp/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[osx] Fix PDF font display problem on Leopard</title>
		<link>http://nixtricks.wordpress.com/2010/04/10/osx-fix-pdf-font-display-problem-on-leopard/</link>
		<comments>http://nixtricks.wordpress.com/2010/04/10/osx-fix-pdf-font-display-problem-on-leopard/#comments</comments>
		<pubDate>Sun, 11 Apr 2010 03:31:07 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[cli]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[atsserver]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[pdf]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=939</guid>
		<description><![CDATA[If Preview or Skim stops showing current fonts/ symbols in a PDF document on your Mac, you may need to kill ATSServer process to fix this problem: $ killall -u &#60;username&#62; ATSServer﻿ Filed under: cli, osx Tagged: atsserver, cli, leopard, osx, pdf<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=939&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If Preview or Skim stops showing  current fonts/ symbols in a PDF document on your Mac, you may need to kill ATSServer process to fix this problem:</p>
<pre>$ killall -u &lt;username&gt; ATSServer﻿</pre>
<br />Filed under: <a href='http://nixtricks.wordpress.com/category/cli/'>cli</a>, <a href='http://nixtricks.wordpress.com/category/osx/'>osx</a> Tagged: <a href='http://nixtricks.wordpress.com/tag/atsserver/'>atsserver</a>, <a href='http://nixtricks.wordpress.com/tag/cli/'>cli</a>, <a href='http://nixtricks.wordpress.com/tag/leopard/'>leopard</a>, <a href='http://nixtricks.wordpress.com/tag/osx/'>osx</a>, <a href='http://nixtricks.wordpress.com/tag/pdf/'>pdf</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/939/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/939/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/939/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/939/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/939/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/939/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/939/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/939/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/939/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/939/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/939/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/939/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/939/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/939/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=939&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2010/04/10/osx-fix-pdf-font-display-problem-on-leopard/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[osx] Do not let Safari open PDF files by itself &#8212; use an external viewer</title>
		<link>http://nixtricks.wordpress.com/2010/02/13/osx-do-not-let-safari-open-pdf-files-by-itself-use-an-external-viewer/</link>
		<comments>http://nixtricks.wordpress.com/2010/02/13/osx-do-not-let-safari-open-pdf-files-by-itself-use-an-external-viewer/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 08:47:49 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[cli]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[defaults]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[macosx]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[preview]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[skim]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=919</guid>
		<description><![CDATA[Safari (4.0.4) shows PDFs in the browser window by default when you click on a hyperlink to a PDF file. What is happening here is that when you click on the link, Safari downloads the file in the /tmp directory and opens it by itself. I don&#8217;t want that &#8212; I want to open it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=919&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Safari (4.0.4) shows PDFs in the browser window by default when you click on a hyperlink to a PDF file. What is happening here is that when you click on the link, Safari downloads the file in the /tmp directory and opens it by itself. I don&#8217;t want that &#8212; I want to open it in a stand-alone PDF viewer, say Skim, which will allow me to do other PDF-related stuff (e.g. annotation). A command line trick will do the job (enter the following command after the prompt, indicated by $ here, in the terminal):</p>
<div style="border:1px dotted black;padding:1em;">
<pre>$ defaults write com.apple.Safari WebKitOmitPDFSupport -bool YES</pre>
</div>
<p>If you want to go back to the default behavior use the same command but change &#8216;YES&#8217; to &#8216;NO&#8217;.</p>
<p><strong>NOTE</strong>: You may run across a totally different issue which will force you to view a PDF file in the browser window if you have <strong>Adobe reader plugin</strong> installed. In that case just remove that plugin from the following directories:<br />
<code> /Library/"Internet Plug-Ins"<br />
~/Library/"Internet Plug-Ins"</code></p>
<p><em>I have tested this on Mac OSX  - Leopard (10.5.8).</em></p>
<p><strong>Credit:</strong> <a href="http://forums.macrumors.com/showthread.php?t=219856">Mac Rumors forum</a>.</p>
<br />Filed under: <a href='http://nixtricks.wordpress.com/category/cli/'>cli</a>, <a href='http://nixtricks.wordpress.com/category/osx/'>osx</a> Tagged: <a href='http://nixtricks.wordpress.com/tag/adobe/'>adobe</a>, <a href='http://nixtricks.wordpress.com/tag/defaults/'>defaults</a>, <a href='http://nixtricks.wordpress.com/tag/leopard/'>leopard</a>, <a href='http://nixtricks.wordpress.com/tag/mac/'>mac</a>, <a href='http://nixtricks.wordpress.com/tag/macosx/'>macosx</a>, <a href='http://nixtricks.wordpress.com/tag/osx/'>osx</a>, <a href='http://nixtricks.wordpress.com/tag/pdf/'>pdf</a>, <a href='http://nixtricks.wordpress.com/tag/plugin/'>plugin</a>, <a href='http://nixtricks.wordpress.com/tag/preview/'>preview</a>, <a href='http://nixtricks.wordpress.com/tag/safari/'>safari</a>, <a href='http://nixtricks.wordpress.com/tag/skim/'>skim</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/919/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/919/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/919/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/919/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/919/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/919/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/919/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/919/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/919/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/919/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/919/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/919/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/919/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/919/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=919&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2010/02/13/osx-do-not-let-safari-open-pdf-files-by-itself-use-an-external-viewer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[cli] Delete a file whose name starts with a dash</title>
		<link>http://nixtricks.wordpress.com/2010/02/10/cli-delete-a-file-whose-name-start-with-a-dash/</link>
		<comments>http://nixtricks.wordpress.com/2010/02/10/cli-delete-a-file-whose-name-start-with-a-dash/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 08:29:49 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[cli]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[dash]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[remove]]></category>
		<category><![CDATA[rm]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=903</guid>
		<description><![CDATA[Some badly formatted command may lead to a filename with a leading dash in its name, e.g. -bad_file. To delete this file in the command line either of the following commands should be enough: $ rm -- -bad_file OR $ rm ./-bad_file But if the filename is just a dash (-), things may get a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=903&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Some badly formatted command may lead to a filename with a leading dash in its name, e.g. <code>-bad_file</code>. To delete this file in the command line either of the following commands should be enough:</p>
<p><code>$ rm -- -bad_file</code></p>
<p>OR</p>
<p><code>$ rm ./-bad_file</code></p>
<p>But if the filename is just a dash (-), things may get a little tricky. Follow the steps 1&#8211;3 to delete a file named as &#8220; &#8211; &#8221;:</p>
<p>[you may use this method to delete the first file, <code>-bad_file</code> as well]</p>
<p><em>1. Find the inode numbers first. The following command will print the file serial number (inode number)  for each file in the working directory:</em></p>
<p><code>$ ls -li</code></p>
<p><em>2. Then check to see if the inode number (say, 12345) of the culprit, viz. &#8220;  - &#8221;,   corresponds to it correctly (optional step):</em></p>
<p><code>$ find . -inum 12345</code></p>
<p><em>3. If it finds the name of the `culprit&#8217; correctly, which it should if the number is correct, proceed  to remove it:</em></p>
<p><code>$ find . -inum 12345 -exec rm {} \;</code></p>
<p>That&#8217;s it!</p>
<p><strong>Credit:</strong> <a href="http://www.imminentweb.com/technologies/remove-file-whose-name-starts-dash-bash-shell">here</a>.</p>
<br />Filed under: <a href='http://nixtricks.wordpress.com/category/cli/'>cli</a>, <a href='http://nixtricks.wordpress.com/category/linux/'>linux</a>, <a href='http://nixtricks.wordpress.com/category/osx/'>osx</a>, <a href='http://nixtricks.wordpress.com/category/unix/'>unix</a> Tagged: <a href='http://nixtricks.wordpress.com/tag/dash/'>dash</a>, <a href='http://nixtricks.wordpress.com/tag/delete/'>delete</a>, <a href='http://nixtricks.wordpress.com/tag/files/'>files</a>, <a href='http://nixtricks.wordpress.com/tag/remove/'>remove</a>, <a href='http://nixtricks.wordpress.com/tag/rm/'>rm</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/903/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/903/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/903/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/903/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/903/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/903/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/903/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/903/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/903/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/903/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/903/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/903/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/903/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/903/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=903&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2010/02/10/cli-delete-a-file-whose-name-start-with-a-dash/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[osx] Force Safari to open links in a new tab instead of a new window</title>
		<link>http://nixtricks.wordpress.com/2010/02/09/osx-force-safari-to-open-links-in-a-new-tab-instead-of-a-new-window/</link>
		<comments>http://nixtricks.wordpress.com/2010/02/09/osx-force-safari-to-open-links-in-a-new-tab-instead-of-a-new-window/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 05:52:45 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[osx]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[macosx]]></category>
		<category><![CDATA[safari]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=892</guid>
		<description><![CDATA[In my Macbook (Lepard: OSX  version 10.5.8), Safari (version 4.0.4) in general opens a new link in a new window instead of a new tab if the link has target="_blank" attribute. It just gets in my way of organizing things. To force the link open in a new tab use the following command (without my [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=892&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In my Macbook (Lepard: OSX  version 10.5.8), Safari (version 4.0.4) in general opens a new link in a new window instead of a new tab if the link has <code>target="_blank"</code> attribute. It just gets in my way of organizing things.</p>
<p>To force the link open in a new tab use the following command (without my favorite prompt sign &#8220;$&#8221;) in the terminal and restart Safari:<br />
<code><br />
$ defaults write com.apple.Safari TargetedClicksCreateTabs -bool true<br />
</code></p>
<p><strong>Notes: </strong>1. This will open the link in the foreground. Command+click will however open the link the background (even without the above trick).</p>
<p>2. Change `true&#8217; to `false&#8217; to revert back to the default behavior.</p>
<p><strong>Credit:</strong> <a href="http://www.macosxhints.com/article.php?story=2008032109273043">MacOSX hints</a>.</p>
<br />Filed under: <a href='http://nixtricks.wordpress.com/category/osx/'>osx</a> Tagged: <a href='http://nixtricks.wordpress.com/tag/apple/'>apple</a>, <a href='http://nixtricks.wordpress.com/tag/leopard/'>leopard</a>, <a href='http://nixtricks.wordpress.com/tag/mac/'>mac</a>, <a href='http://nixtricks.wordpress.com/tag/macosx/'>macosx</a>, <a href='http://nixtricks.wordpress.com/tag/osx/'>osx</a>, <a href='http://nixtricks.wordpress.com/tag/safari/'>safari</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/892/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/892/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/892/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/892/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/892/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/892/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/892/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/892/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/892/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/892/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/892/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/892/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/892/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/892/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=892&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2010/02/09/osx-force-safari-to-open-links-in-a-new-tab-instead-of-a-new-window/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[zsh] Histroy substitution</title>
		<link>http://nixtricks.wordpress.com/2010/01/29/zsh-histroy-substitution/</link>
		<comments>http://nixtricks.wordpress.com/2010/01/29/zsh-histroy-substitution/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 07:46:57 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[zsh]]></category>
		<category><![CDATA[history]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=886</guid>
		<description><![CDATA[#For Previous Command (for comparison) !-1 repeat whole command !! repeat (shortcut) !:0 command !^ first parameter !:1 first parameter !:1-4 first 4 parameters !$ last parameter !* all parameters !!:s/bash/zsh (or ^bash^zsh) !^:t just file name of first parameter !$:h just path of last parameter !-2$:r just file name without extension of first parameter [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=886&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<pre>#For Previous Command (for comparison)
!-1     repeat whole command
!!      repeat (shortcut)
!:0     command
!^      first parameter
!:1     first parameter
!:1-4   first 4 parameters
!$      last parameter
!*      all parameters
!!:s/bash/zsh (or ^bash^zsh)
!^:t    just file name of first parameter
!$:h    just path of last parameter
!-2$:r  just file name without extension of first parameter

For last but one command
!-2     repeat last but one command
!-2^    first parameter last but one command
!-2$    last parameter last but one command
!-2:2   second parameter of second but last command
!-2:s/bash/zsh substitute bash by zsh in the last but one command
</pre>
<p><em><br />
Most of them are applicable for bash as well.</em><br />
<strong>Credit:</strong> copied from <a href="http://www.rayninfo.co.uk/tips/zshtips.html" target="_blank">here</a>.</p>
<br />Filed under: <a href='http://nixtricks.wordpress.com/category/linux/'>linux</a>, <a href='http://nixtricks.wordpress.com/category/osx/'>osx</a>, <a href='http://nixtricks.wordpress.com/category/unix/'>unix</a>, <a href='http://nixtricks.wordpress.com/category/zsh/'>zsh</a> Tagged: <a href='http://nixtricks.wordpress.com/tag/history/'>history</a>, <a href='http://nixtricks.wordpress.com/tag/shell/'>shell</a>, <a href='http://nixtricks.wordpress.com/tag/zsh/'>zsh</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/886/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/886/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/886/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/886/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/886/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/886/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/886/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/886/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/886/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/886/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/886/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/886/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/886/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/886/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=886&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2010/01/29/zsh-histroy-substitution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[zsh] Command line math functions</title>
		<link>http://nixtricks.wordpress.com/2010/01/29/zsh-command-line-math-functions/</link>
		<comments>http://nixtricks.wordpress.com/2010/01/29/zsh-command-line-math-functions/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 07:31:02 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[zsh]]></category>
		<category><![CDATA[calculator]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[trigonometry]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=882</guid>
		<description><![CDATA[$ zmodload zsh/mathfunc $ echo $(( sin(1/4.0)**2 + cos(1/4.0)**2 - 1 )) -1.1102230246251565e-16 $ echo $(( pi = 4.0 * atan(1.0) )) 3.1415926535897931 $ echo $(( f = sin(0.3) )) 0.29552020666133955 $ print $((1e12 * rand48())) 847909677310.23413 $ print $(( rand48(seed) )) 0.0104348833470027 Notice that zsh/mathfunc must be loaded first! Credit: copied from zsh-lovers. Filed [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=882&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<pre><tt></tt><tt>$ zmodload zsh/mathfunc
$ echo $(( sin(1/4.0)**2 + cos(1/4.0)**2 - 1 ))
  -1.1102230246251565e-16
$ echo $(( pi = 4.0 * atan(1.0) ))
  3.1415926535897931
$ echo $(( f = sin(0.3) ))
  0.29552020666133955
$ print $((1e12 * rand48()))
  847909677310.23413
$ print $(( rand48(seed) ))
  0.0104348833470027</tt></pre>
<p><em>Notice that zsh/mathfunc must be loaded first!</em></p>
<p><strong>Credit:</strong> copied from <a href="http://grml.org/zsh/zsh-lovers.html" target="_blank">zsh-lovers</a>.</p>
<br />Filed under: <a href='http://nixtricks.wordpress.com/category/linux/'>linux</a>, <a href='http://nixtricks.wordpress.com/category/osx/'>osx</a>, <a href='http://nixtricks.wordpress.com/category/unix/'>unix</a>, <a href='http://nixtricks.wordpress.com/category/zsh/'>zsh</a> Tagged: <a href='http://nixtricks.wordpress.com/tag/calculator/'>calculator</a>, <a href='http://nixtricks.wordpress.com/tag/cli/'>cli</a>, <a href='http://nixtricks.wordpress.com/tag/math/'>math</a>, <a href='http://nixtricks.wordpress.com/tag/trigonometry/'>trigonometry</a>, <a href='http://nixtricks.wordpress.com/tag/zsh/'>zsh</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/882/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/882/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/882/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/882/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/882/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/882/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/882/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=882&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2010/01/29/zsh-command-line-math-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[perl] Search and replace text in multiple files from the command line</title>
		<link>http://nixtricks.wordpress.com/2010/01/28/perl-search-and-replace-text-in-multiple-files-from-the-command-line/</link>
		<comments>http://nixtricks.wordpress.com/2010/01/28/perl-search-and-replace-text-in-multiple-files-from-the-command-line/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 05:20:22 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[cli]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[search-n-replace]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=880</guid>
		<description><![CDATA[$ perl -pi -w -e 's/foo/bar/g;' *.txt -e means execute the following line of code. -i means edit in-place -w write warnings -p loop It will search for &#8220;foo&#8221; in files with extension .txt and replace it with &#8220;bar&#8221;. Credit: here. Posted in cli, linux, osx, perl, unix Tagged: cli, linux, perl, search, search-n-replace<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=880&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="color:#000000;"><code>$ perl -pi -w -e 's/foo/bar/g;' *.txt</code></span></p>
<blockquote><p><code>-e means execute the following line of code.<br />
-i means edit in-place<br />
-w write warnings<br />
-p loop</code></p></blockquote>
<p>It will search for &#8220;foo&#8221;  in files with extension .txt and replace it with &#8220;bar&#8221;.</p>
<p><strong>Credit</strong>: <a href="http://www.liamdelahunty.com/tips/linux_search_and_replace_multiple_files.php" target="_blank">here</a>.</p>
<br />Posted in cli, linux, osx, perl, unix Tagged: cli, linux, perl, search, search-n-replace <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/880/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/880/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/880/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/880/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/880/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/880/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/880/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/880/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/880/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/880/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/880/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/880/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/880/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/880/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=880&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2010/01/28/perl-search-and-replace-text-in-multiple-files-from-the-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[unix] Determine who is monopolizing the CPU</title>
		<link>http://nixtricks.wordpress.com/2010/01/19/unix-determine-who-is-monopolizing-the-cpu/</link>
		<comments>http://nixtricks.wordpress.com/2010/01/19/unix-determine-who-is-monopolizing-the-cpu/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 23:36:43 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[cli]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[cpu]]></category>
		<category><![CDATA[egrep]]></category>
		<category><![CDATA[head]]></category>
		<category><![CDATA[pcpu]]></category>
		<category><![CDATA[pid]]></category>
		<category><![CDATA[ps]]></category>
		<category><![CDATA[sort]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=869</guid>
		<description><![CDATA[$ ps -eo pcpu,size:8,user,start_time,pid,args &#124; sort -nk 1 -r &#124;egrep -v "COMMAND&#124;egrep -v&#124;start_time"&#124; head -10 The ps command displays every process (-e) with user-defined format (e.g., -o pcpu). pcpu = CPU usage percentage size = memory size in kB (with 8 character long field &#8212; otherwise the formatting is messed up!) user = user name [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=869&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><code>$ ps -eo pcpu,size:8,user,start_time,pid,args | sort -nk 1 -r |egrep -v "COMMAND|egrep -v|start_time"| head -10 </code></p>
<p>The <code> ps </code> command displays every process (<code>-e</code>) with user-defined format (e.g., <code> -o pcpu</code>).</p>
<p>pcpu = CPU usage percentage<br />
size = memory size in kB (with 8 character long field &#8212; otherwise the formatting is messed up!)<br />
user = user name<br />
start_time = start time<br />
pid = process ID,<br />
args = command being run</p>
<p>The <code> sort </code> command sorts the lines numerically (<code>-n</code>) in the reverse order (<code>-r</code>) based on the first field (<code>-k 1</code>).</p>
<p> Then <code>egrep -v</code> filters the lines that do not match the header (containing COMMAND), egrep and ps commands themselves.</p>
<p>The <code>head -10</code> command filters out top 10 lines from the list generated by previous <code>sort</code>. (Note: here -10 is actually redundant since head command prints out top 10 lines by default, but it is there as a reminder that we can print more lines using a number greater than 10  it if there is a need!)</p>
<p><strong>Credit:</strong> <a href="http://www.cyberciti.biz/tips/how-do-i-find-out-linux-cpu-utilization.html" target="_blank">Nixcraft</a>.</p>
<br />Posted in cli, linux, unix Tagged: cpu, egrep, head, pcpu, pid, ps, sort <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/869/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/869/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/869/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/869/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/869/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/869/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/869/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/869/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/869/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/869/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/869/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/869/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/869/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/869/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=869&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2010/01/19/unix-determine-who-is-monopolizing-the-cpu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[unix] Display the number of processors in the command line</title>
		<link>http://nixtricks.wordpress.com/2010/01/16/unix-display-the-number-of-processors-in-the-command-line/</link>
		<comments>http://nixtricks.wordpress.com/2010/01/16/unix-display-the-number-of-processors-in-the-command-line/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 23:25:50 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[cat]]></category>
		<category><![CDATA[cpu]]></category>
		<category><![CDATA[cpuinfo]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[proc]]></category>
		<category><![CDATA[processors]]></category>
		<category><![CDATA[wc]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=864</guid>
		<description><![CDATA[The information about the CPU  is stored in /proc/cpuinfo. The following command will show you the number of processors by reading that file: $ grep processor /proc/cpuinfo &#124; wc -l A simple $ grep -c processor /proc/cpuinfo should also be enough! Posted in linux, osx, unix Tagged: cat, cpu, cpuinfo, grep, linux, OS, proc, processors, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=864&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The information about the CPU  is stored in /proc/cpuinfo. The following command will show you the number of processors by reading that file:</p>
<p><span style="font-family:Courier New;">$ grep processor /proc/cpuinfo | wc -l</span></p>
<p>A simple<br />
<span style="font-family:Courier New;">$ grep -c processor /proc/cpuinfo </span><br />
should also be enough!</p>
<br />Posted in linux, osx, unix Tagged: cat, cpu, cpuinfo, grep, linux, OS, proc, processors, unix, wc <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/864/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/864/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/864/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/864/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/864/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/864/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/864/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=864&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2010/01/16/unix-display-the-number-of-processors-in-the-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[awk] Display every (n+1)-th line of a file (n=0,1,2&#8230;.)</title>
		<link>http://nixtricks.wordpress.com/2010/01/14/awk-display-every-n1-th-line-of-a-file/</link>
		<comments>http://nixtricks.wordpress.com/2010/01/14/awk-display-every-n1-th-line-of-a-file/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 01:19:52 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[awk]]></category>
		<category><![CDATA[cli]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=860</guid>
		<description><![CDATA[As an example, the following displays every first line and every 3rd line after that in a file file.txt: $ awk 'NR%3==1' file.txt So, if file.txt has 1 in the first line, 2 in the second and so on, then the above command will display 1 in the first line, 4 in the second, 7 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=860&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As an example, the following displays every first line and every 3rd line after that in a file file.txt:</p>
<div>
<div><code>$ awk 'NR%3==1' file.txt</code></div>
<p>So, if file.txt has 1 in the first line, 2 in the second and so on, then the above command will display 1 in the first line, 4 in the second, 7 in the third line and so on until it reaches the end of the file.</p>
<div><strong>Credit:</strong> <a href="http://www.commandlinefu.com/commands/view/4527/every-nth-line-position-awk" target="_blank">Command-line-fu</a></div>
</div>
<br />Posted in awk, cli Tagged: awk, cli <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/860/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/860/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/860/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/860/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/860/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/860/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/860/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/860/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/860/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/860/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/860/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/860/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/860/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/860/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=860&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2010/01/14/awk-display-every-n1-th-line-of-a-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[regex] Reqular expressions: basics reference card</title>
		<link>http://nixtricks.wordpress.com/2010/01/14/regex-reqular-expressions-basics-reference-card/</link>
		<comments>http://nixtricks.wordpress.com/2010/01/14/regex-reqular-expressions-basics-reference-card/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 21:57:51 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[awk]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[regexp]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[search-n-replace]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=855</guid>
		<description><![CDATA[[a-d] – Match one character with in a-d i.e. a, b, c, d [^a-d] – Match one character not in the range a-d \&#60;test\&#62; – Match whole word test test\&#62; – Match words that ends with test \&#60;test\&#62; \1ing – Match following text “test testing”, \1 maps to first tag i.e \(\) x\{5,\} – Match [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=855&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>[a-d]</strong> – Match one character with in a-d i.e. a, b, c, d<br />
<strong>[^a-d]</strong> – Match one character not in the range a-d<br />
<strong>\&lt;test\&gt; </strong>– Match whole word test<br />
<strong>test\&gt; </strong>– Match words that ends with test<br />
<strong>\&lt;test\&gt; \1ing</strong> – Match following text “test testing”, \1 maps to first tag i.e \(\)<br />
<strong>x\{5,\}</strong> – Match at least 5 occurrences of x<br />
<strong>x\{5,9\}</strong> – Match between 5 to 9 times occurrences of x<br />
<strong>^test</strong> – Looks for test at the beginning of a line<br />
<strong>test$ </strong>– Looks for test at the end of the line<br />
<strong>^test$</strong> – Looks for test on a line by itself<br />
<strong>th.t</strong> – “.” matches one character i.e. 4 letters has th + any character and ends with t. Example: this, that are valid matches<br />
<strong>\. </strong>– Look for period, using “\” one can escape metacharacters</p>
<p><em><strong>Search and replace:</strong></em><br />
<strong>:s/\(square\) and \(fair\)/\2 and \1/ </strong>– searches for “square and fair” and replaces it with fair and square</p>
<br />Posted in awk, grep, linux, regex, unix Tagged: regex, regexp, search, search-n-replace <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/855/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/855/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/855/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/855/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/855/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/855/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/855/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/855/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/855/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/855/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/855/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/855/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/855/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/855/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=855&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2010/01/14/regex-reqular-expressions-basics-reference-card/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[cli] Selectively break a string into pieces and display in new lines</title>
		<link>http://nixtricks.wordpress.com/2010/01/14/cli-selectively-break-a-string-into-pieces-and-display-in-new-lines/</link>
		<comments>http://nixtricks.wordpress.com/2010/01/14/cli-selectively-break-a-string-into-pieces-and-display-in-new-lines/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 06:57:36 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[cli]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[$PATH]]></category>
		<category><![CDATA[break]]></category>
		<category><![CDATA[character]]></category>
		<category><![CDATA[echo]]></category>
		<category><![CDATA[new line]]></category>
		<category><![CDATA[printf]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[variable]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=851</guid>
		<description><![CDATA[Display each different part of a string separated by a character, say colon (:), in new lines: Using echo: $ echo -e ${PATH//:/\\n} Using printf: $ printf "%s\n" ${PATH//:/\/* } Here we chose the system $PATH variable whose different parts are separated by colons. Credit: Command-line-fu Posted in cli, unix Tagged: $PATH, break, character, cli, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=851&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Display each different part of a string separated by a character, say colon (:), in new lines:</p>
<p><strong>Using echo:</strong><br />
<code>$ echo -e ${PATH//:/\\n}</code></p>
<p><strong>Using printf:</strong><br />
<code>$ printf "%s\n" ${PATH//:/\/* }</code></p>
<p>Here we chose the system $PATH variable whose different parts are separated by colons.</p>
<p><strong>Credit: </strong><a href="http://www.commandlinefu.com/commands/view/4534/display-path-with-one-line-per-entry" target="_blank">Command-line-fu</a></p>
<br />Posted in cli, unix Tagged: $PATH, break, character, cli, echo, new line, printf, string, variable <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/851/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/851/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/851/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/851/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/851/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/851/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/851/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/851/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/851/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/851/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/851/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/851/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/851/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/851/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=851&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2010/01/14/cli-selectively-break-a-string-into-pieces-and-display-in-new-lines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[unix] Compare the contents of two directories in the command line</title>
		<link>http://nixtricks.wordpress.com/2010/01/11/unix-compare-the-contents-of-two-directories-in-the-command-line/</link>
		<comments>http://nixtricks.wordpress.com/2010/01/11/unix-compare-the-contents-of-two-directories-in-the-command-line/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 02:45:48 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[cli]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[comm]]></category>
		<category><![CDATA[compare]]></category>
		<category><![CDATA[comparison]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ls]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=841</guid>
		<description><![CDATA[The first thing that comes to mind when you try to do any comparison, e.g. between two files or directories, is diff. Here is how it is used to compare two directories, dir-1 and dir-2: $ diff /path_to_dir-1/ /path_to_dir-2/ But if the files are very big in size, diff may take quite a while. Another [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=841&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The first thing that comes to mind when you try to do any comparison, e.g. between two files or directories, is <code>diff. Here is how it is used to compare two directories, dir-1 and dir-2:<br />
</code><code>$ diff /path_to_dir-1/ /path_to_dir-2/</code></p>
<p>But if the files are very big in size, <code> diff</code> may take quite a while.</p>
<p>Another useful utility is <code>comm</code> which is relatively fast for comparison of two <em>files</em>. It prints out the unique lines of file-1 in column 1, that of file-2 in column 2 and the common lines in column 3. The column 1, 2 and 3 may be suppressed by using the flags <code><strong>-1</strong>, <strong>-2</strong></code> and <code><strong>-3</strong>, respectively. So, for example, if we want to see which files are common in dir-1 and dir-2, we may use </code><code>comm</code> with the &#8220;-1&#8221; and &#8220;-2&#8221; flags on the output of the <code>ls</code> command on the directories:<br />
<code>$ comm -1 -2 &lt;(ls /path_to_dir-1/) &lt;(ls /path_to_dir-2/)</code></p>
<p><strong>Note:</strong> Of course, you can do a <code>diff</code> (or better <code>vimdiff</code>) of the outputs of <code>ls</code> as above, but <code>comm</code> still wins over <code>diff/vimdiff</code> because of the option to selectively output common or unique lines. Also notice that these forms are different from the <code>diff</code> mentioned at the top which does the comparison byte-by-byte.</p>
<br />Posted in cli, unix Tagged: cli, comm, compare, comparison, diff, linux, ls, unix <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/841/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/841/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/841/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/841/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/841/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/841/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/841/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/841/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/841/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/841/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/841/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/841/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/841/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/841/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=841&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2010/01/11/unix-compare-the-contents-of-two-directories-in-the-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[fortran] Create a fortran 77 library and link it</title>
		<link>http://nixtricks.wordpress.com/2009/12/23/fortran-create-a-fortran-77-library-and-lin-it/</link>
		<comments>http://nixtricks.wordpress.com/2009/12/23/fortran-create-a-fortran-77-library-and-lin-it/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 08:11:32 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[fortran]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ar]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[f77]]></category>
		<category><![CDATA[g77]]></category>
		<category><![CDATA[gfortran]]></category>
		<category><![CDATA[ifort]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[link]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=829</guid>
		<description><![CDATA[If you have main.f and as the main fortran 77 program and it calls upon subroutines in other files (say, files 1.f, 2.f,&#8230;. 7.f), you can compile as (we&#8217;ll use GNU Fortran compiler as an example) $ gfortran main.f [1-7].f But if you change only one of them (say main.f) and do not touch others [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=829&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you have main.f and as the main fortran 77 program and it calls upon subroutines in other files (say, files 1.f, 2.f,&#8230;. 7.f), you can compile as (we&#8217;ll use GNU Fortran compiler as an example)</p>
<p><code>$ gfortran main.f [1-7].f </code></p>
<p>But if you change only one of them (say main.f) and do not touch others at all, you can make a library out of the unchanging ones and link to the library during compilation:</p>
<p><strong>First, create the library:</strong></p>
<p><code>$ rm -f *.o<br />
$ gfortran -c [1-7].f<br />
$ ar -rcs libmylib.a [1-7].o<br />
</code><br />
This will create the library <code>libmylib</code>. You may put it in convenient location (might I suggest <code>/usr/local/lib/</code> directory?). You can list out the object files by using:<br />
<code> $ ar t libmylib.a </code></p>
<p>Next while compiling main.f, you can <strong>link to the library</strong> in following three ways:<br />
<code> $ gfortran main.f /path_to_the_library/libmylib.a -o executable</code><br />
or<br />
<code> $ gfortran main.f -L/path_to_the_library/ -lmylib -o executable</code><br />
or if the library is in a &#8220;well-define&#8221; library search path, e.g. /usr/local/lib, then<br />
<code> $ gfortran main.f -lmylib</code></p>
<p><strong>Reference:</strong> <a href="http://ubuntuforums.org/showthread.php?t=848390" target="_blank">Ubuntu forum</a>.</p>
<br />Posted in fortran, programming Tagged: ar, compile, f77, fortran, g77, gfortran, ifort, library, link, programming <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/829/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/829/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/829/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/829/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/829/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/829/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/829/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/829/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/829/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/829/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/829/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/829/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/829/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/829/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=829&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2009/12/23/fortran-create-a-fortran-77-library-and-lin-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[zsh] Print the full command line history</title>
		<link>http://nixtricks.wordpress.com/2009/12/03/zsh-print-the-full-command-line-history/</link>
		<comments>http://nixtricks.wordpress.com/2009/12/03/zsh-print-the-full-command-line-history/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 00:58:50 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[zsh]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[history]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=815</guid>
		<description><![CDATA[I recently moved to using zsh instead of bash. (So, you may expect more of my zsh-related posts). Something that bugged me since the beginning is that when I try to see all the commands used previously using history command, zsh does not list all of them! The correct way to get the desired behavior [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=815&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently moved to using zsh instead of bash. (So, you may expect more of my zsh-related posts). Something that bugged me since the beginning is that when I try to see all the commands used previously using <code> history</code> command, zsh does not list all of them! The correct way to get the desired behavior is to use<br />
<code>$ history 1</code><br />
in the command line, which literally means start listing from the 1st command in the history file.</p>
<p>Since we are at it, I though it would be nice to post a nice history related function:</p>
<p><pre class="brush: bash;">
h() { if [ -z &quot;$*&quot; ]; then history 1; else history 1 | egrep &quot;$@&quot;; fi; }
</pre></p>
<p>If you type<br />
<code>$ h ls</code><br />
 it&#8217;ll give you all the history related to the command <code>ls</code>. If it does not follow an argument, then the function just shows normal behavior of &#8220;<code>history 1</code>&#8221; mentioned above.</p>
<br />Posted in zsh Tagged: function, history, zsh <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/815/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/815/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/815/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/815/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/815/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/815/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/815/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/815/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/815/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/815/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/815/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/815/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/815/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/815/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=815&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2009/12/03/zsh-print-the-full-command-line-history/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[wordpress] Insert source codes in your blog with automatic syntax highlighting</title>
		<link>http://nixtricks.wordpress.com/2009/11/23/wordpress-insert-source-codes-in-your-blog-with-automatic-syntax-highlighting/</link>
		<comments>http://nixtricks.wordpress.com/2009/11/23/wordpress-insert-source-codes-in-your-blog-with-automatic-syntax-highlighting/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 00:36:38 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[syntax]]></category>
		<category><![CDATA[syntax highlighting]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=790</guid>
		<description><![CDATA[In order to do language specific syntax highlighting of your source code, replace &#8220;your code goes here&#8221; by your actual code: [sourcecode language="css"] Your code here [/sourcecode] See an example here. For available language options refer to the link below. Reference: WordPress Support. Reference Posted in wordpress Tagged: blog, blogging, html, syntax, syntax highlighting, wordpress<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=790&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In order to do language specific syntax highlighting of your source code, replace &#8220;your code goes here&#8221; by your actual code:</p>
<div style="border:1px dotted black;padding:1em;">[<code>sourcecode language="css"]<br />
Your code here<br />
[/sourcecode]</code></div>
<p>See an example <a href="http://nixtricks.wordpress.com/2009/10/09/bash-ssh-to-remote-server-accessible-only-through-a-central-server/">here</a>.</p>
<p>For available language options refer to the link below.</p>
<p><strong>Reference:</strong> <a href="http://en.support.wordpress.com/code/posting-source-code/" target="_blank">WordPress Support</a>.</p>
<p>Reference</p>
<br />Posted in wordpress Tagged: blog, blogging, html, syntax, syntax highlighting, wordpress <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/790/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/790/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/790/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/790/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/790/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/790/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/790/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/790/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/790/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/790/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/790/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/790/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/790/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/790/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=790&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2009/11/23/wordpress-insert-source-codes-in-your-blog-with-automatic-syntax-highlighting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[cli] Find out success status of a command in BASH/ CSH</title>
		<link>http://nixtricks.wordpress.com/2009/11/20/cli-find-out-success-status-of-a-command-in-bash-csh/</link>
		<comments>http://nixtricks.wordpress.com/2009/11/20/cli-find-out-success-status-of-a-command-in-bash-csh/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 21:10:54 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[csh]]></category>
		<category><![CDATA[$?]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[echo]]></category>
		<category><![CDATA[faliure]]></category>
		<category><![CDATA[return]]></category>
		<category><![CDATA[return value]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[status]]></category>
		<category><![CDATA[success]]></category>
		<category><![CDATA[tcsh]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=783</guid>
		<description><![CDATA[To know the return value of a command, in BASH run $ echo $? and in CSH/ TCSH run $ echo $status which will give you the return value (0 or 1) of the last command (the one issued just before the echo). In both the shells, if the above spits out 0 (zero), it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=783&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>To know the return value of a command, in BASH run<br />
<code> $ echo $?</code><br />
and in CSH/ TCSH run<br />
<code> $ echo $status</code><br />
which will give you the return value (0 or 1) of the last command (the one issued just before the <code> echo</code>).</p>
<p>In both the shells, if the above spits out 0 (zero),  it means the previous command was successfully completed, otherwise it&#8217;ll give rise to 1 (unsuccessful!) &#8212; quite contrary to our concept of 0 being false and 1 being true, eh!</p>
<p><strong>Credit:</strong> <a href="http://oraclespin.wordpress.com/2009/06/14/how-to-find-successfailure-status-of-a-command-in-different-shells/" target="_blank">Oracle Spin</a>.</p>
<br />Posted in bash, cli, csh Tagged: $?, bash, command, csh, echo, faliure, return, return value, shell, status, success, tcsh <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/783/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/783/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/783/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/783/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/783/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/783/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/783/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/783/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/783/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/783/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/783/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/783/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/783/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/783/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=783&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2009/11/20/cli-find-out-success-status-of-a-command-in-bash-csh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[cli] Split a huge file into smaller pieces</title>
		<link>http://nixtricks.wordpress.com/2009/11/11/cli-split-a-huge-file-into-smaller-pieces/</link>
		<comments>http://nixtricks.wordpress.com/2009/11/11/cli-split-a-huge-file-into-smaller-pieces/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 05:55:02 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[cli]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[cat]]></category>
		<category><![CDATA[concatenate]]></category>
		<category><![CDATA[rejoin]]></category>
		<category><![CDATA[split]]></category>
		<category><![CDATA[tar]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=745</guid>
		<description><![CDATA[There may be occasions when you may need to split a huge file  into smaller pieces for storage restrictions (or if you plan on sending them piece-by-piece to a friend!): The following nifty trick (picked up from Commandline-fu) explains how a directory, &#60;dir&#62;, can first be tarred and split into smaller pieces and later rejoined [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=745&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There may be occasions when you may need to split a huge file  into smaller pieces for storage restrictions (or if you plan on sending them piece-by-piece to a friend!):</p>
<p>The following nifty trick (picked up from <a href="http://www.commandlinefu.com/commands/view/4043/split-a-tarball-into-multiple-parts" target="_blank">Commandline-fu</a>) explains how a directory, &lt;dir&gt;, can first be tarred and split into smaller pieces and later rejoined as need arises:</p>
<blockquote>
<pre>$ tar cf - &lt;dir&gt; | split -b&lt;max_size&gt;M - &lt;name&gt;.tar.</pre>
<p>Rejoin later with `cat&#8217; and then extact:</p>
<pre>$ cat .tar.* |tar xf -</pre>
</blockquote>
<p><strong> Credit:</strong> <a href="http://www.commandlinefu.com/commands/view/4043/split-a-tarball-into-multiple-parts" target="_blank">Commandline-fu</a>.</p>
<p><strong>UPDATE:</strong><em> Problems with the first line of the code is fixed. This arose in the first place because when I put &lt;dir&gt; in the  raw HTML box, it just ignored it since &lt;dir&gt; is not a valid HTML tag (as if I wanted it to be!).</em></p>
<br />Posted in cli, linux, unix Tagged: cat, cli, concatenate, rejoin, split, tar <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/745/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=745&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2009/11/11/cli-split-a-huge-file-into-smaller-pieces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[latex] Use ``FiNK&#039;&#039; package to include filenames with special characters</title>
		<link>http://nixtricks.wordpress.com/2009/11/09/latex-use-fink-package-to-include-filenames-with-special-character/</link>
		<comments>http://nixtricks.wordpress.com/2009/11/09/latex-use-fink-package-to-include-filenames-with-special-character/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 00:20:10 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[latex]]></category>
		<category><![CDATA[fink]]></category>
		<category><![CDATA[graphicx]]></category>
		<category><![CDATA[includegraphics]]></category>
		<category><![CDATA[mactex]]></category>
		<category><![CDATA[tetex]]></category>
		<category><![CDATA[texlive]]></category>
		<category><![CDATA[usepackage]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=713</guid>
		<description><![CDATA[LaTeX throws away an error messages when you try to include a file with special characters (in a LaTeX sense, e.g., hyphen, dot, underscore) in its name into the LaTeX source file. The FiNK package lets you get away with that. FiNK is an acronym for File Name Keeper. It&#8217;s not to be confused with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=713&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>LaTeX throws away an error messages when you try to include a file with special characters (in a LaTeX sense, e.g., hyphen, dot, underscore) in its name into the LaTeX source file. The <a href="http://tug.ctan.org/tex-archive/macros/latex/contrib/fink/">F<em>i</em>NK</a> package lets you get away with that. F<em>i</em>NK is an acronym for <strong>Fi</strong>le <strong>N</strong>ame <strong>K</strong>eeper. It&#8217;s not to be confused with the <a href="http://www.finkproject.org/" target="_blank">Fink</a> package for OSX, which allows you to download compiled Open-Source binaries using <code>apt-get</code> in the command line from a common repository.</p>
<p>Here&#8217;s an example of using F<em>i</em>NK package with the <code>includegraphics</code> command:</p>
<div style="border:1px dotted black;padding:1em;">
<pre>\documentclass[11pt]{article}
\usepackage{graphicx, <span style="color:#ff0000;">fink</span>}
\begin{document}
\begin{figure}[h]
        \label{fig:figure_label}
        \centering
        \includegraphics[width=\textwidth]{<span style="color:#ff0000;">file-name_with_special_chars.eps</span>}
        \caption{The caption goes here}
\end{figure}
\end{document}</pre>
</div>
<p>(More about <code> includegraphics</code> was posted awhile ago: <a href="http://nixtricks.wordpress.com/2009/10/26/latex-crop-resize-and-rotate-figures-in-latex/" target="_blank">here</a> and <a href="http://nixtricks.wordpress.com/2009/11/09/latex-multiple-figures-under-the-same-caption-using-subfigure/" target="_blank">here</a>)</p>
<p><strong>F<em>i</em>NK source:</strong> <a href="http://tug.ctan.org/tex-archive/macros/latex/contrib/fink/" target="_self">CTAN</a>.</p>
<p><strong>UPDATE: </strong><em>It seems that with <a href="http://www.tug.org/mactex/2009/" target="_blank">MacTeX 2009</a>, the problem  mentioned at the top does not exist anymore (at least my testings say so)! However, I used to have this problem earlier when I&#8217;d use the <a href="http://www.tug.org/tetex/" target="_blank">TeTeX</a> package (its development was stopped in 2006 and it has been superseded by  <a href="http://www.tug.org/texlive/">TeXLive</a>) on  my Linux box. </em></p>
<br />Posted in latex Tagged: fink, graphicx, includegraphics, latex, mactex, tetex, texlive, usepackage <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/713/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=713&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2009/11/09/latex-use-fink-package-to-include-filenames-with-special-character/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[latex] Multiple figures under the same caption using ``subfigure&#039;&#039;</title>
		<link>http://nixtricks.wordpress.com/2009/11/09/latex-multiple-figures-under-the-same-caption-using-subfigure/</link>
		<comments>http://nixtricks.wordpress.com/2009/11/09/latex-multiple-figures-under-the-same-caption-using-subfigure/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 22:27:38 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[latex]]></category>
		<category><![CDATA[figure]]></category>
		<category><![CDATA[graphicx]]></category>
		<category><![CDATA[includegraphics]]></category>
		<category><![CDATA[pdflatex]]></category>
		<category><![CDATA[picture]]></category>
		<category><![CDATA[subfigure]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=668</guid>
		<description><![CDATA[If you want to put several small figures under the same caption, then you need to include the subfigure (along with  graphicx) package. The format is something like this: % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Contents of main.tex (LaTeX Source) % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %%%%%%%%%   Preamble %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \documentclass[11pt,a4paper]{article} \usepackage{graphicx, subfigure} % %%%%%%%%% The Document starts here %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=668&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you want to put several small figures under the same caption, then you need to include the <a href="http://ctan.org/tex-archive/obsolete/macros/latex/contrib/subfigure/" target="_blank">subfigure</a> (along with  <a href="http://tug.ctan.org/tex-archive/macros/latex/required/graphics/" target="_blank">graphicx</a>) package. The format is something like this:</p>
<div style="border:1px dotted black;padding:1em;">
<pre>%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%            Contents of main.tex (LaTeX Source)                                                                    %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%%%%%%%%%   Preamble %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\documentclass[11pt,a4paper]{article}
\usepackage{graphicx, subfigure}
%
%%%%%%%%% The Document starts here  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\begin{document}
%
Some random text at the beginning of the document ........
%%
% --------------  Include the figures as follows -------------------%
%%
\begin{figure}[ht!]
    \label{fig:subfigures}
    \begin{center}
%
        \subfigure[Caption of First Figure]{%
            \label{fig:first}
            \includegraphics[width=0.4\textwidth]{FirstFigure}
        }%
        \subfigure[Caption of Second Figure]{%
           \label{fig:second}
           \includegraphics[width=0.4\textwidth]{SecondFigure}
        }\\ %  ------- End of the first row ----------------------%
        \subfigure[Caption of Third Figure]{%
            \label{fig:third}
            \includegraphics[width=0.4\textwidth]{ThirdFigure}
        }%
        \subfigure[Caption of Fourth Figure]{%
            \label{fig:fourth}
            \includegraphics[width=0.4\textwidth]{FourthFigure}
        }%
%
    \end{center}
    \caption{%
        The l-o-n-g caption for all the subfigures
        (FirstFigure through FourthFigure) goes here.
     }%
\end{figure}
%%
% -------------- End of figure environment ----------------------%
%%
Some more text before the end ..........
%
\end{document}
%
%%%%%% The End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
</pre>
</div>
<p>It will create two rows of subfigures with two subfigures on each row (needless to say, you must have all those figures, viz. FirstFigure.eps through FourthFigure.eps, in the same directory as the LaTeX source file). The optional argument within the square brackets immediately following the <code>subfigure</code> statement is the caption of the subfigure (besides the main caption for all the subfigures at the end).</p>
<p>Various other options (e.g., cropping, resizing are rotating the figures) for <code>includegraphics</code> were explained awhile <a href="http://nixtricks.wordpress.com/2009/10/26/latex-crop-resize-and-rotate-figures-in-latex/" target="_blank">ago</a>.</p>
<p><strong>Reference:</strong> <a href="http://commons.wikimedia.org/wiki/File:Latex_example_subfig.png" target="_blank">here</a>.</p>
<br />Posted in latex Tagged: figure, graphicx, includegraphics, latex, pdflatex, picture, subfigure <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/668/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/668/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/668/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/668/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/668/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/668/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/668/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=668&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2009/11/09/latex-multiple-figures-under-the-same-caption-using-subfigure/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[linux] How to install compilers on Puppy Linux</title>
		<link>http://nixtricks.wordpress.com/2009/11/08/linux-how-to-install-compilers-on-puppy-linux/</link>
		<comments>http://nixtricks.wordpress.com/2009/11/08/linux-how-to-install-compilers-on-puppy-linux/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 09:46:57 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[compiling]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[puppy]]></category>
		<category><![CDATA[puppy linux]]></category>
		<category><![CDATA[sfs]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=658</guid>
		<description><![CDATA[Recently I have started playing with the Puppy (Puppy Linux 4.3.1, that is). I liked the speed and ease of using it so much that I decided to do a full install on my hard drive. It&#8217;s very lightweight and very fast. However, after the initial phase of likeness, I realized that it is missing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=658&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently I have started playing with the Puppy (Puppy Linux 4.3.1, that is). I liked the speed and ease of using it so much that I decided to do a full install on my hard drive. It&#8217;s very lightweight and very fast.</p>
<p>However, after the initial phase of likeness, I realized that it is missing a lot of things &#8212;- including the build essentials (e.g., gcc).  That means Puppy has trimmed its fat in order to become so lean (the .iso file is about 100 MB)  that it does not have some of the necessary packages &#8212; especially the ones, that someone may need to compile packages from the source code if there is a need. However, the default software suit is very nice and useful: I haven&#8217;t seen such a good collection in a such a lean size before.</p>
<p>But, the tools I was looking for was not in their repository either. After searching in puppy <a href="http://www.murga-linux.com/puppy/" target="_blank">forums</a>, I realized that I need a package called devx-431.sfs [<a href="ftp://ibiblio.org/pub/linux/distributions/puppylinux/puppy-4.3.1/" target="_blank">download link</a>].  But for a hard puppy (a full installation of puppy on the hard drive) it is a special case if you want to install a .sfs file &#8212;- which I had a hard time figuring out skimming through various posts in the forum (which are very old by the way!).</p>
<p>However, it is <a href="http://www.puppylinux.com/hard-puppy.htm" target="_blank">explained</a> in the main <a href="http://www.puppylinux.com/index.html" target="_blank">website</a> in a very clear fashion (I wish I looked there first!).</p>
<blockquote>
<pre>1. Click on the devx_xxx.sfs in a ROX-Filer window to mount it.
2. Open a terminal in the mounted directory.
3. # cp -a --remove-destination ./* /mnt/hda2/
4. # sync
5. Close the terminal.
6. Click on the devx_xxx.sfs file to unmount it</pre>
<p>Note, the &#8216;&#8211;remove-destination&#8217; option is essential. If you only use &#8216;-f&#8217; to force overwrite, it will follow (dereference) a symlink, that can cause unexpected overwrites.</p></blockquote>
<p>I had a problem performing the second step. If you save the devx_xxx.sfs file in the /root directory (which is startup directory, i.e. if you do a &#8220;cd ~&#8221; you&#8217;ll reach there), then the mounted directory will look like &#8220;<code>+root+devx_xxx.sfs/</code>&#8221;. Just cd to there in the console and follow the next steps above.</p>
<p><strong>Credit:</strong> <a href="http://www.puppylinux.com/hard-puppy.htm">here</a>.</p>
<p><strong>Further reading:</strong> <a href="http://lifehacker.com/307542/taking-puppy-linux-for-a-walk" target="_blank">Lifehacker&#8217;s review</a>.</p>
<br />Posted in linux Tagged: compile, compiling, gcc, puppy, puppy linux, sfs <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/658/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/658/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/658/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/658/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/658/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/658/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/658/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=658&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2009/11/08/linux-how-to-install-compilers-on-puppy-linux/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[awk] Output formatting</title>
		<link>http://nixtricks.wordpress.com/2009/11/06/awk-output-formatting/</link>
		<comments>http://nixtricks.wordpress.com/2009/11/06/awk-output-formatting/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 22:18:42 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[awk]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[formatting]]></category>
		<category><![CDATA[I/O]]></category>
		<category><![CDATA[print]]></category>
		<category><![CDATA[printf]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=653</guid>
		<description><![CDATA[If you use print in awk you&#8217;ll lose the formatting of the input file &#8212; most of the times that may be OK, but not always. The solution is simple &#8212; replace print by printf. Here&#8217;s an example with strings in the input fields: $ awk '{printf "%-20s%-20s%-20s\n", $1, $2, $3}' yourfile.dat . &#8220;%&#8230;s&#8221; means [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=653&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you use print in awk you&#8217;ll lose the formatting of the input file &#8212; most of the times that may be OK, but not always. The solution is simple &#8212; replace print by printf. Here&#8217;s an example with strings in the input fields:</p>
<div style="border:1px dotted black;padding:1em;"><code>$ awk '{printf "%-20s%-20s%-20s\n", $1, $2, $3}' yourfile.dat</code></div>
<p><span style="color:#ffffff;">.</span></p>
<ul>
<blockquote>
<li>&#8220;%&#8230;s&#8221; means a character string.</li>
<li>20 means a length of 20 characters.</li>
<li>awk defaults to right-alignment (presumably for columns of figures) so you need -20 for left-alignment.</li>
</blockquote>
</ul>
<p><strong>Credit:</strong> <a href="http://www.computing.net/answers/unix/align-fields-in-columns/5637.html" target="_blank">here</a>.</p>
<br />Posted in awk, linux, osx, unix Tagged: awk, formatting, I/O, print, printf <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/653/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/653/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/653/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/653/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/653/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/653/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/653/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/653/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/653/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/653/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/653/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/653/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/653/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/653/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=653&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2009/11/06/awk-output-formatting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[osx] Restart a frozen Dock from the command line</title>
		<link>http://nixtricks.wordpress.com/2009/11/06/restart-a-frozen-dock-from-the-command-line/</link>
		<comments>http://nixtricks.wordpress.com/2009/11/06/restart-a-frozen-dock-from-the-command-line/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 06:46:13 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[osx]]></category>
		<category><![CDATA[dock]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[macosx]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=649</guid>
		<description><![CDATA[I am having some problem with the X11 lately on my Mac OSX (Leopard). I have not found a solution yet &#8212; when I do I&#8217;ll sure put it up here. But a stuck X11 window in the dock caused it to freeze up. Along with that all the fancy cover switch and other related [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=649&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I am having some problem with the X11 lately on my Mac OSX (Leopard). I have not found a solution yet &#8212; when I do I&#8217;ll sure put it up here. But a stuck X11 window in the dock caused it to freeze up. Along with that all the fancy cover switch and other related stuff are also gone! Luckily the spotlight accepted the Command+spacebar combination and let me find terminal.app from there.</p>
<p>However,  although I knew who the culprit was (using htop) but I cannot kill it (kill -9 kills it, but it revives!). But the following command did the trick:</p>
<div style="border:1px dotted black;padding:1em;"><code>$ killall Dock</code></div>
<p>It&#8217;ll kill the Dock application and then restart it instantly. (Although it did not kill the culprit, x11).</p>
<p>I&#8217;m yet to find a solution for the x11 problem!</p>
<br />Posted in osx Tagged: dock, leopard, mac, macosx, osx <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/649/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/649/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/649/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/649/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/649/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/649/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/649/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/649/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/649/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/649/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/649/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/649/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/649/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/649/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=649&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2009/11/06/restart-a-frozen-dock-from-the-command-line/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[awk] Command line calculator using awk</title>
		<link>http://nixtricks.wordpress.com/2009/11/03/awk-command-line-calculator-using-awk/</link>
		<comments>http://nixtricks.wordpress.com/2009/11/03/awk-command-line-calculator-using-awk/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 00:07:15 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[awk]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[apcalc]]></category>
		<category><![CDATA[arithmetic]]></category>
		<category><![CDATA[atan2]]></category>
		<category><![CDATA[calc]]></category>
		<category><![CDATA[calculator]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[karmic]]></category>
		<category><![CDATA[karmic koala]]></category>
		<category><![CDATA[trigonometry]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[variable]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=623</guid>
		<description><![CDATA[This is an update on our bash command line calculator posted a few days ago &#8212; except for the fact that this time we&#8217;ll use awk to do the calculation instead of bc. As I mentioned in that post, you may use python or ruby (irb) to do the same thing, but these tricks may [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=623&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is an update on our <a title="Bash command line calculator" href="http://nixtricks.wordpress.com/2009/10/06/bash-command-line-calculator/" target="_self">bash command line calculator</a> posted a few days ago &#8212; except for the fact that this time we&#8217;ll use <code>awk</code> to do the calculation instead of <code>bc</code>. As I mentioned in <a href="http://nixtricks.wordpress.com/2009/10/06/bash-command-line-calculator/" target="_blank">that</a> post, you may use python or ruby (irb) to do the same thing, but these tricks may be useful if you don&#8217;t  have ruby or python installed (bc and awk, in general, come by default in any Unix or GNU/Linux distro).</p>
<p>First, create (or rewrite if you used our last <a title="Bash command line calculator" href="http://nixtricks.wordpress.com/2009/10/06/bash-command-line-calculator/" target="_self">trick</a>) function &#8220;<code>?</code>&#8221;  as follows and put it in your <code>~/.bashrc</code> file:</p>
<div style="border:1px dotted black;padding:1em;"><code>? () { awk "BEGIN{ print $* }" ;}</code></div>
<p>and make sure to reload your <code>~/.bashrc</code><code> file (do the similar thing if you're using any other shell). [<strong>NOTE:</strong> ZSH does not like ``?'' as a function, so you might consider replacing it with something reasonable, e.g., ``compute'']<br />
</code></p>
<p>Now, if you want to calculate an expression, do it, for example, as</p>
<div style="border:1px dotted black;padding:1em;"><code>$ ? "2*3+4.0*(9.9+8.1)"</code></div>
<p>and don&#8217;t forget the quotes.</p>
<p><span style="color:#ffffff;">.</span></p>
<p>The advantage of this over <a href="http://nixtricks.wordpress.com/2009/10/06/bash-command-line-calculator/" target="_blank">bc</a> is that you can use more arithmetic and trigonometric functions (<a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?awk" target="_blank">link</a>):</p>
<blockquote>
<pre>              atan2(y,x)     Arctan of y/x between -pi and pi.

	      cos(x)	     Cosine function, x in radians.

	      exp(x)	     Exponential function.

	      int(x)	     Returns x truncated towards zero.

	      log(x)	     Natural logarithm.

	      rand()	     Returns a random number between zero and one.

	      sin(x)	     Sine function, x in radians.

	      sqrt(x)	     Returns square root of x.</pre>
</blockquote>
<p><span style="color:#ffffff;">.</span><br />
You may include variables as well in the function definition itself:</p>
<div style="border:1px dotted black;padding:1em;"><code>? () { awk "BEGIN{ pi = 4.0*atan2(1.0,1.0); degree = pi/180.0; print $* }" ;}</code></div>
<p>where we have defined the variable pi and degree (such that tan(pi/4.0) = 1.0 and pi radians is equivalent to 180 degrees) to be used later, e.g.</p>
<div style="border:1px dotted black;padding:1em;"><code>$ ? "cos(pi)"<br />
$ ? "cos(90*degree)"</code></div>
<p>and I&#8217;m sure that you&#8217;ll get -1 and 0 (within the machine precision), respectively, as the answer!</p>
<p>(You may find some more interesting calculator related tricks posted in this blog scattered in different <a href="http://nixtricks.wordpress.com/tag/calculator/" target="_blank">pages</a>)</p>
<p><strong>Credit:</strong> <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?awk" target="_blank">here</a> and <a href="http://www.commandlinefu.com/commands/view/3871/command-line-calculator" target="_blank">here</a> (via <a href="http://lifehacker.com/5396183/create-an-awesome-command-line-calculator" target="_blank">LifeHacker</a>).</p>
<p><strong>UPDATE:</strong> I just realized that I can use the calc package (besides bc, awk, python and irb) to do the command line math wizardry more efficiently (and let&#8217;s take that as the end to this command line calculator <a href="http://nixtricks.wordpress.com/tag/calculator/" target="_blank">series</a>!). It has a larger set of <a href="http://www.isthe.com/chongo/tech/comp/calc/calc-builtin.html" target="_blank">built-in </a>functions. You may grab the source code from the maintainer&#8217;s <a href="http://www.isthe.com/chongo/tech/comp/calc/" target="_blank">website</a> and follow my <a href="http://nixtricks.wordpress.com/2009/10/31/linux-how-to-install-a-package-from-the-source-code/" target="_blank">instructions</a> to install it on your system [although binaries are also readily available, e.g. <a href="http://packages.ubunut.com/karmic/math/apcalc">apcalc</a> package for Ubuntu 9.10 (Karmic Koala)].</p>
<br />Posted in awk, cli, linux, osx, unix Tagged: apcalc, arithmetic, atan2, awk, calc, calculator, cli, command line, karmic, karmic koala, trigonometry, ubuntu, variable <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/623/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/623/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/623/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/623/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/623/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/623/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/623/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/623/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/623/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/623/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/623/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/623/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/623/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/623/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=623&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2009/11/03/awk-command-line-calculator-using-awk/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[vim] Save and use vim sessions</title>
		<link>http://nixtricks.wordpress.com/2009/11/02/vim-save-and-use-vim-sessions/</link>
		<comments>http://nixtricks.wordpress.com/2009/11/02/vim-save-and-use-vim-sessions/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 06:29:38 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[vim]]></category>
		<category><![CDATA[mksession]]></category>
		<category><![CDATA[saved session]]></category>
		<category><![CDATA[sessions]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[wall]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=604</guid>
		<description><![CDATA[Save your vim session while working on a lot of files opened in different tabs or screens by using :mksession saved_session.vim in one of the vim windows. Note that it does not have to have &#8220;.vim&#8221; extension. After that you can do pretty much anything with your computer (close all windows, reboot, etc.) as long [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=604&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Save your vim session while working on a lot of files opened in different tabs or screens by using</p>
<div style="border:1px dotted black;padding:1em;"><code>:mksession saved_session.vim</code></div>
<p>in one of the vim windows. Note that it does not have to have &#8220;<code>.vim</code>&#8221; extension.</p>
<p>After that you can do pretty much anything with your computer (close all windows, reboot, etc.) as long as you do not deleted the file saved above. You can restore the session while you are in vim by using:</p>
<div style="border:1px dotted black;padding:1em;"><code>:source saved_session.vim</code></div>
<p>or if you want to start vim with the saved session, use this</p>
<div style="border:1px dotted black;padding:1em;"><code>$  vim -S saved_session.vim</code></div>
<p>in the command line.</p>
<p><strong>Application: </strong>(Directly copied from <a title="Directly copied from here" href="http://vimdoc.sourceforge.net/htmldoc/usr_21.html" target="_blank">here</a>)</p>
<blockquote>
<pre>The obvious way to use sessions is when working on different projects.
Suppose you store you session files in the directory "~/.vim".  You are
currently working on the "secret" project and have to switch to the "boring"
project:

<strong>	:wall</strong>
<strong>	:mksession! ~/.vim/secret.vim</strong>
<strong>	:source ~/.vim/boring.vim</strong>

This first uses "<a href="http://vimdoc.sourceforge.net/htmldoc/editing.html#:wall">:wall</a>" to write all modified files.  Then the current session
is saved, using ":mksession!".  This overwrites the previous session.  The
next time you load the secret session you can continue where you were at this
point.  And finally you load the new "boring" session.
</pre>
</blockquote>
<p><strong>Further reading: </strong><a href="http://www.vim.org/scripts/script.php?script_id=2010" target="_blank">here</a> and <a href="http://vimdoc.sourceforge.net/htmldoc/usr_21.html" target="_blank">here</a>.</p>
<br />Posted in linux, osx, vim Tagged: linux, mksession, osx, saved session, sessions, source, ubuntu, vim, wall <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/604/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/604/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/604/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/604/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/604/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/604/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/604/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/604/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/604/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/604/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/604/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/604/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/604/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/604/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=604&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2009/11/02/vim-save-and-use-vim-sessions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[linux] How to install a package from the source code</title>
		<link>http://nixtricks.wordpress.com/2009/10/31/linux-how-to-install-a-package-from-the-source-code/</link>
		<comments>http://nixtricks.wordpress.com/2009/10/31/linux-how-to-install-a-package-from-the-source-code/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 22:35:54 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[darwin]]></category>
		<category><![CDATA[darwinport]]></category>
		<category><![CDATA[fink]]></category>
		<category><![CDATA[gnu make]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[make]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[package]]></category>
		<category><![CDATA[port]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[tar]]></category>
		<category><![CDATA[tarball]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=565</guid>
		<description><![CDATA[Installing a package (AKA software) from source code is often considered to be the secret cult of the worshipers of the Geek God. But, you know, it&#8217;s not that difficult. Let&#8217;s see how we can do it. First, some preliminaries. Why should I build it form the source code? Well, source codes are more or [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=565&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Installing a package (AKA software) from source code is often considered to be the secret cult of the worshipers of the Geek God. But, you know, it&#8217;s not that difficult. Let&#8217;s see how we can do it.</p>
<p>First, some preliminaries. <strong>Why should I build it form the source code?</strong> Well, source codes are more or less platform independent. If you have a suitable compiler and necessary libraries, you may install it on any platform of your choice. Source code files are available  in ASCII plain text  format (not binaries) &#8212; so you can study it and understand what it does and whether/ how it may affect your system. Reading  the description of a software distributed as a binary does not even come close to that &#8212; you really don&#8217;t know what that piece of  software does until you actually run it. Needless to add, you may include your changes to the open-source code to suit your needs as well in accordance with the relevant license.</p>
<p>Secondly, <strong>where can I find the source code?</strong> The source code for a open-source package is often distributed in compressed format (i.e., with an extension &#8220;<code>tar.gz</code>&#8221;, &#8220;<code>tgz</code>&#8221; or &#8220;<code>tar.bz2</code>&#8221; &#8212; that&#8217;s why it&#8217;s also called tarball). You may download the tarball from a reliable source, e.g. homepage of the package developer, <a href="http://directory.fsf.org/" target="_blank">Free Software Directory</a>, <a href="http://www.opensourcesoftwaredirectory.com/" target="_blank">Open Source Software directory</a>, <a href="http://www.linux.org/apps/" target="_blank">linux.org</a>, <a href="http://archive.ubuntu.com/" target="_blank">Ubuntu archive</a>, <a href="http://darwinports.com/">Darwin ports</a>, <a href="http://pdb.finkproject.org/pdb/index.php?phpLang=en" target="_blank">Fink</a> and Open Source Apple <a href="http://www.opensource.apple.com/" target="_blank">website</a>. Last three are specifically intended for OSX running Darwin. Wikipedia also has a nice <a href="http://en.wikipedia.org/wiki/List_of_free_and_open_source_software_packages" target="_blank">list</a> of Free and Open Source softwares.</p>
<p>Now, let&#8217;s do the<strong> installation step-by step.</strong> Create a directory (say, <code>~/packages</code>) where you want to save the packages, navigate to that directory, save the tarball (say, <code>newpack.tar.gz</code>) there and uncompress it:</p>
<div style="border:1px dotted black;padding:1em;"><code> $ tar zxvf newpack.tar.gz</code></div>
<p>Replace &#8220;<code>zxvf</code>&#8221; by &#8220;<code>j</code>xvf&#8221; if it has a &#8220;<code>tar.bz2</code>&#8221; extension instead of &#8220;<code>tar.gz</code>&#8221; or &#8220;<code>tgz</code>&#8221;.</p>
<p>Then navigate to the uncompressed directory (usually <code>newpack</code>, but be sure of  that first using the <code>ls </code> command) using</p>
<div style="border:1px dotted black;padding:1em;"><code>$ cd newpack</code></div>
<p>and read the instruction files (e.g., INSTRUCTIONS, INSTALL, README), if any, for special instructions using your favorite text editor. Otherwise, the normal procedure for installation is the following series of commands: (wait for each one to finish before you issue the next command!)</p>
<div style="border:1px dotted black;padding:1em;"><code> $ ./configure<br />
$ make<br />
$ sudo make install </code></div>
<p>You need to enter the superuser password in the last step as it copies the executable in the system&#8217;s executable directory (e.g., <code>/bin, /sbin/</code>). That&#8217;s it!</p>
<p>However, you may want to <strong>clean up the mess</strong> (especially the object files) created by the installation process using:</p>
<div style="border:1px dotted black;padding:1em;"><code>$ make clean</code></div>
<p>In a spree of cleaning up, however, don&#8217;t delete the file named <code>Makefile</code>: you need this if you want to uninstall the package (the above command won&#8217;t delete it).</p>
<p>In order to<strong> uninstall the package</strong>, navigate to the same directory (<code>~/packages/newpack/</code>), and issue the following command:</p>
<div style="border:1px dotted black;padding:1em;"><code>$ sudo make uninstall</code></div>
<p>You need to enter the superuser password for this.</p>
<p><strong>Reference:</strong> <a href="http://www.tuxfiles.org/linuxhelp/softinstall.html" target="_blank">here</a>.</p>
<br />Posted in linux, osx Tagged: apple, code, darwin, darwinport, fink, gnu make, installation, linux, make, open source, osx, package, port, software, source, source code, tar, tarball, ubuntu <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/565/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/565/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/565/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/565/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/565/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/565/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/565/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/565/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/565/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/565/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/565/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/565/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/565/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/565/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=565&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2009/10/31/linux-how-to-install-a-package-from-the-source-code/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[osx] Eject a volume &#8216;unwilling&#8217; to be ejected!</title>
		<link>http://nixtricks.wordpress.com/2009/10/31/osx-eject-a-volume-unwilling-to-be-ejecte/</link>
		<comments>http://nixtricks.wordpress.com/2009/10/31/osx-eject-a-volume-unwilling-to-be-ejecte/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 18:16:58 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[eject]]></category>
		<category><![CDATA[ejection]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[htop]]></category>
		<category><![CDATA[lsof]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[macosx]]></category>
		<category><![CDATA[processes]]></category>
		<category><![CDATA[ps]]></category>
		<category><![CDATA[top]]></category>
		<category><![CDATA[volume]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=536</guid>
		<description><![CDATA[I sometime have problem finding which persistent process is not letting me eject a volume (CD/DVD/USB drive). The error message is not very helpful at all: Try quitting applications OK, but which one(s)? I often have hard time figuring that out using htop/ top or a combination of ps and grep. But actually this is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=536&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I sometime have problem finding which persistent process is not letting  me eject a volume (CD/DVD/USB drive). The error message is not very helpful at all:</p>
<blockquote><p>Try quitting applications</p></blockquote>
<p>OK, but which one(s)? I often have hard time figuring that out using htop/ top or a combination of ps and grep.</p>
<p>But actually this is what I  want:</p>
<div style="border:1px dotted black;padding:1em;"><code>$ lsof | grep -i Volume_Name</code></div>
<p>where Volume_Name is the name of the volume (or an &#8216;identifying&#8217; part of the name) I want to eject. This gives me the name(s) and process ID(s) of the run-away process(es) as well as the path to the file(s) in use on the volume, Volume_Name.</p>
<p>Now that I know the names I should first try to save the documents and quit the applications involved in the normal way. However, if a particular application does not oblige, I can always kill it (with the risk of potential data loss!) using its process ID (say, 123):</p>
<div style="border:1px dotted black;padding:1em;"><code>$ kill -9 123</code></div>
<p>After that, the ejection of the volume should not be difficult at all.</p>
<p>Needless to say, being a Unix utility, <code>lsof</code> (=&#8220;list open files&#8221;) may be used on other *nix-based systems as well.</p>
<br />Posted in linux, osx, unix Tagged: cli, eject, ejection, grep, htop, linux, lsof, mac, macosx, osx, processes, ps, top, unix, volume <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/536/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/536/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/536/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/536/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/536/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/536/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/536/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/536/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/536/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/536/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/536/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/536/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/536/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/536/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=536&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2009/10/31/osx-eject-a-volume-unwilling-to-be-ejecte/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[vim] Simple calculator in vim</title>
		<link>http://nixtricks.wordpress.com/2009/10/30/vim-simple-calculator-in-vim/</link>
		<comments>http://nixtricks.wordpress.com/2009/10/30/vim-simple-calculator-in-vim/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 02:26:46 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[vim]]></category>
		<category><![CDATA[arithmetic]]></category>
		<category><![CDATA[builtin]]></category>
		<category><![CDATA[calculator]]></category>
		<category><![CDATA[eval]]></category>
		<category><![CDATA[input]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=527</guid>
		<description><![CDATA[Need a simple calculator during editing a file using vim and don&#8217;t want to click away from it? Then first add the following to your ~/.vimrc: imap &#60;silent&#62; &#60;C-C&#62; &#60;C-R&#62;=string(eval(input("Calculate: ")))&#60;CR&#62; In order to use the calculator  while you are editing some file using vim, hit CTRL-C in the insert mode and then enter what [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=527&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Need a simple calculator during editing a file using vim and don&#8217;t want to click away from it? Then first add the following to your <code>~/.vimrc</code>:</p>
<div style="border:1px dotted black;padding:1em;"><code>imap &lt;silent&gt; &lt;C-C&gt; &lt;C-R&gt;=string(eval(input("Calculate: ")))&lt;CR&gt;</code></div>
<p>In order to use the calculator  while you are editing some file using vim, hit CTRL-C in the insert mode and then enter what you want to calculate (e.g., 2+3 or 4.5*7.9).</p>
<blockquote><p>
(It) first calls the built-in <code>input()</code> function to                 request the user to type in their calculation, which                 <code>input()</code> then returns as a string. That input                 string is then passed to the built-in <code>eval()</code>,                 which evaluates it as a Vimscript expression and returns the result. Next,                 the built-in <code>string()</code> function converts the                 numeric result back to a string, which the key-mapping&#8217;s                 <code>&lt;C-R&gt;=</code> sequence is then able to                 insert.</p></blockquote>
<p><strong>Reference:</strong> <a href="http://www.ibm.com/developerworks/linux/library/l-vim-script-1/" target="_blank">here</a>.</p>
<br />Posted in vim Tagged: arithmetic, builtin, calculator, eval, input, linux, vim <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/527/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/527/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/527/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/527/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/527/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/527/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/527/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/527/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/527/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/527/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/527/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/527/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/527/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/527/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=527&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2009/10/30/vim-simple-calculator-in-vim/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[cli] Find out the public IP in the command line</title>
		<link>http://nixtricks.wordpress.com/2009/10/30/cli-find-out-the-public-ip-in-the-command-line/</link>
		<comments>http://nixtricks.wordpress.com/2009/10/30/cli-find-out-the-public-ip-in-the-command-line/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 19:33:17 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[cli]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[ip address]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[public ip]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[suselinux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=513</guid>
		<description><![CDATA[You may find out your IP using commands like ifconfig, but if your computer is behind a firewall, that is not the IP that the world sees. Here&#8217;s a quick how-to to find out what your external IP is. First, let&#8217;s create an alias: (link) alias getip="wget -q -O - http://whatismyip.com/automation/n09230945.asp" Next time when you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=513&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>You may find out your IP using commands like <code>ifconfig</code>, but if your computer is behind a firewall, that is not the IP that the world sees. Here&#8217;s a quick <em>how-to</em> to find out what your external IP is.</p>
<p>First, let&#8217;s create an alias: (<a href="http://www.commandlinefu.com/commands/view/3943/what-is-my-ip">link</a>)</p>
<div style="border:1px dotted black;padding:1em;"><code>alias getip="wget -q -O - http://whatismyip.com/automation/n09230945.asp"</code></div>
<p>Next time when you need the public IP of your computer, just type <code>getip</code> in the command line and hit enter.</p>
<p>The above command gets the IP from http://whatismyip.com/automation/n09230945.asp (just copy and paste this URL to your location bar and hit enter, and see what it does!). The &#8220;<code>-q</code>&#8221; is to suppress verbose information (quiet mode) and &#8220;<code>-O -</code>&#8221; causes the output to be written to STDOUT.</p>
<p>You may use dyndns.org too to find out the IP, but in this case you may need some trimming: substitute the text within the code above by the following:</p>
<blockquote><p><code><br />
wget http://checkip.dyndns.org/ -O - -o /dev/null | cut -d: -f 2 | cut -d\&lt; -f 1</code></p></blockquote>
<p><strong><em>A few words about various flags above:</em></strong><br />
The output of the first command (everything before the first pipe) is</p>
<blockquote><p>&lt;code&gt;&lt;html&gt;&lt;head&gt;&lt;title&gt;Current IP Check&lt;/title&gt;&lt;/head&gt;&lt;body&gt;Current IP Address: xxx.xxx.xx.xx&lt;/body&gt;&lt;/html&gt;</p></blockquote>
<p>(the actual IP address is masked by x).<br />
The &#8220;<code>-o /dev/null</code>&#8220; part  redirects the STDERR of <code>wget</code> to <code>/dev/null</code>. The &#8220;<code>-d :</code>&#8221; option in first &#8220;cut&#8221; tells it to use colon (:) to be used as the delimiter and &#8220;<code>-f 2</code>&#8221; causes it to print second of the delimited fields. Similarly,  the flags of the second &#8220;cut&#8221; cause it to use &#8220;&lt;&#8221; as the delimiter for the piped output from the first &#8220;cut&#8221; and choose the first of the delimited fields.</p>
<p><strong>UPDATE:</strong> Another one using <code>curl</code> [<a href="http://www.commandlinefu.com/commands/view/3946/what-is-my-ip-hardened">link</a>]. You may again change the quoted text within the alias above by the following:</p>
<blockquote><p><code><br />
curl --connect-timeout 3 http://www.whatismyip.org/</code></p></blockquote>
<br />Posted in cli Tagged: cli, command line, curl, ip, ip address, linux, network, public ip, redhat, suselinux, ubuntu, unix, wget <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/513/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/513/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/513/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/513/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/513/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/513/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/513/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/513/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/513/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/513/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/513/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/513/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/513/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/513/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=513&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2009/10/30/cli-find-out-the-public-ip-in-the-command-line/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[latex] Crop, resize and rotate figures in LaTeX</title>
		<link>http://nixtricks.wordpress.com/2009/10/26/latex-crop-resize-and-rotate-figures-in-latex/</link>
		<comments>http://nixtricks.wordpress.com/2009/10/26/latex-crop-resize-and-rotate-figures-in-latex/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 23:33:19 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[latex]]></category>
		<category><![CDATA[clip]]></category>
		<category><![CDATA[crop]]></category>
		<category><![CDATA[figure]]></category>
		<category><![CDATA[includegraphics]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[picture]]></category>
		<category><![CDATA[resize]]></category>
		<category><![CDATA[rotate]]></category>
		<category><![CDATA[textheight]]></category>
		<category><![CDATA[trim]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=467</guid>
		<description><![CDATA[First of all, make sure to include the graphicx package in the preamble of your LaTeX source file. The following command exemplifies how to crop, resize and rotate figures in LaTeX. \begin{figure}[h] \centering \includegraphics[trim=1cm 2cm 3cm 4cm, clip=true, totalheight=0.5\textheight, angle=90]{figure} \caption{The caption goes here} \end{figure} Needless to say, the above goes in between begin{document} and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=467&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>First of all, make sure to include the <code>graphicx</code> package in the preamble of your LaTeX source file. The following command exemplifies how to crop, resize and rotate figures in LaTeX.</p>
<div style="border:1px dotted black;padding:1em;"><code>\begin{figure}[h]<br />
\centering<br />
\includegraphics[trim=1cm 2cm 3cm 4cm, clip=true, totalheight=0.5\textheight, angle=90]{figure}<br />
\caption{The caption goes here}<br />
\end{figure}</code></div>
<p>Needless to say, the above goes in between <code>begin{document}</code> and <code>end{document} statements.</code></p>
<p>Let&#8217;s explain the various parts in the argument of <code>\includegraphics</code> command:</p>
<ul>
<li><strong>Cropping:</strong> &#8220;<code>trim=1cm 2cm 3cm 4cm</code>&#8221; trims (crops) from left, bottom, right and top by 1, 2, 3 and 4cm respectively. It must be accompanied by &#8220;<code>clip=true</code>&#8221;.</li>
<li><strong>Resizing: </strong>&#8220;<code>totalheight=0.5\textheight</code>&#8221; will force the figure to occupy 50% of the page length-wise keeping the aspect ratio constant.</li>
<li><strong>Rotating:</strong> &#8220;<code>angle=90</code>&#8221; rotates the figure by 90 degrees.</li>
</ul>
<p><strong>Reference:</strong> For more options, refer to <a href="http://tex.loria.fr/graph-pack/grf/grf.htm#Q1-1-7" target="_blank">this</a>.</p>
<br />Posted in latex Tagged: clip, crop, figure, includegraphics, latex, linux, picture, resize, rotate, textheight, trim, unix <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/467/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=467&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2009/10/26/latex-crop-resize-and-rotate-figures-in-latex/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
		<item>
		<title>[unix] Change default login shell</title>
		<link>http://nixtricks.wordpress.com/2009/10/26/unix-change-default-login-shell/</link>
		<comments>http://nixtricks.wordpress.com/2009/10/26/unix-change-default-login-shell/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 23:08:38 +0000</pubDate>
		<dc:creator>kousik</dc:creator>
				<category><![CDATA[unix]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[bsd]]></category>
		<category><![CDATA[csh]]></category>
		<category><![CDATA[darwin]]></category>
		<category><![CDATA[ksh]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[macosx]]></category>
		<category><![CDATA[opensuse]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[sh]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tcsh]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://nixtricks.wordpress.com/?p=464</guid>
		<description><![CDATA[I just stumbled upon a few ways to change the default login shell to bash: The easiest one is $ chsh -s /bin/bash username On some machines you may have to use ypcsh instead of chsh. The full path of the shell executable must be specified. But if you have root access you may have [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=464&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I just stumbled upon a few ways to change the default login shell to bash:</p>
<p>The  easiest one is</p>
<blockquote><p><code>$ chsh -s /bin/bash username</code></p></blockquote>
<p>On some machines you may have to use <code>ypcsh</code> instead of <code>chsh</code>. The full path of the shell executable must be specified.</p>
<p>But if you have root access you may have the option to use either of the following two as well:</p>
<ul>
<blockquote>
<li><code> $ usermod -s bash username</code></li>
<li> Change it by editing the entry for the user in <code>/etc/passwd</code> file, manually.</li>
</blockquote>
</ul>
<p>If none of the above works, here&#8217;s a <a href="http://users.ices.utexas.edu/~mclay/bash.html" target="_blank">workaround</a>!</p>
<p><strong>N.B.</strong> Make sure that the desired shell is listed in <code>/etc/shells</code> file.</p>
<br />Posted in unix Tagged: bash, bsd, csh, darwin, ksh, linux, macosx, opensuse, osx, redhat, sh, shell, tcsh, ubuntu, unix <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixtricks.wordpress.com/464/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixtricks.wordpress.com/464/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixtricks.wordpress.com/464/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixtricks.wordpress.com/464/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nixtricks.wordpress.com/464/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nixtricks.wordpress.com/464/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nixtricks.wordpress.com/464/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nixtricks.wordpress.com/464/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixtricks.wordpress.com/464/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixtricks.wordpress.com/464/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixtricks.wordpress.com/464/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixtricks.wordpress.com/464/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixtricks.wordpress.com/464/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixtricks.wordpress.com/464/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixtricks.wordpress.com&amp;blog=9222661&amp;post=464&amp;subd=nixtricks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nixtricks.wordpress.com/2009/10/26/unix-change-default-login-shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">kousik</media:title>
		</media:content>
	</item>
	</channel>
</rss>
