<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns: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:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Tech@Sakana - A sysadmin's blog</title>
	
	<link>http://www.sakana.fr/blog</link>
	<description>Tech tips for the sysadmin (Solaris, Linux, Unix, Windows), networking stuff, coding / scripting (shell, perl), and so much more !</description>
	<lastBuildDate>Wed, 09 May 2012 06:02:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/sakana/articles" /><feedburner:info uri="sakana/articles" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by/2.5/</creativeCommons:license><xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /><image><link>http://www.sakana.fr/blog/</link><url>http://www.feedburner.com/fb/images/pub/fb_pwrd.gif</url><title>Tech@Sakana</title></image><feedburner:emailServiceId>sakana/articles</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Facebook : How to remove an event you’ve been invited to without responding</title>
		<link>http://feedproxy.google.com/~r/sakana/articles/~3/0ohrQ7bmo6M/</link>
		<comments>http://www.sakana.fr/blog/2012/05/09/facebook-how-to-remove-an-event-youve-been-invited-to-without-responding/#comments</comments>
		<pubDate>Wed, 09 May 2012 05:57:45 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[facebook]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=585</guid>
		<description><![CDATA[Just because I struggle every time to find how to do that, here&#8217;s the procedure to delete an event without responding : Click on events Click on the event you want to get rid of In the guest list you&#8217;ll see yourself as well as your invited friends. There&#8217;s a cross beside your name. Click [...]<p><a href="http://www.sakana.fr/blog/2012/05/09/facebook-how-to-remove-an-event-youve-been-invited-to-without-responding/">Facebook : How to remove an event you&#8217;ve been invited to without responding</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Just because I struggle every time to find how to do that, <strong>here&#8217;s the procedure to delete an event without responding</strong> :</p>
<ol>
<li>Click on events</li>
<li>Click on the event you want to get rid of</li>
<li>In the guest list you&#8217;ll see yourself as well as your invited friends. There&#8217;s a cross beside your name. Click on it to remove yourself</li>
</ol>
<p><strong>BAM ! DONE !</strong></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-4571688872511149";
/* 728x90, created 10/17/09 */
google_ad_slot = "0784069657";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p><a href="http://www.sakana.fr/blog/2012/05/09/facebook-how-to-remove-an-event-youve-been-invited-to-without-responding/">Facebook : How to remove an event you&#8217;ve been invited to without responding</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sakana/articles?a=0ohrQ7bmo6M:HuGqJulKh1s:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sakana/articles?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=0ohrQ7bmo6M:HuGqJulKh1s:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=0ohrQ7bmo6M:HuGqJulKh1s:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=0ohrQ7bmo6M:HuGqJulKh1s:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=0ohrQ7bmo6M:HuGqJulKh1s:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=0ohrQ7bmo6M:HuGqJulKh1s:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=0ohrQ7bmo6M:HuGqJulKh1s:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=0ohrQ7bmo6M:HuGqJulKh1s:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/sakana/articles?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/sakana/articles/~4/0ohrQ7bmo6M" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2012/05/09/facebook-how-to-remove-an-event-youve-been-invited-to-without-responding/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.sakana.fr/blog/2012/05/09/facebook-how-to-remove-an-event-youve-been-invited-to-without-responding/</feedburner:origLink></item>
		<item>
		<title>Linux : Encrypted LVM quick and easy howto</title>
		<link>http://feedproxy.google.com/~r/sakana/articles/~3/yTJMT1vZWcQ/</link>
		<comments>http://www.sakana.fr/blog/2012/04/17/linux-encrypted-lvm-quick-and-easy-howto-2/#comments</comments>
		<pubDate>Tue, 17 Apr 2012 20:17:38 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Systems]]></category>
		<category><![CDATA[cryptsetup]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lvm]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=568</guid>
		<description><![CDATA[The goal of this tutorial is to show you how to create an encrypted LVM on Linux. This will help you keep your data safe in the event of, for example, your laptop computer being stolen. Why an encrypted LVM ? Why an encrypted LVM ? Well, we could have stopped at an encrypted partition [...]<p><a href="http://www.sakana.fr/blog/2012/04/17/linux-encrypted-lvm-quick-and-easy-howto-2/">Linux : Encrypted LVM quick and easy howto</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>The goal of this tutorial is to show you how to create an encrypted LVM on Linux. This will help you keep your data safe in the event of, for example, your laptop computer being stolen.</p>
<p><span id="more-568"></span></p>
<h2>Why an encrypted LVM ?</h2>
<p>Why an encrypted LVM ? Well, we could have stopped at an encrypted partition but, once we get there, it&#8217;s not much harder to reap the benefits (in term of fexibility) of the added LVM layer.</p>
<p>So basically :</p>
<ul>
<li>Encryption for security : making sure the data will be accessible only by you</li>
<li>LVM for flexibility : being able to allocate only portions of the encrypted volume at a time, growing them when needed, and so on.</li>
</ul>
<p>We&#8217;ll follow a step by step procedure to get you through it, hopefully painlessly. In the end, you&#8217;ll have :</p>
<ul>
<li>a GPG password protected keyfile</li>
<li>which will be required to access the encrypted disk partition</li>
<li>on top of which will sit one or more LVM volumes</li>
</ul>
<h2>Setting up the encryption</h2>
<p>We are going to use the <code>cryptsetup</code> tool to setup the encryption.</p>
<h3>Generate a GPG password protected key</h3>
<p>You could stick with a regular password keyfile, but it would mean that this file would be the only requirement to accessing your protected data.  Adding GPG into the mix makes sure that an additional password (hopefully one only you know) will be required.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p568code19'); return false;">View Code</a> TXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p56819"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p568code19"><pre class="txt" style="font-family:monospace;">kattoo@roadrunner ~ % dd if=/dev/urandom count=1 | gpg --symmetric -a &gt; key.gpg
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.000102417 s, 5.0 MB/s</pre></td></tr></table></div>

<p>You&#8217;ll then be prompted to enter a password. Choose it wisely because the safety of your data depends on it.</p>
<p>Keep that file preciously. If you lose it, there won&#8217;t be any way to access your data anymore.</p>
<p>Don&#8217;t let anyone access it.</p>
<h3>Nuking previous content of the disk / partition</h3>
<p>It is generally advised to randomize the disk data before setting up encryption. This serves a double purpose :</p>
<ol>
<li>it ensures that no previous data will be available (better safe than sorry)</li>
<li>once the encryption is setup, it will make the actual data less easy to spot in the middle of the random noise (encrypted data will look like random bits in the middle of random bits)</li>
</ol>
<p>There are many ways to randomize the harddisk content : we&#8217;ll create a temporary key, encrypt the volume with it, then fill it with encrypted zeroes.</p>
<p>I&#8217;ll just show the procedure below, if it doesn&#8217;t quite make sense right now just keep reading, I&#8217;ll detail the steps when we&#8217;ll do the permanent encryption.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p568code20'); return false;">View Code</a> TXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p56820"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p568code20"><pre class="txt" style="font-family:monospace;">root@roadrunner ~ # cd /tmp</pre></td></tr></table></div>

<p>Creating a temporary random key :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p568code21'); return false;">View Code</a> TXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p56821"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p568code21"><pre class="txt" style="font-family:monospace;">root@roadrunner tmp # dd if=/dev/urandom count=1 of=tmp_key
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.000112387 s, 4.6 MB/s</pre></td></tr></table></div>

<p>Using it to create / open the encrypted LUKS device from the partition. We&#8217;ll use the <code>/dev/sdb1</code> device as an example. <em>Pick yours carefully because all data stored on it will be nuked.</em></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p568code22'); return false;">View Code</a> TXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p56822"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p568code22"><pre class="txt" style="font-family:monospace;">root@roadrunner tmp # cat /tmp/tmp_key | cryptsetup luksFormat /dev/sdb1
root@roadrunner tmp # cat /tmp/tmp_key | cryptsetup luksOpen /dev/sdb1 tmpVault</pre></td></tr></table></div>

<p>Filling that encrypted partition with encrypted zeroes :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p568code23'); return false;">View Code</a> TXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p56823"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p568code23"><pre class="txt" style="font-family:monospace;">root@roadrunner tmp # dd if=/dev/zero bs=1M of=/dev/mapper/tmpVault 
dd: writing `/dev/mapper/tmpVault': No space left on device
246+0 records in
245+0 records out
257393664 bytes (257 MB) copied, 22.5508 s, 11.4 MB/s</pre></td></tr></table></div>

<p>Closing the encrypted zero filled device :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p568code24'); return false;">View Code</a> TXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p56824"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p568code24"><pre class="txt" style="font-family:monospace;">root@roadrunner tmp # cryptsetup luksClose tmpVault</pre></td></tr></table></div>

<p>And finally, deleting the temporary key :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p568code25'); return false;">View Code</a> TXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p56825"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p568code25"><pre class="txt" style="font-family:monospace;">root@roadrunner tmp # rm tmp_key</pre></td></tr></table></div>

<p>The device is now left filled with random data.</p>
<h3>Generate and encrypted LUKS device</h3>
<p>We&#8217;ll use <code>cryptsetup</code> with LUKS extensions to deal with the encryption part.  It&#8217;s pretty easy to use with the default options, but make sure to read the <code>cryptsetup</code> manpage for the fancy options and extra security.</p>
<p>From there on, you&#8217;ll need to be root.</p>
<p>We&#8217;ll use the <code>/dev/sdb1</code> device as an example. <em>Pick yours carefully because all data stored on it will be nuked.</em></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p568code26'); return false;">View Code</a> TXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p56826"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p568code26"><pre class="txt" style="font-family:monospace;">root@roadrunner ~ # gpg -d ~kattoo/key.gpg | cryptsetup luksFormat /dev/sdb1
gpg: CAST5 encrypted data
gpg: encrypted with 1 passphrase
gpg: WARNING: message was not integrity protected
root@roadrunner ~ #</pre></td></tr></table></div>

<p>You&#8217;ll be prompted for the key password. This will then be fed to <code>cryptsetup</code> which will use it to create the encrypted partition.</p>
<h3>Open the encrypted LUKS device</h3>
<p>To make the encrypted LUKS device available to the system, you need to open it :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p568code27'); return false;">View Code</a> TXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p56827"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p568code27"><pre class="txt" style="font-family:monospace;">root@roadrunner ~ # gpg -d ~kattoo/key.gpg | cryptsetup luksOpen /dev/sdb1 vault
gpg: CAST5 encrypted data
gpg: encrypted with 1 passphrase
gpg: WARNING: message was not integrity protected
root@roadrunner ~ #</pre></td></tr></table></div>

<p><code>vault</code> is a symbolic name, you can pick up what you like and it will help you identify the devices if you have more than one of them.</p>
<p>The encrypted block device will now show up into <code>/dev/mapper</code> :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p568code28'); return false;">View Code</a> TXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p56828"><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p568code28"><pre class="txt" style="font-family:monospace;">root@roadrunner ~ # ls -l /dev/mapper/
total 0
crw------- 1 root root 10, 236 Apr 17 05:31 control
[...]
lrwxrwxrwx 1 root root       7 Apr 17 17:59 vault -&gt; ../dm-5
[...]
root@roadrunner ~ #</pre></td></tr></table></div>

<p>This device is suitable for being used in LVM.</p>
<p><!--adsense--></p>
<h2>Setting up the volumes</h2>
<p>It is really beyond this tutorial to give a full explanation of the Linux LVM, so if you are not familiar with the concepts, make sure you pick up one the the many tutorials you&#8217;ll find on the internet.</p>
<p>For this tutorial, we&#8217;ll create 2 volumes on that encrypted disk.</p>
<p>Let&#8217;s create the physical volume encapsulating the encrypted device :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p568code29'); return false;">View Code</a> TXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p56829"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p568code29"><pre class="txt" style="font-family:monospace;">root@roadrunner tmp # pvcreate /dev/mapper/vault
  Writing physical volume data to disk &quot;/dev/mapper/vault&quot;
  Physical volume &quot;/dev/mapper/vault&quot; successfully created
root@roadrunner tmp #</pre></td></tr></table></div>

<p>Let&#8217;s create the volume group containing that physical volume :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p568code30'); return false;">View Code</a> TXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p56830"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p568code30"><pre class="txt" style="font-family:monospace;">root@roadrunner tmp # vgcreate vg_vault /dev/mapper/vault 
  Volume group &quot;vg_vault&quot; successfully created
root@roadrunner tmp #</pre></td></tr></table></div>

<p>Now let&#8217;s create the logical volumes on top of that volume group. We&#8217;ll create 2 of them for the example :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p568code31'); return false;">View Code</a> TXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p56831"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p568code31"><pre class="txt" style="font-family:monospace;">root@roadrunner tmp # lvcreate -n lv_vault_01 -L 80M vg_vault
  Logical volume &quot;lv_vault_01&quot; created
root@roadrunner tmp # lvcreate -n lv_vault_02 -L 80M vg_vault
  Logical volume &quot;lv_vault_02&quot; created
root@roadrunner tmp #</pre></td></tr></table></div>

<p>Those 2 volumes will now show up in  <code>/dev/mapper</code> as well as in <code>/dev/vg_vault</code> :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p568code32'); return false;">View Code</a> TXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p56832"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code" id="p568code32"><pre class="txt" style="font-family:monospace;">root@roadrunner tmp # ls -l /dev/mapper/
total 0
crw------- 1 root root 10, 236 Apr 17 05:31 control
[...]
lrwxrwxrwx 1 root root       7 Apr 17 21:40 vault -&gt; ../dm-5
[...]
lrwxrwxrwx 1 root root       7 Apr 17 21:40 vg_vault-lv_vault_01 -&gt; ../dm-6
lrwxrwxrwx 1 root root       7 Apr 17 21:40 vg_vault-lv_vault_02 -&gt; ../dm-7
root@roadrunner tmp # ls -l /dev/vg_vault/
total 0
lrwxrwxrwx 1 root root 7 Apr 17 21:40 lv_vault_01 -&gt; ../dm-6
lrwxrwxrwx 1 root root 7 Apr 17 21:40 lv_vault_02 -&gt; ../dm-7
root@roadrunner tmp #</pre></td></tr></table></div>

<p>You can now proceed to create the filesystems on those logical volumes and mount them as usual.</p>
<p>Create the mount points :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p568code33'); return false;">View Code</a> TXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p56833"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p568code33"><pre class="txt" style="font-family:monospace;">root@roadrunner tmp # mkdir /mnt/vault01
root@roadrunner tmp # mkdir /mnt/vault02</pre></td></tr></table></div>

<p>Create the filesystems :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p568code34'); return false;">View Code</a> TXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p56834"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
</pre></td><td class="code" id="p568code34"><pre class="txt" style="font-family:monospace;">root@roadrunner tmp # mkfs /dev/vg_vault/lv_vault_01 
mke2fs 1.42 (29-Nov-2011)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
20480 inodes, 81920 blocks
4096 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
10 block groups
8192 blocks per group, 8192 fragments per group
2048 inodes per group
Superblock backups stored on blocks: 
        8193, 24577, 40961, 57345, 73729
&nbsp;
Allocating group tables: done                            
Writing inode tables: done                            
Writing superblocks and filesystem accounting information: done 
&nbsp;
root@roadrunner tmp # mkfs /dev/vg_vault/lv_vault_02
mke2fs 1.42 (29-Nov-2011)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
20480 inodes, 81920 blocks
4096 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
10 block groups
8192 blocks per group, 8192 fragments per group
2048 inodes per group
Superblock backups stored on blocks: 
        8193, 24577, 40961, 57345, 73729
&nbsp;
Allocating group tables: done                            
Writing inode tables: done                            
Writing superblocks and filesystem accounting information: done</pre></td></tr></table></div>

<p>Mount the filesystems into their mount points :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p568code35'); return false;">View Code</a> TXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p56835"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p568code35"><pre class="txt" style="font-family:monospace;">root@roadrunner tmp # mount /dev/vg_vault/lv_vault_01 /mnt/vault01
root@roadrunner tmp # mount /dev/vg_vault/lv_vault_02 /mnt/vault02</pre></td></tr></table></div>

<p>Let&#8217;s control that everything went fine :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p568code36'); return false;">View Code</a> TXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p56836"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p568code36"><pre class="txt" style="font-family:monospace;">root@roadrunner tmp # df -h /mnt/vault0*
Filesystem                        Size  Used Avail Use% Mounted on
/dev/mapper/vg_vault-lv_vault_01   78M  1.6M   72M   3% /mnt/vault01
/dev/mapper/vg_vault-lv_vault_02   78M  1.6M   72M   3% /mnt/vault02</pre></td></tr></table></div>

<p>Alright, everything you would put into /mnt/vault01 and /mnt/vault02 would be stored on the encrypted device.</p>
<h2>A word of caution</h2>
<p>This is nothing but a step in securing your data. For example, if you store your precious data onto such encrypted volume only to open it later with a software which will store temporary files on an un-encrypted /tmp, the whole setup doesn&#8217;t make much sense.</p>
<p>Common practice is to encrypt the swap spaces, as well as /tmp. Unfortunately, this gets really distro-specific and you&#8217;ll need to dig into the manual of your favorite Linux distribution.</p>
<p>I hope you&#8217;ll have fount this tutorial useful. Don&#8217;t hesitate to hit the comments if you see any omission or correction !</p>
<p><!--adsense--></p>
<p><a href="http://www.sakana.fr/blog/2012/04/17/linux-encrypted-lvm-quick-and-easy-howto-2/">Linux : Encrypted LVM quick and easy howto</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sakana/articles?a=yTJMT1vZWcQ:g565LGXQL0g:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sakana/articles?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=yTJMT1vZWcQ:g565LGXQL0g:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=yTJMT1vZWcQ:g565LGXQL0g:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=yTJMT1vZWcQ:g565LGXQL0g:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=yTJMT1vZWcQ:g565LGXQL0g:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=yTJMT1vZWcQ:g565LGXQL0g:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=yTJMT1vZWcQ:g565LGXQL0g:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=yTJMT1vZWcQ:g565LGXQL0g:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/sakana/articles?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/sakana/articles/~4/yTJMT1vZWcQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2012/04/17/linux-encrypted-lvm-quick-and-easy-howto-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.sakana.fr/blog/2012/04/17/linux-encrypted-lvm-quick-and-easy-howto-2/</feedburner:origLink></item>
		<item>
		<title>OpenBSD : Read only Compact Flash installation</title>
		<link>http://feedproxy.google.com/~r/sakana/articles/~3/TsVvJs5ffRM/</link>
		<comments>http://www.sakana.fr/blog/2012/03/11/openbsd-read-only-compact-flash-installation/#comments</comments>
		<pubDate>Sun, 11 Mar 2012 07:08:12 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Systems]]></category>
		<category><![CDATA[openbsd]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=549</guid>
		<description><![CDATA[Here are a couple of pointers to perform an installation of OpenBSD on a media which will be read-only most of the times. I hope I didn&#8217;t forget anything otherwise I&#8217;ll be in trouble next time I reinstall&#8230; &#160; fstab ?View Code TEXT1 2 3 4 5 6 7 8 9 10 11 $ cat [...]<p><a href="http://www.sakana.fr/blog/2012/03/11/openbsd-read-only-compact-flash-installation/">OpenBSD : Read only Compact Flash installation</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Here are a couple of pointers to perform an installation of OpenBSD on a media which will be read-only most of the times. I hope I didn&#8217;t forget anything otherwise I&#8217;ll be in trouble next time I reinstall&#8230; <img src='http://www.sakana.fr/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
&nbsp;</p>
<p><span id="more-549"></span></p>
<h3>fstab</h3>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p549code41'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p54941"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code" id="p549code41"><pre class="text" style="font-family:monospace;">$ cat /etc/fstab                                                               
/dev/wd0a / ffs ro,noatime,softdep 1 1
/dev/wd0d /mfs_backup ffs ro,nosuid,noatime,softdep 1 2
swap /dev mfs rw,nosuid,-P=/mfs_backup/dev,-i=128 0 0
swap /var mfs rw,nodev,nosuid,-P=/mfs_backup/var 0 0
swap /home mfs rw,nodev,nosuid,-P=/mfs_backup/home 0 0
swap /root mfs rw,nodev,nosuid,-P=/mfs_backup/root 0 0
swap /tmp mfs rw,nodev,nosuid 0 0
/dev/wd0f /files ffs rw,nodev,nosuid,noatime,softdep 1 2
/dev/wd0e /usr ffs ro,nodev,noatime,softdep 1 2
$</pre></td></tr></table></div>

<h3>Sync script back MFS to CF</h3>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p549code42'); return false;">View Code</a> SH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p54942"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code" id="p549code42"><pre class="sh" style="font-family:monospace;">$ cat /bin/mfs-sync.sh                                                         
#! /bin/sh
&nbsp;
RSYNC=/usr/local/bin/rsync
&nbsp;
mount -o update,rw /mfs_backup
&nbsp;
for i in var root home
do
        echo &quot;Sync'ing &quot; ${i}
        ${RSYNC} -a --delete /${i}/ /mfs_backup/${i}/
done
&nbsp;
mount -o update,ro /mfs_backup
$</pre></td></tr></table></div>

<p>add this into <tt>/etc/rc.shutdown</tt></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p549code43'); return false;">View Code</a> SH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p54943"><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p549code43"><pre class="sh" style="font-family:monospace;">[...]
# Add your local shutdown actions here.
&nbsp;
echo &quot;Sync'ing mfs to disk&quot;
/bin/mfs-sync.sh
&nbsp;
echo '.'</pre></td></tr></table></div>

<p>and into the root crontab :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p549code44'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p54944"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p549code44"><pre class="text" style="font-family:monospace;">[...]
# do daily/weekly/monthly maintenance
00      1       *       *       *       /bin/sh /bin/mfs-sync.sh
[...]</pre></td></tr></table></div>

<p>Well, I guess that&#8217;s about it !<br />
&nbsp;<br />
&nbsp;<br />
<!--adsense--></p>
<p><a href="http://www.sakana.fr/blog/2012/03/11/openbsd-read-only-compact-flash-installation/">OpenBSD : Read only Compact Flash installation</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sakana/articles?a=TsVvJs5ffRM:1gw5YYoOwiA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sakana/articles?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=TsVvJs5ffRM:1gw5YYoOwiA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=TsVvJs5ffRM:1gw5YYoOwiA:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=TsVvJs5ffRM:1gw5YYoOwiA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=TsVvJs5ffRM:1gw5YYoOwiA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=TsVvJs5ffRM:1gw5YYoOwiA:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=TsVvJs5ffRM:1gw5YYoOwiA:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=TsVvJs5ffRM:1gw5YYoOwiA:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/sakana/articles?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/sakana/articles/~4/TsVvJs5ffRM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2012/03/11/openbsd-read-only-compact-flash-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.sakana.fr/blog/2012/03/11/openbsd-read-only-compact-flash-installation/</feedburner:origLink></item>
		<item>
		<title>Unix 101 : Shell wildcards expansion, to quote or not to quote</title>
		<link>http://feedproxy.google.com/~r/sakana/articles/~3/MbStp9xr7Fo/</link>
		<comments>http://www.sakana.fr/blog/2012/03/11/unix-101-shell-wildcards-expansion/#comments</comments>
		<pubDate>Sun, 11 Mar 2012 06:02:49 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Systems]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=524</guid>
		<description><![CDATA[Or why you usually use ls -l *txt without quotes, but use quotes in find . -name "*txt". &#160; Wildcards expansion is a feature of the shell which identifies files by a pattern instead of a comprehensive list. For example if you have a directory with the following 10 files all starting by the letter [...]<p><a href="http://www.sakana.fr/blog/2012/03/11/unix-101-shell-wildcards-expansion/">Unix 101 : Shell wildcards expansion, to quote or not to quote</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Or why you usually use <tt>ls -l *txt</tt> without quotes, but use quotes in <tt>find . -name "*txt"</tt>.</p>
<p>&nbsp;</p>
<p><span id="more-524"></span></p>
<p>Wildcards expansion is a feature of the shell which identifies <strong>files</strong> by a pattern instead of a comprehensive list. For example if you have a directory with the following 10 files all starting by the letter &#8220;a&#8221; and 10 files all starting by the letter &#8220;b&#8221; :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p524code49'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p52449"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p524code49"><pre class="text" style="font-family:monospace;">kattoo@roadrunner test % ls                                        
a01  a03  a05  a07  a09  b01  b03  b05  b07  b09
a02  a04  a06  a08  a10  b02  b04  b06  b08  b10
kattoo@roadrunner test %</pre></td></tr></table></div>

<p>and you want the detailed listing of only all of those starting with &#8220;a&#8221;.</p>
<p>&nbsp;</p>
<p>You can do either :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p524code50'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p52450"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code" id="p524code50"><pre class="text" style="font-family:monospace;">kattoo@roadrunner test % ls -l a01 a02 a03 a04 a05 a06 a07 a08 a09 a10
-rw-r--r-- 1 kattoo kattoo 0 Jan 24 08:42 a01
-rw-r--r-- 1 kattoo kattoo 0 Jan 24 08:42 a02
-rw-r--r-- 1 kattoo kattoo 0 Jan 24 08:42 a03
-rw-r--r-- 1 kattoo kattoo 0 Jan 24 08:42 a04
-rw-r--r-- 1 kattoo kattoo 0 Jan 24 08:42 a05
-rw-r--r-- 1 kattoo kattoo 0 Jan 24 08:42 a06
-rw-r--r-- 1 kattoo kattoo 0 Jan 24 08:42 a07
-rw-r--r-- 1 kattoo kattoo 0 Jan 24 08:42 a08
-rw-r--r-- 1 kattoo kattoo 0 Jan 24 08:42 a09
-rw-r--r-- 1 kattoo kattoo 0 Jan 24 08:42 a10</pre></td></tr></table></div>

<p>or the much shorter :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p524code51'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p52451"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code" id="p524code51"><pre class="text" style="font-family:monospace;">kattoo@roadrunner test % ls -l a*                                     
-rw-r--r-- 1 kattoo kattoo 0 Jan 24 08:42 a01
-rw-r--r-- 1 kattoo kattoo 0 Jan 24 08:42 a02
-rw-r--r-- 1 kattoo kattoo 0 Jan 24 08:42 a03
-rw-r--r-- 1 kattoo kattoo 0 Jan 24 08:42 a04
-rw-r--r-- 1 kattoo kattoo 0 Jan 24 08:42 a05
-rw-r--r-- 1 kattoo kattoo 0 Jan 24 08:42 a06
-rw-r--r-- 1 kattoo kattoo 0 Jan 24 08:42 a07
-rw-r--r-- 1 kattoo kattoo 0 Jan 24 08:42 a08
-rw-r--r-- 1 kattoo kattoo 0 Jan 24 08:42 a09
-rw-r--r-- 1 kattoo kattoo 0 Jan 24 08:42 a10
kattoo@roadrunner test %</pre></td></tr></table></div>

<p>In the second form you ask the shell to identify all the files starting with an &#8220;a&#8221; followed by any character, and to provide them as arguments to the command <tt>ls</tt>. Both forms are <strong>equivalent</strong>.</p>
<p>&nbsp;</p>
<p>Now, some tools are capable of interpreting patterns on their own. <tt>find</tt> or <tt>grep</tt> are such tools. In that situation, you <strong>do not want</strong> the shell to interpret the patterns and replace them by the matching files before providing them as command line arguments.</p>
<p>&nbsp;</p>
<p>You do that by quoting the patterns, thus explicitly instructing the shell to leave the patterns alone and to provide the pattern (and not the matching files) directly as command line arguments to the command.</p>
<p>&nbsp;</p>
<p>Example :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p524code52'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p52452"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p524code52"><pre class="text" style="font-family:monospace;">kattoo@roadrunner Downloads % find . -name &quot;*.tar.gz&quot; | egrep &quot;open.*2&quot;
./pyopencl-2011.2.tar.gz
kattoo@roadrunner Downloads %</pre></td></tr></table></div>

<p>Here the patterns are quoted so that the shell won&#8217;t try to replace them by matching files. <tt>find</tt> and <tt>grep</tt> will get the patterns as command line arguments directly and process them to respectively find the matching files and filter the matching lines.</p>
<p>&nbsp;</p>
<p><!--adsense--></p>
<p><a href="http://www.sakana.fr/blog/2012/03/11/unix-101-shell-wildcards-expansion/">Unix 101 : Shell wildcards expansion, to quote or not to quote</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sakana/articles?a=MbStp9xr7Fo:LH0r3DdfH3Y:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sakana/articles?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=MbStp9xr7Fo:LH0r3DdfH3Y:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=MbStp9xr7Fo:LH0r3DdfH3Y:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=MbStp9xr7Fo:LH0r3DdfH3Y:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=MbStp9xr7Fo:LH0r3DdfH3Y:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=MbStp9xr7Fo:LH0r3DdfH3Y:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=MbStp9xr7Fo:LH0r3DdfH3Y:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=MbStp9xr7Fo:LH0r3DdfH3Y:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/sakana/articles?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/sakana/articles/~4/MbStp9xr7Fo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2012/03/11/unix-101-shell-wildcards-expansion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.sakana.fr/blog/2012/03/11/unix-101-shell-wildcards-expansion/</feedburner:origLink></item>
		<item>
		<title>Getting Spotify to run on Gentoo/Linux: A Gross and Cruel Hack</title>
		<link>http://feedproxy.google.com/~r/sakana/articles/~3/3FcoO2CInuw/</link>
		<comments>http://www.sakana.fr/blog/2012/01/26/getting-spotify-to-run-on-gentoolinux-a-gross-and-cruel-hack/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 15:30:09 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[spotify]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=529</guid>
		<description><![CDATA[Spotify is a great way to listen to music. Unfortunately the official client only runs on Windows and Mac machines. There is an experimental unsupported client for linux, however it&#8217;s provided as a DEB (ubuntu/debian) package. Here&#8217;s a gross hack for whom is desperate to get it working on Gentoo. Step 1 : Get the [...]<p><a href="http://www.sakana.fr/blog/2012/01/26/getting-spotify-to-run-on-gentoolinux-a-gross-and-cruel-hack/">Getting Spotify to run on Gentoo/Linux: A Gross and Cruel Hack</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Spotify is a great way to listen to music. Unfortunately the official client only runs on Windows and Mac machines. There is an experimental unsupported client for linux, however it&#8217;s provided as a DEB (ubuntu/debian) package.</p>
<p>Here&#8217;s a gross hack for whom is desperate to get it working on Gentoo.<br />
<span id="more-529"></span></p>
<h4>Step 1 : Get the package</h4>
<p>You can download the package from <a href="http://repository.spotify.com/pool/non-free/s/spotify/">here</a>.<br />
Pick the package matching your own architecture.</p>
<h4>Step 2 : Convert the DEB package and extract it</h4>
<p>Install the package deb2targz if you don&#8217;t already have it.</p>
<p>The following command will create a tar.gz file from the .deb package :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p529code57'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p52957"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p529code57"><pre class="text" style="font-family:monospace;">deb2targz spotify-client-qt_0.6.2.291.gcccc1f5.116-1_amd64.deb</pre></td></tr></table></div>

<p>You can then extract that tar.gz file like below :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p529code58'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p52958"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p529code58"><pre class="text" style="font-family:monospace;">tar zxvf spotify-client-qt_0.6.2.291.gcccc1f5.116-1_amd64.tar.gz</pre></td></tr></table></div>

<p>This will create you a usr directory, containing spotify files.</p>
<p>Toss them at the appropriate places on your system :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p529code59'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p52959"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p529code59"><pre class="text" style="font-family:monospace;">cd usr
mv bin/spotify /usr/bin/
mv share/pixmaps/* /usr/share/pixmaps/
mv share/spotify/ /usr/share/</pre></td></tr></table></div>

<h4>Step 3 : Fixing library issues</h4>
<p>Now this is the ugly part. Spotify is linked against specific versions of some libraries (SSL 0.9.8 and Crypto 0.9.8). In order to make it work, you need to fake those versions by creating a symlink from the wanted version to the existing (you&#8217;ll need to figure this out) version in your system.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p529code60'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p52960"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p529code60"><pre class="text" style="font-family:monospace;">cd /usr/lib
ln -s libssl.so.1.0.0 libssl.so.0.9.8
ln -s libcrypto.so.1.0.0 libcrypto.so.0.9.8</pre></td></tr></table></div>

<h4>Step 4 : Instructing firefox to open the spotify protocol with the Spotify application</h4>
<p>You need to register the spotify protocol so that Firefox will know how to deal with those &#8220;spotify:&#8221; urls.</p>
<ol>
<li>Open the about:config page</li>
<li>Create a boolean value by the name of network.protocol-handler.expose.spotify</li>
<li>Set its value to false</li>
<li>Click on a spotify link (for example a playlist link or such). A popup will open and ask you to pick an application. Use /usr/bin/spotify.</li>
</ol>
<p>That&#8217;s it. All set.<br />
I&#8217;m not proud of it&#8230;. but I wanted to use Spotify badly <img src='http://www.sakana.fr/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><!--adsense--></p>
<p><a href="http://www.sakana.fr/blog/2012/01/26/getting-spotify-to-run-on-gentoolinux-a-gross-and-cruel-hack/">Getting Spotify to run on Gentoo/Linux: A Gross and Cruel Hack</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sakana/articles?a=3FcoO2CInuw:lNmWLB6f55E:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sakana/articles?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=3FcoO2CInuw:lNmWLB6f55E:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=3FcoO2CInuw:lNmWLB6f55E:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=3FcoO2CInuw:lNmWLB6f55E:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=3FcoO2CInuw:lNmWLB6f55E:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=3FcoO2CInuw:lNmWLB6f55E:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=3FcoO2CInuw:lNmWLB6f55E:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=3FcoO2CInuw:lNmWLB6f55E:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/sakana/articles?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/sakana/articles/~4/3FcoO2CInuw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2012/01/26/getting-spotify-to-run-on-gentoolinux-a-gross-and-cruel-hack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.sakana.fr/blog/2012/01/26/getting-spotify-to-run-on-gentoolinux-a-gross-and-cruel-hack/</feedburner:origLink></item>
		<item>
		<title>Asterisk 101 : How to get rid of your mother-in-law …</title>
		<link>http://feedproxy.google.com/~r/sakana/articles/~3/M2ttUj-e2Lk/</link>
		<comments>http://www.sakana.fr/blog/2011/04/30/asterisk-101-how-to-get-rid-of-your-mother-in-law/#comments</comments>
		<pubDate>Sat, 30 Apr 2011 17:23:51 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[asterisk]]></category>
		<category><![CDATA[blacklist]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=512</guid>
		<description><![CDATA[&#8230; or anyone else really, with a little trick to implement a black list and filter unwanted callers. 1. The BLACKLIST function Asterisk implements a BLACKLIST function which can be used to check whether a callerID is blacklisted or not, here is the synopsis (which you can get by connecting to thee asterisk server by [...]<p><a href="http://www.sakana.fr/blog/2011/04/30/asterisk-101-how-to-get-rid-of-your-mother-in-law/">Asterisk 101 : How to get rid of your mother-in-law &#8230;</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>&#8230; or anyone else really, with a little trick to implement a black list and filter unwanted callers.<br />
<span id="more-512"></span></p>
<h4>1. The BLACKLIST function</h4>
<p>Asterisk implements a <tt>BLACKLIST</tt> function which can be used to check whether a callerID is blacklisted or not, here is the synopsis (which you can get by connecting to thee asterisk server by issuing the <tt>asterisk -v</tt> command and then <tt>core show function BLACKLIST</tt>) :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p512code66'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p51266"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code" id="p512code66"><pre class="text" style="font-family:monospace;">spaghetti*CLI&gt; core show function BLACKLIST
&nbsp;
  -= Info about function 'BLACKLIST' =- 
&nbsp;
[Synopsis]
Check if the callerid is on the blacklist. 
&nbsp;
[Description]
Uses astdb to check if the Caller*ID is in family 'blacklist'. Returns '1'
or '0'.
&nbsp;
[Syntax]
BLACKLIST()
&nbsp;
[Arguments]
Not available
&nbsp;
[See Also]
DB
spaghetti*CLI&gt;</pre></td></tr></table></div>

<p>This is what we&#8217;re going to use for this example.</p>
<h3>2. Managing the blacklist</h3>
<p>You can add callerIDs to the blacklist with the following command :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p512code67'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p51267"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p512code67"><pre class="text" style="font-family:monospace;">spaghetti*CLI&gt; database put blacklist 03001125000 &quot;Mother-in-law from hell&quot;
Updated database successfully
spaghetti*CLI&gt; database put blacklist 03001125150 &quot;FAX machine harassing me&quot;
Updated database successfully</pre></td></tr></table></div>

<p>If later on you wish to remove an item from the blacklist (maybe the fax is not that bad after all !), use the following :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p512code68'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p51268"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p512code68"><pre class="text" style="font-family:monospace;">spaghetti*CLI&gt; database del blacklist 03001125150 
Database entry removed.</pre></td></tr></table></div>

<p>And of course you can list the content of the current blacklist like that :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p512code69'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p51269"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p512code69"><pre class="text" style="font-family:monospace;">spaghetti*CLI&gt; database show blacklist
/blacklist/03001125000                             : Mother-in-law from hell
1 results found.
spaghetti*CLI&gt;</pre></td></tr></table></div>

<p>Use those commands to tailor the blacklist according to your needs.</p>
<h3>3. Altering the dialplan to filter out the blacklisted numbers</h3>
<p>Next you&#8217;ve got to update your incoming context to deal with blacklisted callerIDs. My incoming context is named &#8220;incoming-calls&#8221; but you might have to adjust that :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p512code70'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p51270"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code" id="p512code70"><pre class="text" style="font-family:monospace;">[incoming-calls] ; on declare le contexte de reception d'appels depuis freephonie
exten =&gt; s,1,GotoIf($[&quot;${CALLERID(NUM)}&quot; = &quot;anonymous&quot;] ? 10) 
exten =&gt; s,2,GotoIf(${BLACKLIST()} ? 10)
exten =&gt; s,3,Dial(SIP/phone1&amp;SIP/phone2,10)
exten =&gt; s,4,Congestion()
exten =&gt; s,5,Hangup()
exten =&gt; s,10,Answer
exten =&gt; s,11,Wait(1)
exten =&gt; s,12,MusicOnHold(default)
exten =&gt; s,13,Hangup</pre></td></tr></table></div>

<p>So here, the rules 1 and 2 are to send both anonymous callers (mostly telemarketers over here) and blacklisted callers to an infinite holding music (starting at line 10). The rules 3,4,5 are to deal with other calls and direct them to 2 SIP phones.</p>
<p>That&#8217;s it ! Feel free to ask if you need more details about this set up.</p>
<p><!--adsense--></p>
<p><a href="http://www.sakana.fr/blog/2011/04/30/asterisk-101-how-to-get-rid-of-your-mother-in-law/">Asterisk 101 : How to get rid of your mother-in-law &#8230;</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sakana/articles?a=M2ttUj-e2Lk:ImqNhWE9_Fw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sakana/articles?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=M2ttUj-e2Lk:ImqNhWE9_Fw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=M2ttUj-e2Lk:ImqNhWE9_Fw:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=M2ttUj-e2Lk:ImqNhWE9_Fw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=M2ttUj-e2Lk:ImqNhWE9_Fw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=M2ttUj-e2Lk:ImqNhWE9_Fw:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=M2ttUj-e2Lk:ImqNhWE9_Fw:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=M2ttUj-e2Lk:ImqNhWE9_Fw:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/sakana/articles?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/sakana/articles/~4/M2ttUj-e2Lk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2011/04/30/asterisk-101-how-to-get-rid-of-your-mother-in-law/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.sakana.fr/blog/2011/04/30/asterisk-101-how-to-get-rid-of-your-mother-in-law/</feedburner:origLink></item>
		<item>
		<title>Asterisk 101 – Ghetto GoogleVoice : Signing up for / using GV even if you’re not in the USA using Asterisk</title>
		<link>http://feedproxy.google.com/~r/sakana/articles/~3/eyzYej1N5Kw/</link>
		<comments>http://www.sakana.fr/blog/2011/01/09/asterisk-101-ghetto-googlevoice-signing-up-for-using-gv-even-if-youre-not-in-the-usa-using-asterisk/#comments</comments>
		<pubDate>Sun, 09 Jan 2011 11:10:19 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[asterisk]]></category>
		<category><![CDATA[googlevoice]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=500</guid>
		<description><![CDATA[GoogleVoice (GV for short) is a great service (I won&#8217;t go into the details, but you can read up about it here), but it is unfortunately accessible only if you are in the USA. Granted there is already plenty of documentation about how to circumvent this, but I&#8217;m not aware of any of those using [...]<p><a href="http://www.sakana.fr/blog/2011/01/09/asterisk-101-ghetto-googlevoice-signing-up-for-using-gv-even-if-youre-not-in-the-usa-using-asterisk/">Asterisk 101 &#8211; Ghetto GoogleVoice : Signing up for / using GV even if you&#8217;re not in the USA using Asterisk</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>GoogleVoice (GV for short) is a great service (I won&#8217;t go into the details, but <a href="http://www.google.com/support/voice/bin/answer.py?answer=115061" target="_blank">you can read up about it here</a>), but it is unfortunately accessible only if you are in the USA.<br />
Granted there is already plenty of documentation about how to circumvent this, but I&#8217;m not aware of any of those using Asterisk.</p>
<p>So this post will document how to sign up for a GV account as well as how to use it with Asterisk afterwards, in the prospect of using it if you are not in the USA.</p>
<p>In order to be able to sign up for GV, you need to meet 2 prerequisites :</p>
<ol>
<li>You need to have a US IP address</li>
<li>You need to have a US phone number, which will be used to validate your GV account</li>
</ol>
<p>Step 1 is left <a href="http://www.google.com/search?hl=en&#038;safe=off&#038;q=free+http+proxy+usa" target="_blank">as an exercise to the reader</a> (<a href="http://encyclopediadramatica.com/7_Proxies"><em>&#8220;Good luck ! I&#8217;m behind 7 proxies !&#8221;</em></a> <img src='http://www.sakana.fr/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> ).</p>
<p>Step 2 is the one we&#8217;re going to describe here, as an example of what you can pull with simple Asterisk configurations.</p>
<p><span id="more-500"></span></p>
<h4>1. Getting a US phone number</h4>
<p>What you really need to find is a <strong>DID</strong> (Direct Inward Dialing aka DDI : Direct Dial-In) provider. It will provide you with a US phone number and will patch that call either to another phone number or to a SIP address.</p>
<p>GV will only forward calls to US phone numbers, so you need one of those. <a href="http://www.ipkall.com/" target="_blank">IPKall</a> is such a <strong>free provider</strong>. They will provide you an American phone number and will forward it to any SIP or IAX2 address. Creating an account only takes a minute.</p>
<p>Nothing fancy here : Simply fill the SIP account into the <strong>SIP phone number</strong> field, and the SIP servername or IP into the <strong>SIP proxy</strong> field.</p>
<h4>2. Setting up Asterisk</h4>
<p>Now IPKall will gladly forward the calls to your SIP account. You can setup this SIP account as simply as below :</p>
<p>IPKall has a specificity we need to take care of : calls can originate from 2 different servers. We need to have calls coming from both servers to get into the same context. To avoid repeating twice the same configuration block (with just the IP address being different), we&#8217;ll use a template.</p>
<p>We&#8217;ll also define a SIP account for a SIP phone (or for a softphone).</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.sakana.fr/blog/wp-content/plugins/wp-codebox/wp-codebox.php?p=500&amp;download=sip.conf">sip.conf</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p50073"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code" id="p500code73"><pre class="example" style="font-family:monospace;">[phone1]
type=friend
username=phone1
secret=SecretPassword
host=dynamic
context=myhouse
nat=yes ; if you need to connect from behind a nat
&nbsp;
[ipkall](!) ; This section is only a template
type=peer
username=ipkall
context=ipkall-in
insecure=invite
&nbsp;
[ipkall-01](ipkall) ; We import the previous template to setup calls from
host=66.54.140.46       ; the first IPKall server
&nbsp;
[ipkall-02](ipkall) ; We import the previous template to setup calls from
host=66.54.140.47       ; the second IPKall server</pre></td></tr></table></div>

<p>I&#8217;ve setup an SIP &#8220;number&#8221; I&#8217;ve instructed IPKall to forward the calls to is &#8220;ipkall&#8221;. The configuration below must reflect this. Here, phone calls to the &#8220;ipkall&#8221; extension will be routed to the &#8220;phone1&#8243; SIP phone.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.sakana.fr/blog/wp-content/plugins/wp-codebox/wp-codebox.php?p=500&amp;download=extensions.conf">extensions.conf</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p50074"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p500code74"><pre class="example" style="font-family:monospace;">[ipkall-in]
exten =&gt; ipkall,1,Dial(SIP/phone1)
exten =&gt; ipkall,n,Hangup()</pre></td></tr></table></div>

<h4>3.Setup a softphone and finally your GV account</h4>
<p>Now all you need is a softphone (I like sflphone for that purpose) or a SIP phone to be configured as &#8220;phone1&#8243; (check your favorite softphone instructions to do so) and head back to GV to create your account.</p>
<p>GV will assign you a phone number and will ask you to which phone number to route the phone calls. That&#8217;s where you&#8217;ll specify your IPKall phone number.</p>
<p>GV will then ask you to validate this phone call by giving you a 2 digit number and calling you on your IPKall phone number. You&#8217;ll have to pick up the call on your softphone and dial the 2 digit number. </p>
<p>Voila, the account is created and validated !</p>
<p>Any call to your GV phone number will be routed to IPKall which will send it to your Asterisk installation, which will then ring your softphone or SIP phone.</p>
<p>Pretty nifty, heh ? <img src='http://www.sakana.fr/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><!--adsense--></p>
<p><a href="http://www.sakana.fr/blog/2011/01/09/asterisk-101-ghetto-googlevoice-signing-up-for-using-gv-even-if-youre-not-in-the-usa-using-asterisk/">Asterisk 101 &#8211; Ghetto GoogleVoice : Signing up for / using GV even if you&#8217;re not in the USA using Asterisk</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sakana/articles?a=eyzYej1N5Kw:_Yflli0_uuI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sakana/articles?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=eyzYej1N5Kw:_Yflli0_uuI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=eyzYej1N5Kw:_Yflli0_uuI:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=eyzYej1N5Kw:_Yflli0_uuI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=eyzYej1N5Kw:_Yflli0_uuI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=eyzYej1N5Kw:_Yflli0_uuI:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=eyzYej1N5Kw:_Yflli0_uuI:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=eyzYej1N5Kw:_Yflli0_uuI:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/sakana/articles?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/sakana/articles/~4/eyzYej1N5Kw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2011/01/09/asterisk-101-ghetto-googlevoice-signing-up-for-using-gv-even-if-youre-not-in-the-usa-using-asterisk/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.sakana.fr/blog/2011/01/09/asterisk-101-ghetto-googlevoice-signing-up-for-using-gv-even-if-youre-not-in-the-usa-using-asterisk/</feedburner:origLink></item>
		<item>
		<title>Unix 101 : Showing non-printing characters in text files (ex : DOS files)</title>
		<link>http://feedproxy.google.com/~r/sakana/articles/~3/AWI-ALnrBRg/</link>
		<comments>http://www.sakana.fr/blog/2011/01/07/unix-101-showing-non-printing-characters-in-text-files-ex-dos-files/#comments</comments>
		<pubDate>Fri, 07 Jan 2011 12:12:33 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Systems]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=494</guid>
		<description><![CDATA[A non-printing character is a character which won&#8217;t actually get directly printed (or displayed) but rather interpreted. Such non-printing characters are for example line-feed or tabulation. The interpretation of those characters can differ from one system to the next. For example the line-feed character is different on Unix or DOS. If you need an easy [...]<p><a href="http://www.sakana.fr/blog/2011/01/07/unix-101-showing-non-printing-characters-in-text-files-ex-dos-files/">Unix 101 : Showing non-printing characters in text files (ex : DOS files)</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>A non-printing character is a character which won&#8217;t actually get directly printed (or displayed) but rather interpreted. Such non-printing characters are for example line-feed or tabulation. The interpretation of those characters can differ from one system to the next. For example the line-feed character is different on Unix or DOS.</p>
<p>If you need an easy way to confirm that a text file is DOS or UNIX formatted (they differ with respect to the end of line character(s) for example) or if you wish to display normally non-printing characters of a text file, you can use the <tt>-vET</tt> command line switches of the <tt>cat</tt> utility.</p>
<p>As explained in the man page :</p>
<ul>
<li>-v : will use the ^ and M- notation for control and multibytes characters</li>
<li>-E : will make ends of lines visible</li>
<li>-T : will make tabulations visible</li>
</ul>
<p>For example : <span id="more-494"></span></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p494code77'); return false;">View Code</a> EXAMPLE</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p49477"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p494code77"><pre class="example" style="font-family:monospace;">% cat -vET test.txt
a test message for$
showing the^Iuse of   cat -vET$
^I$
that is all$</pre></td></tr></table></div>

<p>and compare it to the following plain <tt>cat</tt> output, without any command line option :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p494code78'); return false;">View Code</a> EXAMPLE</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p49478"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p494code78"><pre class="example" style="font-family:monospace;">% cat test.txt     
a test message for
showing the     use of   cat -vET
&nbsp;
that is all</pre></td></tr></table></div>

<p>You can easily tell what blank space is a space or actually a tabulation for example. If you&#8217;d happen to see ^M characters popping out at the end of the lines, then you this is actually a DOS text file (which you might need to convert to UNIX style end of lines with an utility such as dos2unix)</p>
<p><!--adsense--></p>
<p><a href="http://www.sakana.fr/blog/2011/01/07/unix-101-showing-non-printing-characters-in-text-files-ex-dos-files/">Unix 101 : Showing non-printing characters in text files (ex : DOS files)</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sakana/articles?a=AWI-ALnrBRg:B0ioLqLu3Bg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sakana/articles?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=AWI-ALnrBRg:B0ioLqLu3Bg:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=AWI-ALnrBRg:B0ioLqLu3Bg:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=AWI-ALnrBRg:B0ioLqLu3Bg:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=AWI-ALnrBRg:B0ioLqLu3Bg:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=AWI-ALnrBRg:B0ioLqLu3Bg:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=AWI-ALnrBRg:B0ioLqLu3Bg:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=AWI-ALnrBRg:B0ioLqLu3Bg:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/sakana/articles?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/sakana/articles/~4/AWI-ALnrBRg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2011/01/07/unix-101-showing-non-printing-characters-in-text-files-ex-dos-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.sakana.fr/blog/2011/01/07/unix-101-showing-non-printing-characters-in-text-files-ex-dos-files/</feedburner:origLink></item>
		<item>
		<title>Asterisk 101 : How to troll telemarketers (aka automatically send hidden Caller ID to a waiting music forever)</title>
		<link>http://feedproxy.google.com/~r/sakana/articles/~3/0AOi9PX0nTs/</link>
		<comments>http://www.sakana.fr/blog/2010/12/16/asterisk-how-to-troll-telemarketers-aka-automatically-send-hidden-caller-id-to-a-waiting-music-forever/#comments</comments>
		<pubDate>Thu, 16 Dec 2010 18:13:20 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[asterisk]]></category>
		<category><![CDATA[caller id]]></category>
		<category><![CDATA[telemarketers]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=488</guid>
		<description><![CDATA[If like me you get tons of telemarketers calls, there&#8217;s an easy way to get rid of them with a quick Asterisk hack. The following Asterisk configuration snippet will immediately send any hidden caller ID (99% telemarketers, and I have a general policy of not picking up the phone for hidden caller ID anyway) to [...]<p><a href="http://www.sakana.fr/blog/2010/12/16/asterisk-how-to-troll-telemarketers-aka-automatically-send-hidden-caller-id-to-a-waiting-music-forever/">Asterisk 101 : How to troll telemarketers (aka automatically send hidden Caller ID to a waiting music forever)</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>If like me you get tons of telemarketers calls, there&#8217;s an easy way to get rid of them with a quick Asterisk hack. The following Asterisk configuration snippet will immediately send any hidden caller ID (99% telemarketers, and I have a general policy of not picking up the phone for hidden caller ID anyway) to a holding music making them waste money and time&#8230;</p>
<p><span id="more-488"></span></p>
<p>This snippet is to place into the <tt>extension.conf</tt> file :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p488code80'); return false;">View Code</a> ASTERISK</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p48880"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code" id="p488code80"><pre class="asterisk" style="font-family:monospace;">[incoming] ; incoming calls
exten =&gt; s,1,GotoIf($[&quot;${CALLERID(NUM)}&quot; = &quot;anonymous&quot;] ? 10) 
exten =&gt; s,2,Dial(SIP/phone1&amp;SIP/phone2,10)
exten =&gt; s,3,Congestion()
exten =&gt; s,4,Hangup()
exten =&gt; s,10,Answer
exten =&gt; s,11,Wait(1)
exten =&gt; s,12,MusicOnHold(default)
exten =&gt; s,13,Hangup</pre></td></tr></table></div>

<p>This block will check for the NUMber information of the Caller ID and if it is &#8220;anonymous&#8221;, it will send it to the step 10 which will pick up the call and start the holding music. If the Caller ID is not &#8220;anonymous&#8221;, it will ring 2 SIP phones for 10 secs, and if no one picks those, send it to congestion mode.</p>
<p>That&#8217;s all !</p>
<p><strong>Edit</strong> : On a second thought, I think I&#8217;ll change that to have Asterisk to pick up the call and let the caller leave a message. That&#8217;s still going to catch those telemarketers (waste time &#038; money), while giving a chance to legit callers to speak their message.</p>
<p><!--adsense--></p>
<p><a href="http://www.sakana.fr/blog/2010/12/16/asterisk-how-to-troll-telemarketers-aka-automatically-send-hidden-caller-id-to-a-waiting-music-forever/">Asterisk 101 : How to troll telemarketers (aka automatically send hidden Caller ID to a waiting music forever)</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sakana/articles?a=0AOi9PX0nTs:v4W3bHzQxCs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sakana/articles?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=0AOi9PX0nTs:v4W3bHzQxCs:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=0AOi9PX0nTs:v4W3bHzQxCs:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=0AOi9PX0nTs:v4W3bHzQxCs:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=0AOi9PX0nTs:v4W3bHzQxCs:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=0AOi9PX0nTs:v4W3bHzQxCs:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=0AOi9PX0nTs:v4W3bHzQxCs:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=0AOi9PX0nTs:v4W3bHzQxCs:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/sakana/articles?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/sakana/articles/~4/0AOi9PX0nTs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2010/12/16/asterisk-how-to-troll-telemarketers-aka-automatically-send-hidden-caller-id-to-a-waiting-music-forever/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		<feedburner:origLink>http://www.sakana.fr/blog/2010/12/16/asterisk-how-to-troll-telemarketers-aka-automatically-send-hidden-caller-id-to-a-waiting-music-forever/</feedburner:origLink></item>
		<item>
		<title>Unix 101 : Filesystem basics &amp; Special files</title>
		<link>http://feedproxy.google.com/~r/sakana/articles/~3/-kAGzqlTN_o/</link>
		<comments>http://www.sakana.fr/blog/2010/12/08/unix-101-filesystem-basics-special-files/#comments</comments>
		<pubDate>Wed, 08 Dec 2010 21:34:48 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Systems]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[hardlinks]]></category>
		<category><![CDATA[sticky bit]]></category>
		<category><![CDATA[symlinks]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=479</guid>
		<description><![CDATA[This post is meant to clarify a few key concepts about Unix filesystems such as directory permissions, hardlinks and symlinks. Q: If I chmod 777 a file, can someone delete it ? A: No. To explain that, let&#8217;s first talk about directories. You can imagine a directory as a special file which would have one [...]<p><a href="http://www.sakana.fr/blog/2010/12/08/unix-101-filesystem-basics-special-files/">Unix 101 : Filesystem basics &#038; Special files</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>This post is meant to clarify a few key concepts about Unix filesystems such as directory permissions, hardlinks and symlinks.</p>
<p><span id="more-479"></span></p>
<p><strong>Q:</strong> If I chmod 777 a file, can someone delete it ?<br />
<strong>A:</strong> No. To explain that, let&#8217;s first talk about directories. You can imagine a directory as a special file which would have one line for each file contained in that directory. On each such line, there would be the inode number, and the name of the matching file.<br />
Deleting a file would be like removing a line from that special directory file <strong>which means that you need write permission on the directory containing the file to do so.</strong></p>
<p><strong>Q:</strong> What about that 777 mode /tmp directory ? Won&#8217;t someone delete all my files then ?<br />
<strong>A:</strong> No. /tmp &#8216;s permissions are not actually 777 but 1777. That &#8220;1&#8243; is the sticky bit which materialize by the &#8220;t&#8221; flag showing up in &#8220;ls -l&#8221;. That sticky bit means that only the owner of the file is allowed to delete it.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p479code82'); return false;">View Code</a> EXAMPLE</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p47982"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p479code82"><pre class="example" style="font-family:monospace;">kattoo@roadrunner ~ % ls -ld /tmp
drwxrwxrwt 10 root root 4096 Dec  8 21:53 /tmp/</pre></td></tr></table></div>

<p><strong>Q:</strong> Knowing that bit about directories being special files, how would you implement a hard links ?<br />
<strong>A:</strong> Simply have 2 &#8220;special file directories&#8221; having a line with the same inode number and different (or same !) file names. There you go, alternate filenames for the same on-disk content.</p>
<p><strong>Q:</strong> But then, if I delete a file with a hardlink, the &#8220;other&#8221; filename will point to no data ?<br />
<strong>A:</strong> No. The inode contains quite a few informations : dates, permissions, owner, group and such as well as the number of hardlinks. Every time you delete such a hardlink, this counter is decremented. Everytime you create a hardlink, the count is incremented. The actual content of the file is only actually deleted when the count reaches 0.</p>
<p><strong>Q:</strong> How about soft links (aka symbolic links aka symlinks) ?<br />
<strong>A:</strong> A symlink is yet another special kind of file. You can imagine that it&#8217;s a file which contains the name of another file. Anyone accessing the symlink will actually access the content of the file which name is in the symlink special file. This name resolution being done in-kernel, it&#8217;s mostly transparent for userland processes. Notice that you could place the name of a non-existing file in the symlink (dead link !), which is not possible with a hardlink.</p>
<p><!--adsense--></p>
<p><a href="http://www.sakana.fr/blog/2010/12/08/unix-101-filesystem-basics-special-files/">Unix 101 : Filesystem basics &#038; Special files</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sakana/articles?a=-kAGzqlTN_o:ZSPL7WFfb8A:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sakana/articles?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=-kAGzqlTN_o:ZSPL7WFfb8A:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=-kAGzqlTN_o:ZSPL7WFfb8A:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=-kAGzqlTN_o:ZSPL7WFfb8A:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=-kAGzqlTN_o:ZSPL7WFfb8A:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=-kAGzqlTN_o:ZSPL7WFfb8A:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=-kAGzqlTN_o:ZSPL7WFfb8A:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=-kAGzqlTN_o:ZSPL7WFfb8A:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/sakana/articles?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/sakana/articles/~4/-kAGzqlTN_o" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2010/12/08/unix-101-filesystem-basics-special-files/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.sakana.fr/blog/2010/12/08/unix-101-filesystem-basics-special-files/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 0.984 seconds. --><!-- Cached page generated by WP-Super-Cache on 2013-05-21 01:42:38 --><!-- Compression = gzip -->
