<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Views on Life &#187; Planet</title>
	<atom:link href="http://blog.cone.be/category/planet/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.cone.be</link>
	<description>No Regrets.</description>
	<lastBuildDate>Thu, 18 Mar 2010 16:46:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Microsoft IE Javascript support added</title>
		<link>http://blog.cone.be/2010/02/24/microsoft-ie-javascript-support-added/</link>
		<comments>http://blog.cone.be/2010/02/24/microsoft-ie-javascript-support-added/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 11:26:55 +0000</pubDate>
		<dc:creator>Gert</dc:creator>
				<category><![CDATA[Interwebs]]></category>
		<category><![CDATA[Open Future]]></category>

		<guid isPermaLink="false">http://blog.cone.be/?p=3837</guid>
		<description><![CDATA[There, after spending a while figuring out why
if ( something.indexOf(select_groups[i]) == -1 ) {
threw an error; I was finally able to restore IE support. (poor misguided souls needn&#8217;t miss out on the Javascript goodies)
Apparently (Try to wrap your brain around this) the javascript version in IE doesnt support Array.indexOf()! All other browsers do, just not [...]]]></description>
			<content:encoded><![CDATA[<p>There, after spending a while figuring out why<br />
<code>if ( something.indexOf(select_groups[i]) == -1 ) {</code><br />
threw an error; I was finally able to restore IE support. (poor misguided souls needn&#8217;t miss out on the Javascript goodies)</p>
<p>Apparently (Try to wrap your brain around this) the javascript version in IE doesnt support Array.indexOf()! All other browsers do, just not The Internet Explorer! (You can explore, but dont go in too far.) And I&#8217;m talking about IE8 here, not IE6..</p>
<p>More on that topic on this blog post &#8220;<a href="http://www.stellapower.net/blog/javascript-support-and-arrayindexof-ie">JavaScript Support and Array.indexOf in IE</a>&#8221; (2008-08-13 &#8211; yes, 2008 and still its an issue!) The post also goes into the history; turning Mind boggling &#8220;WTF??&#8221; into &#8220;oh, MS is just being lazy&#8221;..</p>
<p><span id="more-3837"></span><br />
I did have to tinker slightly before it worked as expected; their solution returns nothing instead of -1 when no element was found. The solution is really simple<br />
<code>if (!Array.indexOf) {<br />
  Array.prototype.indexOf = function (obj, start) {<br />
    for (var i = (start || 0); i < this.length; i++) {<br />
      if (this[i] == obj) {<br />
        return i;<br />
      }<br />
    }<br />
   return -1;<br />
  }<br />
}<br />
</code><br />
and actually to be found in the last comment; though I only discovered that AFTER figuring this out myself. Took me a second to realize the code wasn't returning the -1 I needed for the rest of the code to do its jazz..</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cone.be/2010/02/24/microsoft-ie-javascript-support-added/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Internet &amp; Security</title>
		<link>http://blog.cone.be/2010/02/08/internet-security/</link>
		<comments>http://blog.cone.be/2010/02/08/internet-security/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 19:08:08 +0000</pubDate>
		<dc:creator>Gert</dc:creator>
				<category><![CDATA[Interwebs]]></category>
		<category><![CDATA[Planet]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blog.cone.be/?p=3805</guid>
		<description><![CDATA[The new technologies bring along a plethora of delightful new options for consumers to sample content. One of those new ways is the music samples some groups put online. A full track or even a full album to build the hype and allow people to sample the tracks and to persuade them to Go out [...]]]></description>
			<content:encoded><![CDATA[<p>The new technologies bring along a plethora of delightful new options for consumers to sample content. One of those new ways is the music samples some groups put online. A full track or even a full album to build the hype and allow people to sample the tracks and to persuade them to Go out and BUY their newest creative offspring. And we all love it. It works, its Awesome! Embrace Technology.</p>
<p>A pitty though is the fact that many of these fancy previews lack the least of security measures to keep the actual music safe. The previews are on sites with fancy flash based interfaces to enable people to play them from the browser without hassle and instead of building a decent degree of security into that player, some of them just take plain mp3 files from sites. Fully tagged Mp3s that ll just download to any location and Play. Want them? Go trough the source, click on the mp3 links and wait till the goodies have downloaded. You will have to rename the files to the correct names, but since the mp3 files are cleanly tagged, that wont be an issue &#8211; and you cant have it all ey.</p>
<p>In a time where a lot of cds are nearly unusable due to draconic DRM measures, where DVDs play only in certain regions and where you re getting fucked in the arse whenever you shell out hard earned money to enjoy music or a movie. (Dont get me started about the modern day Cinema experience!) Its unbelievable that the other end of the line is So under protected. Im not advocating for DRM here, but to be honest .. if I would have put those online, Id at least chosen a method with a bit more protection along the way.</p>
<p>And its not as if these dont exist.. Take the new <a href="http://www.gorillaz.com/">Gorillaz</a> site for example. Im a big fan of the <a href="http://twitter.com/murdocgorillaz">Murdoc</a> podcasts and I wouldnt mind listening to them in my car. Contrary to other online content, they go trough the effort of using a flash player (so far we re on the same road as the aforementioned) and having that player connect to a streaming server with a bit more protection to the whole, instead of just placing .mp3 download links in their source!!</p>
<p>Now, lets get down to brass tacks here. Talking as an IT and Security professional with a dose of real life common sense. Not everyone will read the source code to see if it contains usable links (im just curious like that) and then proceed to download those instead of just listening to them on the web site as it was initially intended. And as a second, a stream server isnt failsafe either. Take the time to figure out how it wants its url and how to piece it all together; open VLC and stream it to disk and you ve got the music too. And if you re not up to any of the above, you can take the radio style approach and just have some software record whatever your computer outputs. Or go Really low tech and just hang a mic in front of your speakers while playing them and record that. There is ALWAYS a way <img src='http://blog.cone.be/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>All im saying is .. You cant at the same time <em>screw up the cd I just bought to a degree where it wont play on my car radio</em>; and at the same time put the mp3s in a clickable format in the webpage source, ready for free downloading for anyone who can right click a mouse.</p>
<p>That being said.. Thank you for the Music!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cone.be/2010/02/08/internet-security/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Audiobooks</title>
		<link>http://blog.cone.be/2010/01/08/audiobooks/</link>
		<comments>http://blog.cone.be/2010/01/08/audiobooks/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 01:56:11 +0000</pubDate>
		<dc:creator>Gert</dc:creator>
				<category><![CDATA[Entertainment]]></category>
		<category><![CDATA[Planet]]></category>

		<guid isPermaLink="false">http://blog.cone.be/?p=3755</guid>
		<description><![CDATA[I like stories. Movies, Books, whatever the format. One of the problems is that I cant always read or watch. Like when driving. Some people seem to think that would be stoopid. So I&#8217;m down to audiobooks. And im not averse to it, I had stories on records and cds as a child, I love [...]]]></description>
			<content:encoded><![CDATA[<p>I like stories. Movies, Books, whatever the format. One of the problems is that I cant always read or watch. Like when driving. Some people seem to think that would be stoopid. So I&#8217;m down to audiobooks. And im not averse to it, I had stories on records and cds as a child, I love that crap <img src='http://blog.cone.be/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  And since I go trough them at a rate and since ill be spending some time stuck in a tiny spot on a bus, I went hutning.</p>
<p>There are obviously several options to get them.</p>
<ul>
<li> Buy the CDs</li>
<li> Get them at a library</li>
<li> Buy the audio online</li>
<li> Download the free ones</li>
<li> Download them (yes, Piracy)</li>
</ul>
<p>These are the options I know of so far and if I missed any, please do point that out to me <img src='http://blog.cone.be/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Next important detail is HOW I want to listen to these. There are 3 platforms I use to listen to auidobooks. I could name nore, but Id be lying <img src='http://blog.cone.be/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I listen on my (Ubuntu) laptop, I listen to them in my car (on my Excelent Opel Insignia DVD800 car entertainment system) and on my Android phone. Lets be honest here, the easies common denominator in audio tech here is the MP3. Yes, I d love to go Ogg, but my car doesnt talk ogg. And thats a deal breaker. So, I need my crap in Mp3!</p>
<p>Oh yeah, I also dont have tons of money to throw around on this all!</p>
<p>Now, lets look to the options in that light.</p>
<p><strong>Buy the CDs</strong><br />
There are stores that sell them. They have good choice, not great though last time I checked. Last time I checked is some odd years ago and I havent checked since for one simple reason. The prohibitive cost of the audiobooks. I remember prices of 40 euros and more (most of them were considerably more) and although I do respect the huge amount of money and whatnot that goes into those, that was just Too Expensive. Certainly for a book Ill only listen to once or twice!</p>
<p><strong> Get them at a library</strong><br />
This is what I did today. I went to the library and perused their catalogue.. They had a nice selection and I easilly picked up 3 audio books. 2 in dutch, 1 in english (an Ian rankin one!!) So far so good. Now, as we discussed, Ill need an mp3 version to listen to them on my devices of choice. (Dont worry, Ill delete the mp3s before I turn them back in to the library) So lets start the ripping. Thats 3cds, 6cds and another 6cds. Thats a lot of ripping, but it should last me a while so why not. Ripping a cd is easy and fast anyway, no?<br />
Well, no! Turns out these pretty library CDs all come in fancy slide in sleeves that Fuck up the disks. Theres a 2003 book in slide sleeves &#8211; Several tracks were in BAD shape. There was a 2007 book in fancy sleeves, Even worse shape! And finally there is the Rankin book from 2006 in a regular jewel case and .. im up to cd3 now and so far so good. Either people who understand english have more respect for library materials, or the fancy slide in sleeves are CRAP! Now, after the 2nd audiobook I was about to eat a disk out of pure frustration.. Luckilly, this last one appears to be in better shape. All n all, its a viable but painfull option.</p>
<p><strong>Buy the audio online</strong><br />
The first name that comes to mind is Audible. And I had a long and hard look at the site recently because I really wanted to give them my money! I mean, digital audiobooks, ready to download to my computer.. sounds swell! Turns out they dont WANT my money! They do not support ANY of the devices I own. Not Linux, not my Android (though the d like to .. but that doesnt help me) and not my car! So audible is out!</p>
<p>Luckilly, I (re)discovered <a href="http://www.emusic.com/">eMusic</a> yesterday. They have a nice assortment on their <a href="http://www.emusic.com/audiobooks/index.html">emusic.com/audiobooks/</a> page, nothing like the abundancy of Audible, but at least they offer drm free, vanilla MP3s instead of some crappy and obscure format! They also offer a trial both for their music (25 free song credits) and audiobooks (1 free book credit) and I spent all of it yesterday, testing their service. They offer a downloader which facilitates the task of downloading the 20 or so mp3s that make up an audiobook and its a simple downloader that Just Works. You could also parse the file by hand since its regular xml, but why do that with such an easy to use downloader <img src='http://blog.cone.be/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  And they do offer a Linux one by the way, so no mucking about with wine or whatever.<br />
Im quite convinced by their service at this time. Ill probably give them a few months to fully persuade me. And in the mean time, ill be listening to the 1 cred a month at 12 euros scheme. Pitty the credits dont carry over though.. That means the only way to get a 2 cred audiobook is to buy the more expensive subscription. A pitty. Though maybe they ll change that .. We can hope <img src='http://blog.cone.be/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><strong>Download the free ones</strong><br />
First I d like to start with a shout out to the good people at <a href="http://librivox.org/">librivox.org</a>! They re a bunch of people reading old books that are out of the copyright and they put them up for us to download for free <img src='http://blog.cone.be/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Its a wonderful community and I have enjoyed several great stories trough their efforts.<br />
The downside however is that they have several narrators and that I dont like them all equally. Sometimes their vision of how a book should be read is utterly tangential to my feel of the book and thats a real deal breaker. That and the fact that they just Dont have that many books to choose from! I listened to Jeckyl and Hyde, Dracula, whatnot, but I quickly exhausted the list.<br />
Another great source for free audio material is the <a href="http://www.archive.org">archive.org</a>! You ll have to do a bit of looking there to actually get to what you re looking for, but after a search, you ll find litle pearls of radio history, Old Time Radio, like X-Minus-One or Dragnet or Murder at Midnight. These will obviously not be for everyone, but there are some great stories in there and not to be underestimated, some great Golden Era SciFi stories! Worth the time to listen to. Though Id have to admit, some of it was of such a bad quality that I wasnt able to listen to it on my previous car radio..<br />
Not to mention several other small sites or whatever that focus on free audio material. One example being this great dutch resource: <a href="http://hoorspel.wordpress.com/">http://hoorspel.wordpress.com/</a></p>
<p><strong>Download them (yes, Piracy)</strong><br />
And finally the big push into illegality. Needless to say, the current copyright owners frown upon the downloading of their content and will gladly have their legal staff piss over you, your house, your pets, your family and the graves of your dead relatives. That being said, it IS somewhat of a solution, though there is apparently not that much of a choice. There are obviously not much people into the whole audiobook thing. And, lets be honest, its somewhat of a hastle. Then again, so is ripping the cds you legally bought at 50 euro in a store.</p>
<p><em>In the end..</em></p>
<p>Im giving eMusic a chance. Its not THAT expensive, certainly compared to other solutions and its fully hassle free. As a close second is the library though the process of ripping those onto my players is plain painfull. And an honorable mention to the free options, they kept me going for a LONG while before having to resort to these other options. Its just that Ive exhausted those. And you need a love for the old stuff or it wont help you either <img src='http://blog.cone.be/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cone.be/2010/01/08/audiobooks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert a Wammu backup file to a .csv</title>
		<link>http://blog.cone.be/2010/01/06/convert-a-wammu-backup-file-to-a-csv/</link>
		<comments>http://blog.cone.be/2010/01/06/convert-a-wammu-backup-file-to-a-csv/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 19:27:31 +0000</pubDate>
		<dc:creator>Gert</dc:creator>
				<category><![CDATA[Information technology]]></category>
		<category><![CDATA[Planet]]></category>
		<category><![CDATA[Project]]></category>

		<guid isPermaLink="false">http://blog.cone.be/?p=3748</guid>
		<description><![CDATA[Yes, this post is indeed about a Quick and Dirty tool to &#8220;Convert a Wammu backup file to a .csv&#8221; ready for gMail import. I dicked around with the wammu.backup file to get it to plain text for reference and then figured Id better write some quick perl to get it to a .csv so [...]]]></description>
			<content:encoded><![CDATA[<p>Yes, this post is indeed about a Quick and Dirty tool to &#8220;Convert a Wammu backup file to a .csv&#8221; ready for gMail import. I dicked around with the wammu.backup file to get it to plain text for reference and then figured Id better write some quick perl to get it to a .csv so I could import that into my gMail account. Since my Android phone automagically synchronizes with my gMail contacts (gotta love it)</p>
<p>I started writing the perl after I dicked around a bit with the file. The file is by default DOS formatted, illegible and apparently encoded in utf-16. Since I first wanted it as a reference (to grep, cat or less in a term window) so I did the following. You ll have to do this too (do feel free to submit the Perl code in the comments to skip this part <img src='http://blog.cone.be/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )</p>
<ul>
<li>Open the file using vi.</li>
<li>Save file<br />
<blockquote><p>:w ConvertMe.txt</p></blockquote>
</li>
<li>Set unix encoding<br />
<blockquote><p>:set ff=unix</p></blockquote>
</li>
<li>Reset the encoding<br />
<blockquote><p>:set fileencoding=default</p></blockquote>
</li>
<li>Save! (use the :w)</li>
</ul>
<p>Next part is the Perl script. (The code is after the jump..)<br />
The script reads a file called ConvertMe.txt &#8211; You can change this in the script, but really, why <img src='http://blog.cone.be/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<ul>
<li> run convert.pl , this will output the .csv on the screen</li>
<li> run convert.pl &gt; converted.csv to get the google ready csv..</li>
</ul>
<p>Importing into gMail is really simple. Login and click &#8220;Contacts&#8221; (Left sidebar), click &#8220;Import&#8221; (on top of the contacts list to the right) and import it using the menu. I imported slightly over 260 contacts and decided it was a bad idea seconds later since I now have a lot of work to sort those out. Thats a pain in the arse. And Im not sure why, but the find duplicates doesnt find nearly half of them. Apparently it doesnt compare the phone nrs. Probably something to do with false positives.. Cool option though.. I DID import them into a separate category and that does help! Beats doing them by hand..</p>
<p>What if this doesnt work?<br />
<span id="more-3748"></span>There are three options for output..</p>
<p>You ll find the following in the code. Its not that long, do a search <img src='http://blog.cone.be/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<blockquote><p># Print de codes?<br />
my $codes = 1;</p></blockquote>
<p>to print all the codes in the file you re having parsed. This reads the file and spews out all the different tags in there in an easy list.</p>
<blockquote><p># Print de raw data<br />
my $raw = 1;</p></blockquote>
<p>Print the raw data. Prints all the tags for every contact, so you dan easilly check if all looks right</p>
<blockquote><p># Print de geparste code<br />
my $parse = 1;</p></blockquote>
<p><em>This is enabled by default.</em> This option parses all your data into the .csv format.</p>
<p>If the last fails, its possible you need to change or add to the tags described in the .csv file. This defenition starts at line 66, the # Parse data line. First check what tags your file provides by setting the $codes option and then fill these in on the right lines in the script. Dont remove the commas or the .csv will fail to parse correctly. Just add the fields in front, analogous to the current settings. Dont worry about the tags that wont be filled, they will be empty. Dont worry, it ll work <img src='http://blog.cone.be/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>The Source.. (keep the quick and dirty in mind while reading this and yeah, my blog screws the indentation. Mea Culpa)</p>
<p><code><strong>convert.pl</strong><br />
#!/usr/bin/perl -X<br />
use strict;</p>
<p> my $id;<br />
 my $type;<br />
 my %data;<br />
 my %dataTypes;</p>
<p># Print de codes?<br />
my $codes;<br />
# Print de raw data<br />
my $raw;<br />
# Print de geparste code<br />
my $parse = 1;</p>
<p>open (MYFILE, 'ConvertMe.txt');<br />
while (<MYFILE>) {</p>
<p> $_ =~ s/[\t\n\r\f]//g;</p>
<p>unless ($_ =~ m/\[.*/) {<br />
 my @lijn = split(/ = /);</p>
<p> if ( $lijn[0] =~ m/.*Location.*/ ) {<br />
   $id = $lijn[1];<br />
  } else {</p>
<p>   if ($type) {<br />
    $data{$id}{$type} = $lijn[1];<br />
    $type = "";<br />
   } elsif ($lijn[1]) {<br />
    $type = $lijn[1];<br />
    $dataTypes{$lijn[1]} = $lijn[1];<br />
   }<br />
  }<br />
 }<br />
}</p>
<p>close (MYFILE); </p>
<p>if ($codes) {<br />
 print "Codes: \n";<br />
 foreach my $tkey (keys %dataTypes) {<br />
    print $tkey . " ";<br />
 }<br />
 print "\n\n\n";<br />
}</p>
<p>if ($raw) {<br />
 foreach my $key (keys %data) {<br />
   print $key;<br />
  foreach my $tkey (keys %dataTypes) {<br />
    print $tkey . " " . $data{$key}{$tkey} . "\n";<br />
   }<br />
 }<br />
}</p>
<p>if ($parse) {<br />
 # print the first line containing the col titles<br />
 print "Name,Given Name,Additional Name,Family Name,Yomi Name,Given Name Yomi,Additional Name Yomi,Family Name Yomi,Name Prefix,Name Suffix,Initials,Nickname,Short Name,Maiden Name,Birthday,Gender,Location,Billing Information,Directory Server,Mileage,Occupation,Hobby,Sensitivity,Priority,Subject,Notes,Group Membership,E-mail 1 - Type,E-mail 1 - Value,E-mail 2 - Type,E-mail 2 - Value,E-mail 3 - Type,E-mail 3 - Value,E-mail 4 - Type,E-mail 4 - Value,Phone 1 - Type,Phone 1 - Value,Phone 2 - Type,Phone 2 - Value,Phone 3 - Type,Phone 3 - Value,Phone 4 - Type,Phone 4 - Value,Address 1 - Type,Address 1 - Formatted,Address 1 - Street,Address 1 - City,Address 1 - PO Box,Address 1 - Region,Address 1 - Postal Code,Address 1 - Country,Address 1 - Extended Address\n";</p>
<p> # Parse data<br />
 # Tinker here if all your data isnt in the .csv output<br />
 foreach my $key (keys %data) {<br />
   print "".<br />
	$data{$key}{Name} . "," . #Name,<br />
        $data{$key}{FirstName} . "," . #Given Name,<br />
        "," . #Additional Name,<br />
        $data{$key}{LastName} . "," . #Family Name,<br />
        "," . #Yomi Name,<br />
        "," . #Given Name Yomi,<br />
        "," . #Additional Name Yomi,<br />
        "," . #Family Name Yomi,<br />
        "," . #Name Prefix,<br />
        "," . #Name Suffix,<br />
        "," . #Initials,<br />
        "," . #Nickname,<br />
        "," . #Short Name,<br />
        "," . #Maiden Name,<br />
        "," . #Birthday,<br />
        "," . #Gender,<br />
        "," . #Location,<br />
        "," . #Billing Information,<br />
        "," . #Directory Server,<br />
        "," . #Mileage,<br />
        $data{$key}{Company} . "," . #Occupation,<br />
        "," . #Hobby,<br />
        "," . #Sensitivity,<br />
        "," . #Priority,<br />
        "," . #Subject,<br />
        $data{$key}{Custom1} ;<br />
print " - " if ($data{$key}{Custom1} &#038;&#038; $data{$key}{Note});<br />
print $data{$key}{Note} . "," . #Notes,<br />
        "," ; #Group Membership,<br />
print "* " if ($data{$key}{Email});<br />
print "," . #E-mail 1 - Type,<br />
        $data{$key}{Email} . "," . #E-mail 1 - Value,<br />
        "," . #E-mail 2 - Type,<br />
        "," . #E-mail 2 - Value,<br />
        "," . #E-mail 3 - Type,<br />
        "," . #E-mail 3 - Value,<br />
        "," . #E-mail 4 - Type,<br />
        "," ; #E-mail 4 - Value,<br />
print "Other" if ($data{$key}{NumberGeneral});<br />
print "," . #Phone 1 - Type,<br />
        $data{$key}{NumberGeneral} . "," ; #Phone 1 - Value,<br />
print "Home" if ($data{$key}{NumberHome});<br />
print "," . #Phone 2 - Type,<br />
        $data{$key}{NumberHome} . "," ; #Phone 2 - Value,<br />
print "Work" if ($data{$key}{NumberWork});<br />
print "," . #Phone 3 - Type,<br />
        $data{$key}{NumberWork} . "," ; #Phone 3 - Value,<br />
print "Mobile" if ($data{$key}{NumberMobile});<br />
print "," . #Phone 4 - Type,<br />
        $data{$key}{NumberMobile} . "," ; #Phone 4 - Value,<br />
print "Home" if ($data{$key}{Address});<br />
print "," . #Address 1 - Type,<br />
        $data{$key}{Address} . "," . #Address 1 - Formatted,<br />
        $data{$key}{Address} . "," . #Address 1 - Street,<br />
        $data{$key}{City} . "," . #Address 1 - City,<br />
        "," . #Address 1 - PO Box,<br />
        "," . #Address 1 - Region,<br />
        $data{$key}{Postal} . "," . #Address 1 - Postal Code,<br />
        $data{$key}{Country} . "," . #Address 1 - Country,<br />
        "," . #Address 1 - Extended Address<br />
	"\n";<br />
 }<br />
}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cone.be/2010/01/06/convert-a-wammu-backup-file-to-a-csv/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Gnu Screen ; Different regions, Logging, Screen Window Types</title>
		<link>http://blog.cone.be/2009/12/01/gnu-screen-different-regions-logging-screen-window-types/</link>
		<comments>http://blog.cone.be/2009/12/01/gnu-screen-different-regions-logging-screen-window-types/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 19:00:01 +0000</pubDate>
		<dc:creator>Gert</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Future]]></category>

		<guid isPermaLink="false">http://blog.cone.be/?p=3644</guid>
		<description><![CDATA[I wrote this Gnu Screen guide in December &#8216;08 with the previous incarnation of linux.com in mind. January 2009 however, linux.com started on its new and exciting path as a community site and the article just sat on my machine, waiting. So I decided to publish it on my blog in a four part series [...]]]></description>
			<content:encoded><![CDATA[<p><em>I wrote this Gnu Screen guide in December &#8216;08 with the previous incarnation of <a href="http://www.linux.com/">linux.com</a> in mind. January 2009 however, linux.com started on its new and exciting path as a community site and the article just sat on my machine, waiting. So I decided to publish it on my blog in a four part series over the following month. Maybe someone can use it <img src='http://blog.cone.be/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </em></p>
<p>Have you ever had to run a time consuming process (say mkfs or compiling something) over a shoddy ssh connection? Or cleanly run several commands in parallel without having several open connections to that server? Or maybe you were programming and wanted a mysql prompt, a bash prompt and several text editors open? How about that ssh tunnel you need open and dont want to close by accident? And did you ever need to perform the same task on several different machines? Or connect to a serial terminal? Or maybe you just want a log file of what you re doing..<br />
These are day to day situations any linux user will run into, that can be quite frustrating. That is, before you discover <a href="http://www.gnu.org/software/screen/">Gnu screen</a>!</p>
<p>&#8220;Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells.&#8221; Or at least, thats what the site calls it. Sounds easy enough, but there are an amazing amount of different uses for this incredible piece of software. The above list is some of the uses I could readily think about &#8211; some of the ways I regularly use screen, but like any decent linux tool &#8211; the sky really is the limit! I&#8217;ll be looking into different issues, so lets jump into some of the practical solutions for those problems.</p>
<p><strong>The Fun Stuff &#8211; Different regions</strong><br />
Sometimes, having several windows is not enough.. It can help to have several different windows visible in your terminal and screen is able to provide you with that. As before, we need to open a screen session and open several windows. You could actually also do this with one window, but there wouldnt really be much point to it with one window. Once the new windows are opened, you can split the screen with the following shortcut.</p>
<pre>C-a S       (split)       Split the current region into two new ones.
C-a tab     (focus)       Switch the input focus to the next region.</pre>
<p>With these commands, you can create several regions and switch between them. These regions contain the same regular windows we spoke about before and as such, all normal commands can be used to control their contents. You can choose any window to be shown inside these regions. To close and further controll these regions, you can use the following shortcuts.</p>
<pre>C-a X       (remove)      Kill the current region.
C-a Q       (only)        Delete all regions but the current one.
C-a F       (fit)         Resize the window to the current region size.</pre>
<p>These are the default defined shortcuts for the regions. There are however more commands to control your regions, they just are not bound to shortcuts. For a comprehensive list of these other options, I advise you to comb trough the screen man page and do a search for &#8220;region&#8221;. There is ,however, one interesting command I don&#8217;t want you to miss! (Small blatant man copying coming up)</p>
<pre>resize
       Resize  the  current region. The space will be removed from or added to
       the region below or if thereâ€™s not enough space from the region  above.
              resize +N   increase current region height by N
              resize -N   decrease current region height by N
              resize  N   set current region height to N
              resize  =   make all windows equally high
              resize  max maximize current region height
              resize  min minimize current region height</pre>
<p>You will probably not want these windows the same size, so the resize command is really indispensable. Just like before, to use this commands, you have to call up the command line mode and input these commands there.</p>
<p><strong>The Fun Stuff &#8211; Logging</strong><br />
Screen provides a simple mechanism for logging a session. It suffices to enable the logging in any of the three ways described below. The Parameter</p>
<pre>-L    turns output logging on for this window.</pre>
<p>The shortcut</p>
<pre>C-a H       (log)         Begins/ends logging of the current window to the file "screenlog.n".</pre>
<p>Or the command.</p>
<pre>log [on|off]</pre>
<p>These commands enable logging to the standard &#8220;screenlog.%n&#8221; file, in the standard directory. Should this file already exist, screen will append the new data to the existing file.<br />
To configure the logging in more detail, screen also accepts the following two commands.</p>
<pre>logfile filename
logfile flush secs</pre>
<p>These commands allow the user to configure what name the logfile should have and how many seconds screen should wait before flushing the the logfile buffer to the system.</p>
<ul>
<li>Or maybe you just want a log file of what you re doing..</li>
</ul>
<p>And using the above command, keeping that logfile is as easy as adding a parameter or using a shortcut. In using this system, you will soon discover that the logging is a wonderful and valuable tool, but also that when it comes to color tags and advanced ascii based menus or effects, the logs might turn out less than optimal. I&#8217;m thinking about the SLES Yast tool or even the fancy scp or yum progress bar. These commands will &#8220;replay&#8221; trough the log files while you read them and this does not always look as nice as you d probably like it to. This is however unavoidable and as such quite normal.<br />
You might also want to look into the hardcopy concept; a de facto text based screenshot.</p>
<p><strong>The Fun Stuff &#8211; Screen Window Types</strong></p>
<p>And just when we thought we &#8216;d seen it all, after the vast array of different options, all the possibilities of screen.. There is still one more special option to mention. Screen has three different window types.</p>
<p>The first window type is the normal window type we&#8217;ve been using all along. The regular window with a traditional shell inside.</p>
<p>The second window is initiated by starting screen with as a first parameter a tty (character special device) device name, like for example /dev/ttya. This command connects screen directly to the character device and allows interaction with for example a null modem serial connection trough screen. To accommodate this, screen takes baud and other relevant settings as parameters. The info command now returns some of the modem control lines in the status line and the break command now sends the standard break signal over the device.</p>
<p>The third type is a telnet window. This is started using //telnet as a first parameter, followed by the host name and optionally a port as the third parameter. Screen will then act as a telnet client and interface with a remote telnet server. As with the device type, the telnet window returns telnet specific information when using the &#8220;info&#8221; command. The break command sends the telnet break signal to the server. This option is only available if screen was compiled with the BUILTIN_TELNET option.</p>
<ul>
<li>Or connect to a serial terminal?</li>
</ul>
<p>Its in the end as simple as ..</p>
<pre>screen /dev/ttyS0 19200 1n8</pre>
<p>This might not seem too spectacular as an option, but not needing an extra program and instead being able to use good &#8216;ol screen can be a good and quick solution for when you need this, instead of installing minicom or whatnot.<br />
And remember .. &#8220;A  weird  imagination  is most useful to gain full advantage of all the features.&#8221; (Listed as a bug under the screen man page.)</p>
<p><strong>The articles in this series focus on the following topics..</strong></p>
<ul>
<li> The Simple stuff
<ul>
<li><a href="http://blog.cone.be/2009/11/10/gnu-screen-an-invaluable-tool-2/">Slightly more advanced stuff</a></li>
</ul>
</li>
<li> The fun stuff
<ul>
<li><a href="http://blog.cone.be/2009/11/17/gnu-screen-command-parameter-multi-display-mode-copy-mode/">Command Parameter, Multi display mode, Copy Mode</a></li>
<li><a href="http://blog.cone.be/2009/11/24/gnu-screen-nethack-different-screen-windows-sending-commands-to-all-screen-windows/">Nethack, Different screen windows, Sending commands to all screen windows</a></li>
<li><em><a href="http://blog.cone.be/2009/12/01/gnu-screen-different-regions-logging-screen-window-types/">Different regions, Logging, Screen Window Types</a></em></li>
<li> the .screenrc</li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.cone.be/2009/12/01/gnu-screen-different-regions-logging-screen-window-types/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open-Future Launch Party</title>
		<link>http://blog.cone.be/2009/12/01/open-future-launch-party/</link>
		<comments>http://blog.cone.be/2009/12/01/open-future-launch-party/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 10:22:51 +0000</pubDate>
		<dc:creator>Gert</dc:creator>
				<category><![CDATA[Open Future]]></category>

		<guid isPermaLink="false">http://blog.cone.be/?p=3695</guid>
		<description><![CDATA[Im happy to say we re having our Launch Party on 12/07/09 at the Oude Abdij in our home town of Kortenberg!

We spent an exciting period of setting up the tools and servers and are now Ready to come out and Party  

Open-Future Launch Party &#8211; Making Open Source work for You!
Date: 7/12/2009
Location: Oude [...]]]></description>
			<content:encoded><![CDATA[<p>Im happy to say we re having our Launch Party on 12/07/09 at the Oude Abdij in our home town of Kortenberg!<br />
<a href="http://open-future.be/open-future-launch"><img class="alignnone" title="Open-Future Launch party" src="http://open-future.be/sites/default/files/oflaunch-web.png" alt="" width="382" height="540" /></a><br />
We spent an exciting period of setting up the tools and servers and are now Ready to come out and Party <img src='http://blog.cone.be/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<ul>
<li>Open-Future Launch Party &#8211; Making Open Source work for You!</li>
<li>Date: 7/12/2009</li>
<li>Location: Oude Abdij, Kortenberg</li>
<li>Timing: 4 to 6 PM</li>
<li>Address: Abdijdreef 22, 3070 Kortenberg</li>
<li>Subscribe at <a href="mailto:marketing@open-future.be">marketing@open-future.be</a></li>
<li>Feel free to <strong>forward</strong> this invitation to anyone you feel might be interested!</li>
<li>Sponsored by <a href="http://www.redhat.com/">Redhat</a> and <a href="http://www.zarafa.com/">Zarafa</a></li>
<li><a href="http://www.open-future.be">www.open-future.be</a></li>
</ul>
<p>Meet the crew! Attend the party and have a drink <img src='http://blog.cone.be/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Its on us..</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cone.be/2009/12/01/open-future-launch-party/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Gnu Screen ; Nethack, Different screen windows, Sending commands to all screen windows</title>
		<link>http://blog.cone.be/2009/11/24/gnu-screen-nethack-different-screen-windows-sending-commands-to-all-screen-windows/</link>
		<comments>http://blog.cone.be/2009/11/24/gnu-screen-nethack-different-screen-windows-sending-commands-to-all-screen-windows/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 19:00:03 +0000</pubDate>
		<dc:creator>Gert</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Future]]></category>

		<guid isPermaLink="false">http://blog.cone.be/?p=3642</guid>
		<description><![CDATA[I wrote this Gnu Screen guide in December &#8216;08 with the previous incarnation of linux.com in mind. January 2009 however, linux.com started on its new and exciting path as a community site and the article just sat on my machine, waiting. So I decided to publish it on my blog in a four part series [...]]]></description>
			<content:encoded><![CDATA[<p><em>I wrote this Gnu Screen guide in December &#8216;08 with the previous incarnation of <a href="http://www.linux.com/">linux.com</a> in mind. January 2009 however, linux.com started on its new and exciting path as a community site and the article just sat on my machine, waiting. So I decided to publish it on my blog in a four part series over the following month. Maybe someone can use it <img src='http://blog.cone.be/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </em></p>
<p>Have you ever had to run a time consuming process (say mkfs or compiling something) over a shoddy ssh connection? Or cleanly run several commands in parallel without having several open connections to that server? Or maybe you were programming and wanted a mysql prompt, a bash prompt and several text editors open? How about that ssh tunnel you need open and dont want to close by accident? And did you ever need to perform the same task on several different machines? Or connect to a serial terminal? Or maybe you just want a log file of what you re doing..<br />
These are day to day situations any linux user will run into, that can be quite frustrating. That is, before you discover <a href="http://www.gnu.org/software/screen/">Gnu screen</a>!</p>
<p>&#8220;Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells.&#8221; Or at least, thats what the site calls it. Sounds easy enough, but there are an amazing amount of different uses for this incredible piece of software. The above list is some of the uses I could readily think about &#8211; some of the ways I regularly use screen, but like any decent linux tool &#8211; the sky really is the limit! I&#8217;ll be looking into different issues, so lets jump into some of the practical solutions for those problems.</p>
<p><strong>The Fun Stuff &#8211; Nethack</strong><br />
Because linux is all about FUN (or at least written by fun loving people), screen has a cool option where all messages are given nethack style, instead of the standard bland wording. Screen has to be compiled using the Nethack option, but most linux distributions do.<br />
The nethack option it toggled by the presence of the $NETHACKOPTIONS environment variable or a ~/.nethackrc file.</p>
<pre>No other window.</pre>
<p>becomes</p>
<pre>You cannot escape from window 0!</pre>
<p>or</p>
<pre>Creating logfile "screenlog.0".</pre>
<p>becomes</p>
<pre>You add to your scroll of logging named "screenlog.0".</pre>
<p>The nethack ones are actually More Fun, really!</p>
<p><strong>The Fun Stuff &#8211; Different screen windows</strong><br />
Up till now, we covered using screen and the posibilities of several sessions. But because switching between sessions is not really what you d call user friendly or quick, screen has an interesting mechanism called windows. One screen session can contain several windows and switching between these is simple using a number of shortcuts. The existing screen terminal is always the first window. To create a new window, use the following shortcut.</p>
<pre>C-a c
C-a C-c     (screen)      Create a new window with a shell and switch to that window.</pre>
<p>This creates a new window &amp; switches to that window. Now you have two (or more if you want) different windows in the same screen session. To switch between the different sessions, you can use the following shortcuts.</p>
<pre>C-a space
C-a n
C-a C-n     (next)        Switch to the next window.

C-a backspace
C-a h
C-a p
C-a C-p     (prev)        Switch to the previous window.</pre>
<p>This is a good way to switch between the windows, but it quickly grows old when you have a lot of open windows to switch between. To make things a bit more manageable; screen has several other shortcuts.</p>
<pre>C-a â€™       (select)      Prompt for a window name or number to switch to.C-a 0       (select 0)
  ...            ...
C-a 9       (select 9)
C-a -       (select -)    Switch to window number 0 - 9, or to the blank window.</pre>
<p>These help, but there is still a better way.</p>
<pre>C-a "       (windowlist -b)  Present a list of all windows for selection.</pre>
<p>This shortcut gives the user an interface where he can select an open window.</p>
<pre>Num Name                                                                                                        Flags
Â 0 bash                                                                                                            $
Â 1 bash                                                                                                            $
 2 bash                                                                                                            $</pre>
<p>And to keep this heap of windows organised, there are yet 2 more shortcuts.</p>
<pre> C-a A       (title)       Allow the user to enter a name for the current window.
 C-a N       (number)      Show the number (and title) of the current window.</pre>
<p>These are a lot of different shortcuts and mechanisms, but in the end &#8211; its all worth the effort! Lets take a look at the list of examples we made at the start of the article and solve another one!</p>
<ul>
<li>Or maybe you were programming and wanted a mysql prompt, a bash prompt and several text editors open?</li>
</ul>
<p>I dont think the practical side of this example needs much more explaining. Opening the screen session, creating the different windows, renaming the windows and using them appropriately should be straightforward enough. Setting the whole thing up only needs to be done once, since you can simply detach the session, However if you need this setup on a regular basis, you can configure your &#8220;.screenrc&#8221; to load it at startup. More on the .screenrc later.</p>
<p><strong>The Fun Stuff &#8211; Sending commands to all screen windows</strong><br />
Once you re used to the multiple windows, you might run into a situation where you want to send a same command to several of these open windows. Screen provides in the &#8220;at&#8221; command to do this. First you ll need to open command line mode.</p>
<pre>C-a :       (colon)       Enter command line mode.</pre>
<p>This way you can type a command once, but you ll still have to enter each separate window. But there is a better way. As an example we &#8216;ll send &#8220;ls -l&#8221; to all the windows.</p>
<pre>at "#" stuff "ls -l^M"</pre>
<p>This command is barely readable, so let&#8217;s pick it apart! The first part is &#8216;at [identifier][#|*|%] command&#8217;. The at command sends the text parameter to all the windows you specified in the identifier.  You can match the criteria to either the window name or number with #, the user name with * or the displays, using %. The next part is the command you want to run in the selected windows. We&#8217;re using &#8220;stuff&#8221; to stuff the command we want to execute into the input buffer of the selected windows. Stuff is really straightforward. It simply stuffs the string you gave as a parameter. Next problem is the command. Or rather having it executed! To get screen to put an &#8220;enter&#8221; after the command, to execute the command, add &#8220;^M&#8221; at the end. You can do a lot more with this than just sending an ls to the input. Any screen command, like renaming, moving windows around, whatnot .. is available in combination with &#8220;at&#8221;.<br />
This also applies to screen session using the -X parameter on the command line, for those special occasions where you just dont want to connect to the session or when you&#8217;re scripting something wholly exciting!<br />
Special thanks go out to <a href="http://nocturn.vsbnet.be/">ï»¿Guy Van Sanden</a>, who helped me figure out this command.</p>
<ul>
<li> And did you ever need to perform the same task on several different machines?</li>
</ul>
<p>The possibilities of this command are vast and this is only one of the many that come to mind. The first and most obvious is when you need to close a screen session with too much windows to close by hand. Stuffing an &#8220;exit^M&#8221; into the open windows until the screen sessions are alle effectively closed is quite usefull!<br />
The real luxury however is when you need to install the same software on several different machines. You start by opening ssh connections to the boxes you want to administer. You might consider using the .screenrc to open the connections and ssh keys to facilitate the loging in. Once logged in, you can send the appropriate commands (for example &#8220;sudo yum install htop&#8221;) to the different screen sessions, effectively managing all those machines at the same time. This is ofcourse something to use with extreme caution &#8211; imagine deleting the wrong directory on one of those boxes &#8211; but a conscient administrator should be able to use this to his advantage!</p>
<p><strong>The articles in this series focus on the following topics..</strong></p>
<ul>
<li> The Simple stuff
<ul>
<li><a href="http://blog.cone.be/2009/11/10/gnu-screen-an-invaluable-tool-2/">Slightly more advanced stuff</a></li>
</ul>
</li>
<li> The fun stuff
<ul>
<li><a href="http://blog.cone.be/2009/11/17/gnu-screen-command-parameter-multi-display-mode-copy-mode/">Command Parameter, Multi display mode, Copy Mode</a></li>
<li><em><a href="http://blog.cone.be/2009/11/24/gnu-screen-nethack-different-screen-windows-sending-commands-to-all-screen-windows/">Nethack, Different screen windows, Sending commands to all screen windows</a></em></li>
<li><a href="http://blog.cone.be/2009/12/01/gnu-screen-different-regions-logging-screen-window-types/">Different regions, Logging, Screen Window Types</a></li>
<li> the .screenrc</li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.cone.be/2009/11/24/gnu-screen-nethack-different-screen-windows-sending-commands-to-all-screen-windows/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Having seen the ChromeOS presentation.</title>
		<link>http://blog.cone.be/2009/11/20/having-seen-the-chrome-presentation/</link>
		<comments>http://blog.cone.be/2009/11/20/having-seen-the-chrome-presentation/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 23:22:24 +0000</pubDate>
		<dc:creator>Gert</dc:creator>
				<category><![CDATA[Interwebs]]></category>
		<category><![CDATA[Planet]]></category>

		<guid isPermaLink="false">http://blog.cone.be/?p=3675</guid>
		<description><![CDATA[Excited as a little kid on XMass, I went scouting the interwebs for the chrome presentation vid. Apparently its being streamed on some obscure site that offers .wmv and the other crappy format. I am speechless at the fact that I need to watch the new google os being announced on some stream that cant [...]]]></description>
			<content:encoded><![CDATA[<p>Excited as a little kid on XMass, I went scouting the interwebs for the chrome presentation vid. Apparently its being streamed on some obscure site that offers .wmv and the other crappy format. I am speechless at the fact that I need to watch the new google os being announced on some stream that cant even handle the load its getting tonight. That for an OS by the company that owns Youtube??? I am amazed and appalled. Luckilly totem to the rescue and I can at least surpass the annoying resizing browser popup crap.</p>
<p>I have to admit, I had very low expectations for the chrome. But thats good. Amaze me, oh lil peoples in the crappy wmv stream.</p>
<p>Sadly, I am not impressed after the almost 80 minutes of Chrome info. There will be a lot of opinions, stirring over the web like a drunken man&#8217;s puke disturbing a peaceful puddle after a night of cheap booze. And needless to say this wont be my last chrome post either. Not today though, I need to take in the data and sleep on it. I doubt that I will wake up Impressed tomorrow.</p>
<p>One point that really struck me in the whole presentation and that set a certain tone to the whole project, is the fact that &#8220;[Chrome] will only be available on hardware that meets Google&#8217;s specifications.&#8221; (Hastilly mumbled, but afterwards confirmed by the interwebs) Thats what Apple does. Yes, the os will be open and I heard somewhere that its a stripped down linux kernel.. but still. People will not be able to download the compiled OS on a convienient install disk. They will have to get the specific hardware with the preinstalled chrome. And offcourse there will be a Cyanogen (Kudos to Cyanogen and all the other peeps for their massive Android efforts) type of guy who ll roll the chromeOS into a neat little ubuntu based ball as to offer it to everyone, but I was hoping that google would do that for us. As finally I hoped they would do for Android too. But they re not, they re going the other direction and taking the OS down that irksome road. I have a slight twinge of Angst rising to my throat. Like bile.</p>
<p>But as I said, I need to take the data in before I&#8217;ll be able to write anything meaningful. But I see a rather negative piece coming up about how the Google approaching their new software projects.</p>
<p>They re off to a bad start with ChromeOS as far as Im concerned. They left me unimpressed after the presentation and disappointed me with their hardware notice.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cone.be/2009/11/20/having-seen-the-chrome-presentation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Gnu Screen ; Command Parameter, Multi display mode &amp; Copy Mode</title>
		<link>http://blog.cone.be/2009/11/17/gnu-screen-command-parameter-multi-display-mode-copy-mode/</link>
		<comments>http://blog.cone.be/2009/11/17/gnu-screen-command-parameter-multi-display-mode-copy-mode/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 19:00:56 +0000</pubDate>
		<dc:creator>Gert</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Future]]></category>

		<guid isPermaLink="false">http://blog.cone.be/?p=3640</guid>
		<description><![CDATA[I wrote this Gnu Screen guide in December &#8216;08 with the previous incarnation of linux.com in mind. January 2009 however, linux.com started on its new and exciting path as a community site and the article just sat on my machine, waiting. So I decided to publish it on my blog in a four part series [...]]]></description>
			<content:encoded><![CDATA[<p><em>I wrote this Gnu Screen guide in December &#8216;08 with the previous incarnation of <a href="http://www.linux.com/">linux.com</a> in mind. January 2009 however, linux.com started on its new and exciting path as a community site and the article just sat on my machine, waiting. So I decided to publish it on my blog in a four part series over the following month. Maybe someone can use it <img src='http://blog.cone.be/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </em></p>
<p>Have you ever had to run a time consuming process (say mkfs or compiling something) over a shoddy ssh connection? Or cleanly run several commands in parallel without having several open connections to that server? Or maybe you were programming and wanted a mysql prompt, a bash prompt and several text editors open? How about that ssh tunnel you need open and dont want to close by accident? And did you ever need to perform the same task on several different machines? Or connect to a serial terminal? Or maybe you just want a log file of what you re doing..<br />
These are day to day situations any linux user will run into, that can be quite frustrating. That is, before you discover <a href="http://www.gnu.org/software/screen/">Gnu screen</a>!</p>
<p>&#8220;Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells.&#8221; Or at least, thats what the site calls it. Sounds easy enough, but there are an amazing amount of different uses for this incredible piece of software. The above list is some of the uses I could readily think about &#8211; some of the ways I regularly use screen, but like any decent linux tool &#8211; the sky really is the limit! I&#8217;ll be looking into different issues, so lets jump into some of the practical solutions for those problems.</p>
<p><strong>The fun stuff &#8211; Command Parameter</strong><br />
So far for the basics. We ve covered the strenght of being able to attach &amp; detach a session, but screen has a wad of other options that prove fun toys.</p>
<p>Screen allows you to provide a command as a parameter.</p>
<pre>screen &lt;Screen Parameters&gt; &lt;command&gt; &lt;Command Parameters&gt;</pre>
<p>Screen executes the command given in the parameter. The parameters before the command are parsed by screen, the parameters after the command are passed on to the command. Without additional parameters, screen will open a session, execute the command and close afterwards. Screen cleans up after closing so any output to the terminal is erased afterwards.</p>
<pre>$ screen ls

[screen is terminating]</pre>
<p>While this might not seem too spectacular, this really opens a world of possibilities.<br />
The first benefit is obviously when starting a remote command you don&#8217;t want interrupted by a failing connection. You could right as easily start a screen session and type the commands there, but in the end, you &#8216;ll notice that typing &#8220;screen&#8221; before the command is a tad quicker than doing it in the two passes. This is of course only the case if the command you need to run does not finish with any meaningfull output you need to study.. although if it does, you can always pipe it into a file. I frequently use this for moving files or even running a vi or emacs session</p>
<pre>screen mv foo bar</pre>
<p>The other and most important benefit is scripting. The option to run commands in a screen session out of a script allows for a broad spectrum of different possibilities. My favorite example is a screen &#8211; ssh wedding..</p>
<ul>
<li>How about that ssh tunnel you need open and dont want to close by accident?</li>
</ul>
<p>One of my daily screen applications is an icon I have on my desktop. It opens an ssh tunnel to a designated server, authentication over ssh is handled by a public key and the screen options are as such that the session is either created or reattached. All my outgoing mail trafic is tunneled trough ssh to make sure that I dont have to change servers depending on what location I am working at.</p>
<pre>#!/bin/bash

if [[ $( screen -ls | grep -c tunnel.Gen ) == 1 ]]

then

   gnome-terminal -e "screen -r tunnel.Gen" --hide-menubar -t "Gen"

else

  screen -d -m -S tunnel.Gen ssh user@host -L 25025:smtp.server.com:25

  gnome-terminal -e "screen -r tunnel.Gen" --hide-menubar -t "Gen"

fi</pre>
<p>The workings of the script should be quite obvious, so I&#8217;ll skip that part and shed some light on the screen parameters. The &#8220;screen -r ..&#8221; part should be clear by now, this reattaches the screen session. The &#8220;-d -m&#8221; option tells screen to create a new session that is not attached to the terminal. And the &#8220;-S&#8221; option names the session, as we discussed before.<br />
Thus effectively creating a tunnel window that can be automatically closed &amp; opened at will, without losing the tunnel; and can effectively be terminated by exiting the ssh connection.</p>
<p><strong>The Fun Stuff &#8211; Multi display mode</strong><br />
When we were talking about reattaching an attached session, we talked about another option instead of detaching the session.<br />
Screen allows multi display mode. Before we get all excited, I want to point out a small detail in the setup. The users need to have access to the screen session. As we discussed before, this means they somehow both need the same user rights. This can be achieved by both logging in as the same user or by sudo or the likes. Two users on the same account does admittedly sound messy on a sysadmin level, but this might actually be worth while.</p>
<p>Multi Display Mode allows different users to connect to the same screen session together. This provides a powerfull tool for teaching someone terminal related knowledge in a shared environment or even have an attempt at solving an advanced problem together. To start such a session, both users should be able to access the same session (user). One of them starts the session as usual &#8211; preferably with an easy name.</p>
<pre>screen -S Shared</pre>
<p>And then have the other person connect to the session using the &#8220;-x&#8221; parameter.</p>
<pre>screen -x Shared</pre>
<p>&amp; that will give you a nice shared session where you can have some fun together.</p>
<p>This is a trick that thoroughly helped me when simultaneously installing several servers with a colleague some years ago. This way we could continue each others work when necessary and avoided conflicting operations on the same machine.</p>
<p>This technique has been featured on Linux.com before though. <a href="http://www.linux.com/feature/56443">Using screen for remote interaction</a> by Philip J. Hollenback. The article goes in much more detail, although I have to admit the setuid aspect Really sets me off. The security consequences are just too big. But no comment on screen on that part. There is simply no way to do what needs to be done without the setuid flag. The other option would be to have the sessions available to all users and that would be an actual flaw, while the setuid flag is a potential flaw.</p>
<p>In the end, we can only conclude that this is a powerful option with lots of potential; but only under the right special circumstances.</p>
<p><strong>The Fun Stuff &#8211; Copy Mode</strong><br />
After using screen for a while, one thing that will probably bother you is that the classic shift &#8211; pgup / pgdown doesnt work. Being unable to scroll back to earlier output or check command output beyond one page soon turns out to be quite the nuicance. To solve this, copy/scrollback mode &#8211; or vi command mode &#8211; can be used.</p>
<pre>C-a esc     (copy)        Enter copy/scrollback mode.</pre>
<p>This opens the buffer in a vi like mode where you can scroll back and forth in the buffer and use a whole set of different commands. Commands for scrolling around in the buffer, several ways of searching the text, several commands for selecting text in different patterns and yanking it for using elsewhere.<br />
To make full use of the numerous keys in this mode, you should look up the &#8220;copy&#8221; chapter in the screen man page.</p>
<p><strong>The articles in this series focus on the following topics..</strong></p>
<ul>
<li> The Simple stuff
<ul>
<li><a href="http://blog.cone.be/2009/11/10/gnu-screen-an-invaluable-tool-2/">Slightly more advanced stuff</a></li>
</ul>
</li>
<li> The fun stuff
<ul>
<li><em><a href="http://blog.cone.be/2009/11/17/gnu-screen-command-parameter-multi-display-mode-copy-mode/">Command Parameter, Multi display mode, Copy Mode</a></em></li>
<li><a href="http://blog.cone.be/2009/11/24/gnu-screen-nethack-different-screen-windows-sending-commands-to-all-screen-windows/">Nethack, Different screen windows, Sending commands to all screen windows</a></li>
<li><a href="http://blog.cone.be/2009/12/01/gnu-screen-different-regions-logging-screen-window-types/">Different regions, Logging, Screen Window Types</a></li>
<li> the .screenrc</li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.cone.be/2009/11/17/gnu-screen-command-parameter-multi-display-mode-copy-mode/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Picture Of The Day</title>
		<link>http://blog.cone.be/2009/11/16/picture-of-the-day/</link>
		<comments>http://blog.cone.be/2009/11/16/picture-of-the-day/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 12:18:51 +0000</pubDate>
		<dc:creator>Gert</dc:creator>
				<category><![CDATA[Interwebs]]></category>
		<category><![CDATA[Open Future]]></category>

		<guid isPermaLink="false">http://blog.cone.be/?p=3663</guid>
		<description><![CDATA[We re trying a Picture of the Day effort with some of the Open-Future peeps..
Post one picture each day. Of Anything.
* Take a picture using your phone. (No recycling, a fresh picture each day!)
* Post it to twitter/Identica
* Mention the #PictureOfTheDay tag in the message.
Picture of the Day  
Feel free to join in!
]]></description>
			<content:encoded><![CDATA[<p>We re trying a Picture of the Day effort with some of the Open-Future peeps..</p>
<blockquote><p>Post one picture each day. Of Anything.</p>
<p>* Take a picture using your phone. (No recycling, a fresh picture each day!)<br />
* Post it to twitter/Identica<br />
* Mention the #PictureOfTheDay tag in the message.</p>
<p>Picture of the Day <img src='http://blog.cone.be/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p></blockquote>
<p>Feel free to join in!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cone.be/2009/11/16/picture-of-the-day/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
