<?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>Thu, 26 Jan 2012 15:30:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</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>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('p529code5'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p5295"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p529code5"><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('p529code6'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p5296"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p529code6"><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('p529code7'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p5297"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p529code7"><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('p529code8'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p5298"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p529code8"><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><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/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('p512code14'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p51214"><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="p512code14"><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('p512code15'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p51215"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p512code15"><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('p512code16'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p51216"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p512code16"><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('p512code17'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p51217"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p512code17"><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('p512code18'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p51218"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code" id="p512code18"><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><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/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="p50021"><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="p500code21"><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="p50022"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p500code22"><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('p494code25'); return false;">View Code</a> EXAMPLE</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p49425"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p494code25"><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('p494code26'); return false;">View Code</a> EXAMPLE</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p49426"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p494code26"><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('p488code28'); return false;">View Code</a> ASTERISK</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p48828"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code" id="p488code28"><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('p479code30'); return false;">View Code</a> EXAMPLE</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p47930"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p479code30"><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>
		<item>
		<title>MisterHouse : Setting up “modes”</title>
		<link>http://feedproxy.google.com/~r/sakana/articles/~3/XihojT40HQw/</link>
		<comments>http://www.sakana.fr/blog/2010/11/13/misterhouse-setting-up-modes/#comments</comments>
		<pubDate>Sat, 13 Nov 2010 21:03:53 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[home automation]]></category>
		<category><![CDATA[misterhouse]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=471</guid>
		<description><![CDATA[MisterHouse is a fantastic home automation software with an impressive out-of-the-box feature set, and it only gets better if you know a bit of Perl. You can conveniently set &#8220;modes&#8221;, which are settings with states you can define and use. You can then fire events upon state change, and so are they very useful to [...]<p><a href="http://www.sakana.fr/blog/2010/11/13/misterhouse-setting-up-modes/">MisterHouse : Setting up &#8220;modes&#8221;</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 href="misterhouse.sourceforge.net" target="_blank">MisterHouse is a fantastic home automation software</a> with an impressive out-of-the-box feature set, and it only gets better if you know a bit of Perl. </p>
<p>You can conveniently set &#8220;modes&#8221;, which are settings with states you can define and use. You can then fire events upon state change, and so are they very useful to define some sort of macros.</p>
<p>A few examples :</p>
<ul>
<li>the &#8220;Security&#8221; mode could be &#8220;on&#8221; or &#8220;off&#8221; : setting it &#8220;on&#8221; would close the shutters and activate the alarm system; setting it &#8220;off&#8221; would do the opposite;</li>
<li>the &#8220;Heating&#8221; mode could be &#8220;day&#8221;, &#8220;night&#8221;, &#8220;frost protection only&#8221; : setting it on &#8220;day&#8221; would set the target temperature to 20⁰C, &#8220;night&#8221; to 15⁰C and &#8220;frost protection only&#8221; to 7⁰C</li>
<li>the &#8220;Cinema&#8221; mode could be &#8220;on&#8221; or &#8220;off&#8221; : setting it to &#8220;on&#8221; would close the blinds and dim the lights; &#8220;off&#8221; would bring those back to their former states.
</ul>
<p>This post will show how to setup a mode, we&#8217;ll use the &#8220;Heating&#8221; mode described above as an example.</p>
<p><span id="more-471"></span></p>
<h4>Coding a mode</h4>
<p>The first thing to know is that a mode is nothing but a <tt>Generic_Item</tt>. By convention, it&#8217;s simpler to use an identifier starting by &#8220;mode_&#8221;.<br />
Here&#8217;s the sample code for the &#8220;Heating&#8221; mode (click to expand):</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><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('p471code33'); return false;">View Code</a> PERL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p47133"><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
</pre></td><td class="code" id="p471code33"><pre class="perl" style="font-family:monospace;"><span style="color: #0000ff;">$mode_heating</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Generic_Item<span style="color: #339933;">;</span>
<span style="color: #0000ff;">$mode_heating</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">set_states</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'day'</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'night'</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'off'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>state_changed <span style="color: #0000ff;">$mode_heating</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$heating_mode_state</span><span style="color: #339933;">;</span>
        <span style="color: #0000ff;">$heating_mode_state</span> <span style="color: #339933;">=</span> state <span style="color: #0000ff;">$mode_heating</span><span style="color: #339933;">;</span>
        main<span style="color: #339933;">::</span><span style="color: #006600;">print_log</span> <span style="color: #ff0000;">&quot;Mode = &quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$heating_mode_state</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$heating_mode_state</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">&quot;day&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #0000ff;">$thermostat_bureau</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">setTarget</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">18</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #0000ff;">$thermostat_living</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">setTarget</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">20</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$heating_mode_state</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">&quot;night&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #0000ff;">$thermostat_bureau</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">setTarget</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">13</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #0000ff;">$thermostat_living</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">setTarget</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">15</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$heating_mode_state</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">&quot;off&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #0000ff;">$thermostat_bureau</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">setTarget</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">7</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #0000ff;">$thermostat_living</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">setTarget</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">7</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
set <span style="color: #0000ff;">$mode_heating</span> <span style="color: #ff0000;">&quot;night&quot;</span>       <span style="color: #b1b100;">if</span> time_cron <span style="color: #ff0000;">'00 20 * * *'</span><span style="color: #339933;">;</span>
set <span style="color: #0000ff;">$mode_heating</span> <span style="color: #ff0000;">&quot;day&quot;</span>         <span style="color: #b1b100;">if</span> time_cron <span style="color: #ff0000;">'00 06 * * *'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>This code is pretty simple : MisterHouse will take all variable definitions and object creations and will execute them, then put everything else in its main event loop. So here the mode is created and then, in the main event loop, actions will be taken if the state of the mode is changed.<br />
It will also switch the state of the heating mode to day at 6am and to night at 8pm as defined with the &#8220;time_cron&#8221; functionnality.</p>
<h4>Integrating the mode within the web interface</h4>
<p>To have this mode show up in the web interface, you&#8217;ll need to alter the <tt>mh/web/ia5/modes/main.shtml</tt> and add the following row at the end of the &#8220;table&#8221; tag :</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('p471code34'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p47134"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p471code34"><pre class="html" style="font-family:monospace;">&lt;tr&gt;
  &lt;td align='middle'&gt; &lt;!--#include file=&quot;/bin/button_toggle.pl?mode_heating&amp;/ia5/modes/main.shtml&quot;--&gt; &lt;/td&gt;
&lt;/tr&gt;</pre></td></tr></table></div>

<p>If the GD graphics library is installed on your system, is supporting JPEG files and you enabled its use by MisterHouse (<tt>gd = 1</tt> in mh.private.ini), then MisterHouse will generate and display a graphical button with the current state of the mode. If not you&#8217;ll get a text link. No matter what, you can cycle through the different states defined for the mode by simply clicking on it.</p>
<p>If you&#8217;d like to have your own graphical buttons, simply place them into the &#8220;data&#8221; dir (<tt>data_dir</tt> configuration item of the <tt>mh.private.ini</tt>) and name them following the convention &#8220;modename_item_state.jpg&#8221;. For my example modename = mode_heating, and state are &#8220;day&#8221;, &#8220;night&#8221; and &#8220;frost&#8221;, so I&#8217;d need the files &#8220;mode_heating_item_day.jpg&#8221;, &#8220;mode_heating_item_night.jpg&#8221; and &#8220;mode_heating_item_frost.jpg&#8221;.</p>
<h4>References</h4>
<ul>
<li>mh/code/common/mh_control.pl : definition of core MisterHouse modes like  mode_mh (normal/mute/offline), mode_vacation (on/off), mode_security (armed/unarmed), mode_sleep (awake/sleeping parents/sleeping kids). You can use those as working examples for your own modes.</li>
<li>mh/web/ia5/modes directory : html files for the &#8220;modes&#8221; menu web page.</li>
<li>mh/web/bin/button.pl : script which returns the path to the file for a button and generate it if needed.</li>
<li>mh/web/bin/button_toggle.pl : script which generates a link which will toggle an object upon click</li>
</ul>
<p><!--adsense--></p>
<p><a href="http://www.sakana.fr/blog/2010/11/13/misterhouse-setting-up-modes/">MisterHouse : Setting up &#8220;modes&#8221;</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=XihojT40HQw:1hx2mrxGbR4: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=XihojT40HQw:1hx2mrxGbR4:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=XihojT40HQw:1hx2mrxGbR4:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=XihojT40HQw:1hx2mrxGbR4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=XihojT40HQw:1hx2mrxGbR4:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=XihojT40HQw:1hx2mrxGbR4:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=XihojT40HQw:1hx2mrxGbR4:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=XihojT40HQw:1hx2mrxGbR4: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/XihojT40HQw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2010/11/13/misterhouse-setting-up-modes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.sakana.fr/blog/2010/11/13/misterhouse-setting-up-modes/</feedburner:origLink></item>
		<item>
		<title>Linux + Xorg : Remapping caps lock key to escape</title>
		<link>http://feedproxy.google.com/~r/sakana/articles/~3/GhApa9smFjU/</link>
		<comments>http://www.sakana.fr/blog/2010/11/12/linux-xorg-remapping-caps-lock-key-to-escape/#comments</comments>
		<pubDate>Thu, 11 Nov 2010 23:49:31 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Systems]]></category>
		<category><![CDATA[caps lock]]></category>
		<category><![CDATA[hal]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[xorg]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=465</guid>
		<description><![CDATA[In this post I&#8217;ll revisit the classical &#8220;how to remap caps lock into something useful&#8221; once again. In this post, I&#8217;ll show how to remap the caps lock key to have an extra Escape key, which is very useful for all VI/Vim users. Method 1 : Using xmodmap This is mostly the usual way of [...]<p><a href="http://www.sakana.fr/blog/2010/11/12/linux-xorg-remapping-caps-lock-key-to-escape/">Linux + Xorg : Remapping caps lock key to escape</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>In this post I&#8217;ll revisit the classical &#8220;<strong>how to remap caps lock into something useful</strong>&#8221; once again. In this post, I&#8217;ll show how to remap the caps lock key to have an extra Escape key, which is very useful for all VI/Vim users.</p>
<p><span id="more-465"></span></p>
<h4>Method 1 : Using xmodmap</h4>
<p>This is mostly the usual way of altering the keyboard map. All you have to do edit the ${HOME}/.Xmodmap 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('p465code38'); return false;">View Code</a> CONF</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p46538"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p465code38"><pre class="conf" style="font-family:monospace;">clear Lock
keycode 66 = Escape</pre></td></tr></table></div>

<p>This file is often sourced when your X sessions is opened, but there are numerous bug reports stating that it&#8217;s either <a href="https://bbs.archlinux.org/viewtopic.php?pid=723967" target="_blank">ignored</a> or <a href="https://bugs.launchpad.net/ubuntu/+source/xfce4-session/+bug/97175" target="_blank">overridden</a> by some windows managers.</p>
<p>You might need to source the file by running <tt>xmodmap ~/.Xmodmap</tt> at some point after the windows manager is started.</p>
<h4>Method 2 : Using XKB configuration</h4>
<p>If you let Xorg setup your keyboard by consulting HAL, you can remap the caps lock key to escape by having the following policy file in <tt>/etc/hal/fdi/policy/keyboard.fdi</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('p465code39'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p46539"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code" id="p465code39"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;deviceinfo</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;0.2&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;device<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;match</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;info.capabilities&quot;</span> <span style="color: #000066;">contains</span>=<span style="color: #ff0000;">&quot;input.keyboard&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;match</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;info.product&quot;</span> <span style="color: #000066;">contains</span>=<span style="color: #ff0000;">&quot;Logitech Logitech USB Keyboard&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_driver&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>evdev<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/merge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.XkbOptions&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>caps:escape<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/merge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.XkbLayout&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>us<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/merge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.XkbVariant&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>intl<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/merge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/match<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/match<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/device<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/deviceinfo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>The <tt>caps:escape</tt> takes care of setting up caps lock as an escape key.</p>
<p>See more about <a href="http://www.sakana.fr/blog/2009/10/12/hal-xorg-x-server-using-hal-to-set-harware-specific-configuration-for-xorg-xserver/" target="_blank">How to setup Xorg according to HAL</a></p>
<p>If you don&#8217;t use HAL and prefer to setup your keyboard through xorg.conf, it will look like the snippet 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('p465code40'); return false;">View Code</a> CONF</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p46540"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code" id="p465code40"><pre class="conf" style="font-family:monospace;">Section &quot;InputDevice&quot;
    Identifier &quot;Keyboard1&quot;
    Driver &quot;evdev&quot;
&nbsp;
    Option &quot;XkbLayout&quot; &quot;us&quot;
    Option &quot;XkbVarian&quot; &quot;intl&quot;
    Option &quot;XKbOptions&quot; &quot;caps:escape&quot;
EndSection</pre></td></tr></table></div>

<p>To see the other available options, check <tt>/usr/share/X11/xkb/rules/xorg</tt></p>
<p>Further readings :</p>
<ul>
<li><a href="http://www.x.org/archive/X11R7.0/doc/html/XKB-Config.html" target="_blank">The XKB Configuration Guide</a></li>
<li><a href="http://www.charvolant.org/~doug/xkb/html/node1.html" target="_blank">An Unreliable Guide to XKB Configuration</a></li>
</ul>
<p><!--adsense--></p>
<p><a href="http://www.sakana.fr/blog/2010/11/12/linux-xorg-remapping-caps-lock-key-to-escape/">Linux + Xorg : Remapping caps lock key to escape</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=GhApa9smFjU:rNyNxL5LLTQ: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=GhApa9smFjU:rNyNxL5LLTQ:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=GhApa9smFjU:rNyNxL5LLTQ:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=GhApa9smFjU:rNyNxL5LLTQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=GhApa9smFjU:rNyNxL5LLTQ:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=GhApa9smFjU:rNyNxL5LLTQ:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=GhApa9smFjU:rNyNxL5LLTQ:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=GhApa9smFjU:rNyNxL5LLTQ: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/GhApa9smFjU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2010/11/12/linux-xorg-remapping-caps-lock-key-to-escape/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.sakana.fr/blog/2010/11/12/linux-xorg-remapping-caps-lock-key-to-escape/</feedburner:origLink></item>
		<item>
		<title>Facebook API : Exporting your friends birthdays into vCards format</title>
		<link>http://feedproxy.google.com/~r/sakana/articles/~3/_dRHpl16A70/</link>
		<comments>http://www.sakana.fr/blog/2010/11/02/facebook-api-exporting-your-friends-birthdays-into-vcards-format/#comments</comments>
		<pubDate>Mon, 01 Nov 2010 22:47:25 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=462</guid>
		<description><![CDATA[The following sample Facebook desktop application exports your friends birthdays in a vCard file format. This file is suitable to be imported into your GMail contacts for example. Here is the script. It&#8217;s pretty simple : ?Download fb-bdays.pl1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 [...]<p><a href="http://www.sakana.fr/blog/2010/11/02/facebook-api-exporting-your-friends-birthdays-into-vcards-format/">Facebook API : Exporting your friends birthdays into vCards format</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 following sample Facebook desktop application exports your friends birthdays in a vCard file format. This file is suitable to be imported into your GMail contacts for example. </p>
<p><span id="more-462"></span></p>
<p>Here is the script. It&#8217;s pretty simple :</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=462&amp;download=fb-bdays.pl">fb-bdays.pl</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p46242"><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
42
43
44
</pre></td><td class="code" id="p462code42"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /usr/bin/perl</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> warnings<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> WWW<span style="color: #339933;">::</span><span style="color: #006600;">Facebook</span><span style="color: #339933;">::</span><span style="color: #006600;">API</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> Text<span style="color: #339933;">::</span><span style="color: #006600;">vCard</span><span style="color: #339933;">::</span><span style="color: #006600;">Addressbook</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> Date<span style="color: #339933;">::</span><span style="color: #006600;">Parse</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$client</span> <span style="color: #339933;">=</span> WWW<span style="color: #339933;">::</span><span style="color: #006600;">Facebook</span><span style="color: #339933;">::</span><span style="color: #006600;">API</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">new</span><span style="color: #009900;">&#40;</span>
	desktop <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>
	api_key <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'</span><span style="color: #339933;">,</span>
	secret  <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$token</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$client</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">auth</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">create_token</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$client</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">get_login_url</span><span style="color: #009900;">&#40;</span> auth_token <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">$token</span><span style="color: #339933;">,</span> req_perms <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'friends_birthday'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/system.html"><span style="color: #000066;">system</span></a> <span style="color: #ff0000;">&quot;firefox&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$url</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/sleep.html"><span style="color: #000066;">sleep</span></a> <span style="color: #cc66cc;">15</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$client</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">auth</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">get_session</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$token</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$response</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$client</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">fql</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">query</span><span style="color: #009900;">&#40;</span>query <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'select first_name, last_name, birthday from user where uid in (select uid2 from friend where uid1=me())'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$ab</span> <span style="color: #339933;">=</span> text<span style="color: #339933;">::</span><span style="color: #006600;">vcard</span><span style="color: #339933;">::</span><span style="color: #006600;">addressbook</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">new</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;"># processes each contact and creates a vCard for it {{{</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$contact</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@$response</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$vc</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ab</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">add_vcard</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$fn</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$contact</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>first_name<span style="color: #009900;">&#125;</span> <span style="color: #339933;">||</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$ln</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$contact</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>last_name<span style="color: #009900;">&#125;</span> <span style="color: #339933;">||</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$ln</span> <span style="color: #339933;">=</span> <a href="http://perldoc.perl.org/functions/uc.html"><span style="color: #000066;">uc</span></a> <span style="color: #0000ff;">$ln</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$bd</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$contact</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>birthday<span style="color: #009900;">&#125;</span> <span style="color: #339933;">||</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$bd</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/,//g</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #0000ff;">$vc</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">fullname</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$fn</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">$ln</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$bd</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ss</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$mm</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$hh</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$day</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$month</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$year</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$zone</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> strptime<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$bd</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #0000ff;">$vc</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">bday</span><span style="color: #009900;">&#40;</span><a href="http://perldoc.perl.org/functions/join.html"><span style="color: #000066;">join</span></a><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;-&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1900</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$year</span> <span style="color: #339933;">||</span> <span style="color: #ff0000;">&quot; &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$month</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$day</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;"># }}}</span>
<a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #0000ff;">$ab</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">export</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$client</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">auth</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">logout</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>This is intended as a sample code for using the WWW::Facebook::API perl module (there are way too few working examples out there). Let me know if you need complementary explanations about anything.</p>
<p><strong><br />
The only thing I really need to figure out now is how to proceed if I ever wanted to distribute this code without giving away the application secret. There is a rather <a href="http://code.google.com/p/facebook-java-api/wiki/DesktopMode" target="_blank">good general explanation of the authentication process of a facebook desktop application</a>, but I couldn&#8217;t find a working sample code to get started with. If you do know how to do that, please share in the comments.<br />
</strong></p>
<p><!--adsense--></p>
<p><a href="http://www.sakana.fr/blog/2010/11/02/facebook-api-exporting-your-friends-birthdays-into-vcards-format/">Facebook API : Exporting your friends birthdays into vCards format</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=_dRHpl16A70:QsyrUMuxd8w: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=_dRHpl16A70:QsyrUMuxd8w:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=_dRHpl16A70:QsyrUMuxd8w:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=_dRHpl16A70:QsyrUMuxd8w:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=_dRHpl16A70:QsyrUMuxd8w:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=_dRHpl16A70:QsyrUMuxd8w:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=_dRHpl16A70:QsyrUMuxd8w:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=_dRHpl16A70:QsyrUMuxd8w: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/_dRHpl16A70" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2010/11/02/facebook-api-exporting-your-friends-birthdays-into-vcards-format/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.sakana.fr/blog/2010/11/02/facebook-api-exporting-your-friends-birthdays-into-vcards-format/</feedburner:origLink></item>
		<item>
		<title>AutoHotkey : Copying without formatting</title>
		<link>http://feedproxy.google.com/~r/sakana/articles/~3/NQGws-tj7TY/</link>
		<comments>http://www.sakana.fr/blog/2010/09/06/autohotkey-copying-without-formatting/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 20:48:31 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[AutoHotkey]]></category>
		<category><![CDATA[clipboard]]></category>
		<category><![CDATA[macro]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=451</guid>
		<description><![CDATA[One of the common annoyances of copy-pasting on Windows is that it tries to copy-paste the formatting as well. This issue can easily be fixed by the following AutoHotkey macro, which will copy the selection to the clipboard as pure text. ?Download macro.ahk1 2 3 4 5 6 7 8 9 ;;;;;;;;;;;;;;;;;;;;;;;;;; ; Copy without [...]<p><a href="http://www.sakana.fr/blog/2010/09/06/autohotkey-copying-without-formatting/">AutoHotkey : Copying without formatting</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>One of the common annoyances of copy-pasting on Windows is that it tries to copy-paste the formatting as well. This issue can easily be fixed by the following AutoHotkey macro, which will copy the selection to the clipboard as pure text.</p>
<p><span id="more-451"></span></p>
<p><!--adsense--></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=451&amp;download=macro.ahk">macro.ahk</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p45144"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code" id="p451code44"><pre class="ahk" style="font-family:monospace;">;;;;;;;;;;;;;;;;;;;;;;;;;;
; Copy without formatting
;;;;;;;;;;;;;;;;;;;;;;;;;;
^Ins::
	Clipboard =    ; Purge Clipboard content
	Send ^{Ins}  ; Send the Ctrl+Insert command
	ClipWait        ; Wait till data is present in the Clipboard
	Clipboard = %clipboard%    ;remove formatting
Return</pre></td></tr></table></div>

<p>That&#8217;s it. When hitting CTRL-Insert, the selection will be copied into the clipboard without formatting.</p>
<p>I am aware there are other ways around this problem, most stripping the formatting when pasting, but I had little success with them.</p>
<p><em><strong>What are your favorite AutoHotkey hacks ?</strong></em></p>
<p><!--adsense--></p>
<p><a href="http://www.sakana.fr/blog/2010/09/06/autohotkey-copying-without-formatting/">AutoHotkey : Copying without formatting</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=NQGws-tj7TY:DMns4-pi2Fc: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=NQGws-tj7TY:DMns4-pi2Fc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=NQGws-tj7TY:DMns4-pi2Fc:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=NQGws-tj7TY:DMns4-pi2Fc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=NQGws-tj7TY:DMns4-pi2Fc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=NQGws-tj7TY:DMns4-pi2Fc:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sakana/articles?i=NQGws-tj7TY:DMns4-pi2Fc:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sakana/articles?a=NQGws-tj7TY:DMns4-pi2Fc: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/NQGws-tj7TY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2010/09/06/autohotkey-copying-without-formatting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.sakana.fr/blog/2010/09/06/autohotkey-copying-without-formatting/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 1.365 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-02-01 02:35:40 --><!-- Compression = gzip -->

