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

<channel>
	<title>Sverre's weblog</title>
	<atom:link href="http://skeldoy.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://skeldoy.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Wed, 20 Jul 2011 17:31:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='skeldoy.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Sverre's weblog</title>
		<link>http://skeldoy.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://skeldoy.wordpress.com/osd.xml" title="Sverre&#039;s weblog" />
	<atom:link rel='hub' href='http://skeldoy.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Using an iPhone and a Mac Mini as a baby monitor</title>
		<link>http://skeldoy.wordpress.com/2011/07/20/using-an-iphone-and-a-mac-mini-as-a-baby-monitor/</link>
		<comments>http://skeldoy.wordpress.com/2011/07/20/using-an-iphone-and-a-mac-mini-as-a-baby-monitor/#comments</comments>
		<pubDate>Wed, 20 Jul 2011 17:31:36 +0000</pubDate>
		<dc:creator>skeldoy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[baby]]></category>
		<category><![CDATA[babycall]]></category>
		<category><![CDATA[babymonitor]]></category>
		<category><![CDATA[facetime]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[mac mini]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[skype]]></category>

		<guid isPermaLink="false">http://skeldoy.wordpress.com/?p=70</guid>
		<description><![CDATA[Having recently misplaced the proper baby call, we needed a new way of checking if the baby is really sleeping. At first we used an iPhone app called BabyMonitor &#8211; and ran it on an iPad1 while listening on one of our iPhones. The system is very reliant on Wifi and can be quite unstable. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=skeldoy.wordpress.com&amp;blog=5978470&amp;post=70&amp;subd=skeldoy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Having recently misplaced the proper baby call, we needed a new way of checking if the baby is really sleeping. At first we used an iPhone app called BabyMonitor &#8211; and ran it on an iPad1 while listening on one of our iPhones. The system is very reliant on Wifi and can be quite unstable. And event on your phone will trigger a drop in the application and you then need to pair them up again before it works properly.</p>
<p>The solution was not elegant enough. I then started experimenting with different setups. On the Mac Mini I hooked up an external web cam and made the audio input come from the web cam &#8211; on a usb-extention cord to the baby&#8217;s room. I then tried 3 things. First I did a Quicktime Stream server and used the QuickTime Broadcaster application on the Mac Mini to create a stream. This approach &#8211; though it would scale well didn&#8217;t really match up well on the iPhone or the iPad as a client &#8211; without writing a html-page and embedding the stream in that page. Scrapped that plan. Then I went for FaceTime. Using FaceTime I had video and sound directly between either an iPad or the iPhones. Excellent. One drawback was that the video-part of it made the iPhone very hot &#8211; and it drained battery very fast. An added problem was the same as on the BabyMonitor-app &#8211; it needs wifi to work &#8211; any drop in connectivity means that you need to place a new call and answer that call in the other end. Scrap that. </p>
<p>The last and final solution &#8211; so far &#8211; is to run Skype on the Mac Mini &#8211; create a special account that auto answers people you have in your contact list. You then use the Skype-app on the iPhone to call in to the baby-monitor-account. This was you instantly get audio when dialing in &#8211; you can even go video &#8211; but that is not needed. The system works quite well &#8211; it&#8217;s even available on the 3G network &#8211; so the wifi-connectivity-issues aren&#8217;t important. Having an unlimited data-plan &#8211; I have no scruples doing it entirely over 3G on the iPhone-side &#8211; and the quality of the audio is not bad at all. </p>
<p>So if you already own a machine &#8211; any kind &#8211; be it linux, pc, mac or whatever &#8211; and already own an external webcam &#8211; already own the usb-extention cable and a smartphone or tablet capable of running skype &#8211; this solution is free. Skype doesn&#8217;t cost a dime &#8211; and the only thing you need to worry about is paying for the data &#8211; unless you go unlimited. You can even do an iPad-&gt;iPhone, iPad-&gt;iPad, iPhone-&gt;iPhone, Android-&gt;iPhone,Galaxy-&gt;iPad. The sky is the limit in terms of platforms &#8211; but a real cheap old linux-box would suffice.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/skeldoy.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/skeldoy.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/skeldoy.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/skeldoy.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/skeldoy.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/skeldoy.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/skeldoy.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/skeldoy.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/skeldoy.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/skeldoy.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/skeldoy.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/skeldoy.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/skeldoy.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/skeldoy.wordpress.com/70/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=skeldoy.wordpress.com&amp;blog=5978470&amp;post=70&amp;subd=skeldoy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://skeldoy.wordpress.com/2011/07/20/using-an-iphone-and-a-mac-mini-as-a-baby-monitor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b13d74cb638dfc631aafe20956d05f05?s=96&#38;d=wavatar&#38;r=R" medium="image">
			<media:title type="html">skeldoy</media:title>
		</media:content>
	</item>
		<item>
		<title>Different uses &#8211; different platforms</title>
		<link>http://skeldoy.wordpress.com/2011/03/22/different-uses-different-platforms/</link>
		<comments>http://skeldoy.wordpress.com/2011/03/22/different-uses-different-platforms/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 00:11:06 +0000</pubDate>
		<dc:creator>skeldoy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[oss]]></category>
		<category><![CDATA[platform]]></category>
		<category><![CDATA[prediction]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://skeldoy.wordpress.com/?p=68</guid>
		<description><![CDATA[Lately I&#8217;ve started to notice how far behind Microsoft is getting in terms of usability, performance, stability and ingenuity. It is time it died in the personal computing business and in corporate IT. With the advent of the iPhone, iPad, Android it is clear that Microsoft will have no place in most regular peoples lives [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=skeldoy.wordpress.com&amp;blog=5978470&amp;post=68&amp;subd=skeldoy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Lately I&#8217;ve started to notice how far behind Microsoft is getting in terms of usability, performance, stability and ingenuity. It is time it died in the personal computing business and in corporate IT. With the advent of the iPhone, iPad, Android it is clear that Microsoft will have no place in most regular peoples lives in the decades to come. Most people now jump ship and go straight for the Mac for a hassle free day-to-day computing experience. But in corporate IT the Mac isn&#8217;t really the tool for the job. Even though I love the Macs at home &#8211; it&#8217;s clear to me &#8211; given my job in corporate IT that the person-centric Mac-culture is far from ideal in the fascistic corporate environment. This is where Linux comes in. Far from being the easiest platform for the end user &#8211; Linux is still the most customizable platform on the planet. It has all of the features that modern Microsoft-products are missing at the moment. It&#8217;s easy to use, fast, stable and is the most advanced kernel on the planet. The OSS culture is also the most resilient and shows that it is ahead of it&#8217;s time in ingenuity, security and usability given the recent advent of the Mac-AppStore on the Mac-platform. It&#8217;s time for Microsoft to die and the market to split into two segments: Private &#8211; using Apple-products and slowly shifting to Android. Corporate &#8211; using Linux/OSS right from the get-go: Harvesting productivity gains, security increases and stability benefits that will take us right back to the time of the UNIX.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/skeldoy.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/skeldoy.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/skeldoy.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/skeldoy.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/skeldoy.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/skeldoy.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/skeldoy.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/skeldoy.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/skeldoy.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/skeldoy.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/skeldoy.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/skeldoy.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/skeldoy.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/skeldoy.wordpress.com/68/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=skeldoy.wordpress.com&amp;blog=5978470&amp;post=68&amp;subd=skeldoy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://skeldoy.wordpress.com/2011/03/22/different-uses-different-platforms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b13d74cb638dfc631aafe20956d05f05?s=96&#38;d=wavatar&#38;r=R" medium="image">
			<media:title type="html">skeldoy</media:title>
		</media:content>
	</item>
		<item>
		<title>Benchmarking simple stuff in different languages</title>
		<link>http://skeldoy.wordpress.com/2010/07/29/benchmarking-simple-stuff-in-different-languages/</link>
		<comments>http://skeldoy.wordpress.com/2010/07/29/benchmarking-simple-stuff-in-different-languages/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 14:06:17 +0000</pubDate>
		<dc:creator>skeldoy</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://skeldoy.wordpress.com/?p=66</guid>
		<description><![CDATA[I wanted to find out just how big the differences in speed was between popular languages. To benchmark the languages I choose a very simple but common operation to be performed in similar conditions with different languages. The results came as quite a surprise. Method To do this benchmark I made simple Hello World programs [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=skeldoy.wordpress.com&amp;blog=5978470&amp;post=66&amp;subd=skeldoy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I wanted to find out just how big the differences in speed was between popular languages. To benchmark the languages I choose a very simple but common operation to be performed in similar conditions with different languages. The results came as quite a surprise.</p>
<p>Method</p>
<p>To do this benchmark I made simple Hello World programs in the different languages (some compiled, some interpreted). I then wrote a simple wrapper in Perl that ran the programs in a for-loop, simulating running the program 1000 times. This method may be a testament to how well my ubuntu fires different executables and frameworks and not to the code, but it is still interesting to see how a real world application of a program language is to do a menial task like printing a string many times. To eliminate the graphics-card I piped the output of the programs to a file in one instance and did nothing with it in another instance (just back-ticking the output to a perl-variable and then doing nothing to it). Before claiming that the methodology is unfair I would like to point out that this is the way I run programs on linux/unix and that for my particular use this is  a valid benchmark.</p>
<table border="0" cellspacing="0" rules="NONE">
<col width="86"></col>
<col width="86"></col>
<tbody>
<tr>
<td width="86" height="17" align="LEFT">Language</td>
<td width="86" align="LEFT">Seconds</td>
</tr>
<tr>
<td height="17" align="LEFT">Asm (nasm)</td>
<td align="RIGHT">0.46</td>
</tr>
<tr>
<td height="17" align="LEFT">C (llvm)</td>
<td align="RIGHT">0.84</td>
</tr>
<tr>
<td height="17" align="LEFT">Obj-C (llvm)</td>
<td align="RIGHT">0.85</td>
</tr>
<tr>
<td height="17" align="LEFT">C (gcc)</td>
<td align="RIGHT">0.87</td>
</tr>
<tr>
<td height="17" align="LEFT">Sh</td>
<td align="RIGHT">1.11</td>
</tr>
<tr>
<td height="17" align="LEFT">C++ (llvm)</td>
<td align="RIGHT">1.22</td>
</tr>
<tr>
<td height="17" align="LEFT">Pascal (fp)</td>
<td align="RIGHT">1.48</td>
</tr>
<tr>
<td height="17" align="LEFT">Awk</td>
<td align="RIGHT">1.83</td>
</tr>
<tr>
<td height="17" align="LEFT">C++ (gcc)</td>
<td align="RIGHT">1.86</td>
</tr>
<tr>
<td height="17" align="LEFT">Fortran (G95)</td>
<td align="RIGHT">2.15</td>
</tr>
<tr>
<td height="17" align="LEFT">Brainfuck</td>
<td align="RIGHT">2.24</td>
</tr>
<tr>
<td height="17" align="LEFT">Perl</td>
<td align="RIGHT">3.01</td>
</tr>
<tr>
<td height="17" align="LEFT">Bash</td>
<td align="RIGHT">3.13</td>
</tr>
<tr>
<td height="17" align="LEFT">Cobol (open)</td>
<td align="RIGHT">3.35</td>
</tr>
<tr>
<td height="17" align="LEFT">Obfuscated Perl</td>
<td align="RIGHT">3.68</td>
</tr>
<tr>
<td height="17" align="LEFT">Ruby</td>
<td align="RIGHT">5.35</td>
</tr>
<tr>
<td height="17" align="LEFT">Tcl</td>
<td align="RIGHT">5.53</td>
</tr>
<tr>
<td height="17" align="LEFT">Python</td>
<td align="RIGHT">16.33</td>
</tr>
<tr>
<td height="17" align="LEFT">Php</td>
<td align="RIGHT">103.97</td>
</tr>
<tr>
<td height="17" align="LEFT">Java</td>
<td align="RIGHT">121.88</td>
</tr>
<tr>
<td height="17" align="LEFT">Groovy</td>
<td align="RIGHT">1318</td>
</tr>
</tbody>
</table>
<p>Doing another benchmark where I basically let the hello world program contain a 1000000 long for-loop written in the program itself and then running this program 10 times I got different results:</p>
<p>GCC:    timethis 10:  1 wallclock secs ( 0.00 usr  0.00 sys +  0.69 cusr  0.39 csys =  1.08 CPU) @  9.26/s (n=10)<br />
LLVM:    timethis 10:  1 wallclock secs ( 0.00 usr  0.00 sys +  0.68  cusr  0.42 csys =  1.10 CPU) @  9.09/s (n=10)<br />
Perl:    timethis 10:  2 wallclock secs ( 0.00 usr  0.00 sys +  1.73  cusr  0.44 csys =  2.17 CPU) @  4.61/s (n=10)<br />
Python:    timethis 10:  8 wallclock secs ( 0.00 usr  0.00 sys +  6.41  cusr  0.68 csys =  7.09 CPU) @  1.41/s (n=10)<br />
Php:    timethis 10: 40 wallclock secs ( 0.00 usr  0.00 sys +  7.20 cusr  28.15 csys = 35.35 CPU) @  0.28/s (n=10)<br />
Java:    timethis 10: 111 wallclock secs ( 0.00 usr  0.01 sys + 36.21  cusr 61.36 csys = 97.58 CPU) @  0.10/s (n=10)<br />
Bash:    timethis 10: 321 wallclock secs ( 0.00 usr  0.01 sys + 248.54 cusr 49.48 csys = 298.03 CPU) @  0.03/s (n=10)</p>
<p>This speaks to the sluggishness of the different interpreters and virtual machines and/or the size of the executable. But it also underlines the importance of choosing which programming language you use wisely depending on the case you want to solve. Sure this is a moot point in most cases, but imaging taking development time into account. Writing something in PHP can be OK to solve a problem quickly, but seeing that writing the same code in Perl can be as easy or even easier and seeing the performance boost that script would have makes you wonder why PHP is even out there.</p>
<p>The most surprising result is the Bash. Running a simple bash-script 1000 times from the console is pretty snappy in terms of other scripting languages, but having bash loop a million times and running that is slower than even Java. That is a real surprise. The relative slowness of Python is also interesting, given that Python&#8217;s popularity is growing where Perl looses supporters. But equally as surprising is the speed at which Perl does this simple operation. Writing stuff in Perl is relatively straight forward (compared to C) but that does not seem to be a problem when doing menial tasks like this.</p>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;overflow:hidden;"><!--   		BODY,DIV,TABLE,THEAD,TBODY,TFOOT,TR,TH,TD,P { font-family:"Arial"; font-size:x-small } --></p>
<table border="0" cellspacing="0" rules="NONE">
<col width="86"></col>
<col width="86"></col>
<tbody>
<tr>
<td width="86" height="17" align="LEFT">Language</td>
<td width="86" align="LEFT">Seconds</td>
</tr>
<tr>
<td height="17" align="LEFT">Asm (nasm)</td>
<td align="RIGHT">0.46</td>
</tr>
<tr>
<td height="17" align="LEFT">C (llvm)</td>
<td align="RIGHT">0.84</td>
</tr>
<tr>
<td height="17" align="LEFT">Obj-C (llvm)</td>
<td align="RIGHT">0.85</td>
</tr>
<tr>
<td height="17" align="LEFT">C (gcc)</td>
<td align="RIGHT">0.87</td>
</tr>
<tr>
<td height="17" align="LEFT">Sh</td>
<td align="RIGHT">1.11</td>
</tr>
<tr>
<td height="17" align="LEFT">C++ (llvm)</td>
<td align="RIGHT">1.22</td>
</tr>
<tr>
<td height="17" align="LEFT">Pascal (fp)</td>
<td align="RIGHT">1.48</td>
</tr>
<tr>
<td height="17" align="LEFT">Awk</td>
<td align="RIGHT">1.83</td>
</tr>
<tr>
<td height="17" align="LEFT">C++ (gcc)</td>
<td align="RIGHT">1.86</td>
</tr>
<tr>
<td height="17" align="LEFT">Fortran (G95)</td>
<td align="RIGHT">2.15</td>
</tr>
<tr>
<td height="17" align="LEFT">Brainfuck</td>
<td align="RIGHT">2.24</td>
</tr>
<tr>
<td height="17" align="LEFT">Perl</td>
<td align="RIGHT">3.01</td>
</tr>
<tr>
<td height="17" align="LEFT">Bash</td>
<td align="RIGHT">3.13</td>
</tr>
<tr>
<td height="17" align="LEFT">Cobol (open)</td>
<td align="RIGHT">3.35</td>
</tr>
<tr>
<td height="17" align="LEFT">Obfuscated Perl</td>
<td align="RIGHT">3.68</td>
</tr>
<tr>
<td height="17" align="LEFT">Ruby</td>
<td align="RIGHT">5.35</td>
</tr>
<tr>
<td height="17" align="LEFT">Tcl</td>
<td align="RIGHT">5.53</td>
</tr>
<tr>
<td height="17" align="LEFT">Python</td>
<td align="RIGHT">16.33</td>
</tr>
<tr>
<td height="17" align="LEFT">Php</td>
<td align="RIGHT">103.97</td>
</tr>
<tr>
<td height="17" align="LEFT">Java</td>
<td align="RIGHT">121.88</td>
</tr>
<tr>
<td height="17" align="LEFT">Groovy</td>
<td align="RIGHT">1318</td>
</tr>
</tbody>
</table>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/skeldoy.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/skeldoy.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/skeldoy.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/skeldoy.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/skeldoy.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/skeldoy.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/skeldoy.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/skeldoy.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/skeldoy.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/skeldoy.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/skeldoy.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/skeldoy.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/skeldoy.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/skeldoy.wordpress.com/66/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=skeldoy.wordpress.com&amp;blog=5978470&amp;post=66&amp;subd=skeldoy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://skeldoy.wordpress.com/2010/07/29/benchmarking-simple-stuff-in-different-languages/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b13d74cb638dfc631aafe20956d05f05?s=96&#38;d=wavatar&#38;r=R" medium="image">
			<media:title type="html">skeldoy</media:title>
		</media:content>
	</item>
		<item>
		<title>Converting images between formats</title>
		<link>http://skeldoy.wordpress.com/2010/07/20/converting-images-between-formats/</link>
		<comments>http://skeldoy.wordpress.com/2010/07/20/converting-images-between-formats/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 11:59:08 +0000</pubDate>
		<dc:creator>skeldoy</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[macosx]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://skeldoy.wordpress.com/?p=63</guid>
		<description><![CDATA[I wanted to convert a bitmap (.bmp) image to an ascii art here the other day. I did ls /usr/bin/*toascii and found a program to convert from pbm to ascii (pbmtoascii) from the netpbm package. That was swell. So I did another ls /usr/bin/*topbm to find a way of doing a .pbm image. I got [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=skeldoy.wordpress.com&amp;blog=5978470&amp;post=63&amp;subd=skeldoy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I wanted to convert a bitmap (.bmp) image to an ascii art here the other day.</p>
<p>I did ls /usr/bin/*toascii and found a program to convert from pbm to ascii (pbmtoascii) from the netpbm package. That was swell. So I did another ls /usr/bin/*topbm to find a way of doing a .pbm image. I got a list of programs but alas no bmptopbm.</p>
<p>So after contemplating usage of the many online ascii art generators I decided to do the least cost effective thing and write a program to determine possible conversion paths from one format to another using the netpbm and other packages out there.</p>
<p>I tried writing a recursive function that looked for converters until all of them would be found, but due to the nature of the netpbm-package some image-formats are only convertible to one other format and some are convertible to multiple formats. That meant that I have a lot pitfalls in terms of writing a good recursive function to find all of them. Multiple loops to get stuck in. So I gave the job to my CPU and decided to not spend my time scratching my head for a recursive routine. In stead I would map out all the converters in a couple of layers in both directions and use Dijkstra or some other graph-traversing algorithm to find the way to go.</p>
<p><em>#!/usr/bin/perl<br />
use Graph;<br />
my $g = Graph-&gt;new;<br />
$input = $ARGV[0];<br />
$output = $ARGV[1];<br />
$g-&gt;add_vertex($input);<br />
$g-&gt;add_vertex($output);<br />
my @toOutput = &amp;findTo($output);<br />
foreach my $format ( @toOutput) {<br />
$g-&gt;add_vertex($format);<br />
$g-&gt;add_path($format,$output);<br />
my @levelTwo = &amp;findTo($format);<br />
foreach my $forma (@levelTwo) {<br />
$g-&gt;add_vertex($forma);<br />
$g-&gt;add_path($forma,$format);<br />
</em></p>
<p>and so on and so forth. And thus be able to do:</p>
<p><em>print &#8220;Graph: $g \n&#8221;;<br />
@path = $g-&gt;SP_Dijkstra($input,$output); if (!@path) { print &#8220;No path\n&#8221;; }<br />
else { print &#8220;Dijkstra-Path: @path \n&#8221;; }</em></p>
<p>And that would yield, when running for instance find bmp ascii:</p>
<p><em>Dijkstra-Path: bmp ppm pgm pbm ascii<br />
</em></p>
<p>And thus I found a way of converting a .bmp to a .ppm and convert the .ppm to a .pgm to be converted to a .pbm and lastly from .pbm to .ascii. Adding a couple of lines to map the graph point that is the mighty ImageMagick convert tool I can then convert from jpeg to ascii doing the extra step from jpeg to bmp.</p>
<p>So if anybody wonders &#8230; for instance how to convert a .st4-file to .tiff here&#8217;s the solution:<br />
st4 to pgm, pgm to pbm, pbm to gem, gem to pnm, pnm to tiff&#8230;</p>
<p>Or maybe you are wondering how to convert a PostScript file to ascii in a completely useless way? :<br />
ps to pnm, pnm to jpeg, jpeg to bmp, bmp to ppm, ppm to pgm, pgm to pbm, pbm to ascii</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/skeldoy.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/skeldoy.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/skeldoy.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/skeldoy.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/skeldoy.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/skeldoy.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/skeldoy.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/skeldoy.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/skeldoy.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/skeldoy.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/skeldoy.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/skeldoy.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/skeldoy.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/skeldoy.wordpress.com/63/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=skeldoy.wordpress.com&amp;blog=5978470&amp;post=63&amp;subd=skeldoy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://skeldoy.wordpress.com/2010/07/20/converting-images-between-formats/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b13d74cb638dfc631aafe20956d05f05?s=96&#38;d=wavatar&#38;r=R" medium="image">
			<media:title type="html">skeldoy</media:title>
		</media:content>
	</item>
		<item>
		<title>Simple networking with Java</title>
		<link>http://skeldoy.wordpress.com/2009/04/20/simple-networking-with-java/</link>
		<comments>http://skeldoy.wordpress.com/2009/04/20/simple-networking-with-java/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 06:43:43 +0000</pubDate>
		<dc:creator>skeldoy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[port]]></category>

		<guid isPermaLink="false">http://skeldoy.wordpress.com/?p=60</guid>
		<description><![CDATA[Here is a simple way of finding out if a port on a host is open. Nice code to have laying around if you work in an environment with lots of different types of systems. import java.net.*;import java.io.*;import java.util.*; public class whatEver { static void singleSocketOpen (String hostname, int socket) { try { Socket s = [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=skeldoy.wordpress.com&amp;blog=5978470&amp;post=60&amp;subd=skeldoy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is a simple way of finding out if a port on a host is open. Nice code to have laying around if you work in an environment with lots of different types of systems.</p>
<p><em>import java.net.*;import java.io.*;import java.util.*;</em></p>
<p><em>public class whatEver {</em></p>
<p><em>static void singleSocketOpen (String hostname, int socket) {</em></p>
<p><span><em> </em></span><em>try { Socket s = new Socket(hostname, socket); s.close();</em></p>
<p><span><em> </em></span><em>System.out.println(&#8220;Port &#8220;+socket+&#8221;, &#8220;+ portInfo(socket) +&#8221; on &#8220;+hostname + &#8221; is open.&#8221;); }</em></p>
<p><span><em> </em></span><em>catch (UnknownHostException e) {System.out.println(&#8220;no such host&#8221;);}</em></p>
<p><span><em> </em></span><em>catch (IOException ioe) {System.out.println(&#8220;port closed.&#8221;);}</em></p>
<p><span><em> </em></span><em>} }</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/skeldoy.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/skeldoy.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/skeldoy.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/skeldoy.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/skeldoy.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/skeldoy.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/skeldoy.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/skeldoy.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/skeldoy.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/skeldoy.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/skeldoy.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/skeldoy.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/skeldoy.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/skeldoy.wordpress.com/60/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=skeldoy.wordpress.com&amp;blog=5978470&amp;post=60&amp;subd=skeldoy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://skeldoy.wordpress.com/2009/04/20/simple-networking-with-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b13d74cb638dfc631aafe20956d05f05?s=96&#38;d=wavatar&#38;r=R" medium="image">
			<media:title type="html">skeldoy</media:title>
		</media:content>
	</item>
		<item>
		<title>iPhone development &#8211; a summer breeze on a hot platform</title>
		<link>http://skeldoy.wordpress.com/2009/01/28/iphone-development-a-summer-breeze-on-a-hot-platform/</link>
		<comments>http://skeldoy.wordpress.com/2009/01/28/iphone-development-a-summer-breeze-on-a-hot-platform/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 22:28:32 +0000</pubDate>
		<dc:creator>skeldoy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[App Store]]></category>
		<category><![CDATA[applications]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[handheld]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[iphone developer program]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://skeldoy.wordpress.com/?p=58</guid>
		<description><![CDATA[I just started iPhone development three days ago. When I begun I had zero knowledge of Objective C and/or the iPhone APIs as a whole. The only programming experience I have is with Perl, bash, some Java, some Tcl/TK and some pretty rough knowledge of C. The first day I did the obligatory &#8220;Hello World&#8221;-stuff [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=skeldoy.wordpress.com&amp;blog=5978470&amp;post=58&amp;subd=skeldoy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I just started iPhone development three days ago. When I begun I had zero knowledge of Objective C and/or the iPhone APIs as a whole. The only programming experience I have is with Perl, bash, some Java, some Tcl/TK and some pretty rough knowledge of C.</p>
<p>The first day I did the obligatory &#8220;Hello World&#8221;-stuff and made an app with a couple of buttons that updated text on the view. Pretty straight forward if you just follow a tutorial. The XCode-environment, fancy as it is, can be a little daunting, so I decided to do the classic learning by doing and see how far I got.</p>
<p>Day two was spent with Interface builder and XCode to draft a rough sketch of my app and then link the stuff together with XCode, building the interfaces and synthesizing them in my code to play with them. After one hour of playing I found that I already had half my app there, so I spent the rest of the day looking up the different APIs that I needed to make my app. This went surprisingly fast. I was anticipating, with my complete lack of Objective-C experience, a couple of days work of trial and error to just piece together a running thing. To my great surprise, not only did I get it running on day two (my app) but I had managed to make it run with zero memory leaks or warnings from the compiler. At the end of day two I felt so confident that I applied for the iPhone developer program to get my app on my device.</p>
<p>Day three started at two in the morning, just hours after I had put in my request to join the developer program. After an hour or so of emails and web-forms I had my app running natively on my device. After gearing down with a beer I went to sleep, eagerly anticipating the next day of coding. When I got up I realized that I actually had managed to create a native iPhone app in two days and deploy it on my device by day three. All the stuff I had heard about the program just seemed like pure nonsense in light of how breezy it all went for me. </p>
<p>Now I am at the end of day three. The day has been spent creating new graphics for the app and tuning some of the off-device code that the device will communicate with on the outside to accomplish the mission. If anyone asks me I will gladly recommend the program for anyone who loves the iPhone and has a couple of hours to create something they want.  </p>
<p>Just my two cents but I seriously believe you have to have the Microsoft-company pretty far up your ass to complain about the iPhone developer program, the decisions they make and the speed at which you are expedited. Think about it. There are tens of thousands of iPhone developers and tens of thousands of apps and still they manage to have some degree of control over what you can sell at their store. Without enforcing some kind of control over the content that they sell they would basically encourage people to scam folks for dough by falsely marketing their apps. I for one welcome our fruit-based overlords. <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/skeldoy.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/skeldoy.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/skeldoy.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/skeldoy.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/skeldoy.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/skeldoy.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/skeldoy.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/skeldoy.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/skeldoy.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/skeldoy.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/skeldoy.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/skeldoy.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/skeldoy.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/skeldoy.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=skeldoy.wordpress.com&amp;blog=5978470&amp;post=58&amp;subd=skeldoy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://skeldoy.wordpress.com/2009/01/28/iphone-development-a-summer-breeze-on-a-hot-platform/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b13d74cb638dfc631aafe20956d05f05?s=96&#38;d=wavatar&#38;r=R" medium="image">
			<media:title type="html">skeldoy</media:title>
		</media:content>
	</item>
		<item>
		<title>Changing the text on the display of a HP-printer using Perl</title>
		<link>http://skeldoy.wordpress.com/2009/01/12/changing-the-text-on-the-display-of-a-hp-printer-using-perl/</link>
		<comments>http://skeldoy.wordpress.com/2009/01/12/changing-the-text-on-the-display-of-a-hp-printer-using-perl/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 12:00:24 +0000</pubDate>
		<dc:creator>skeldoy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[Hewlett Packard]]></category>
		<category><![CDATA[HP]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[printer]]></category>

		<guid isPermaLink="false">http://skeldoy.wordpress.com/?p=56</guid>
		<description><![CDATA[Use this script to change the text on the display of your HP-printer. You can of course pair it with a port-scanner and change every display in your organization (if that floats your goat). #!/usr/bin/perl -w use IO::Socket; unless ($ARGV[0]) { die &#8220;Use: command IP.AD.RE.SS STRING&#8221;; } $ip = $ARGV[0]; $text = $ARGV[1]; my $sock [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=skeldoy.wordpress.com&amp;blog=5978470&amp;post=56&amp;subd=skeldoy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Use this script to change the text on the display of your HP-printer. You can of course pair it with a port-scanner and change every display in your organization (if that floats your goat). <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>#!/usr/bin/perl -w</p>
<p>use IO::Socket;</p>
<p>unless ($ARGV[0]) { die &#8220;Use: command IP.AD.RE.SS STRING&#8221;; }</p>
<p>$ip = $ARGV[0]; $text = $ARGV[1];</p>
<p>my $sock = new IO::Socket::INET (</p>
<p>PeerAddr =&gt; $ip,</p>
<p>PeerPort =&gt; &#8217;9100&#8242;,</p>
<p>Proto =&gt; &#8216;tcp&#8217;,</p>
<p>);</p>
<p>die &#8220;No socket!&#8221; unless $sock;</p>
<p>print $sock &#8220;\e%-12345X\@PJL RDYMSG DISPLAY = \&#8221;$text\&#8221;\n&#8221;;</p>
<p>print $sock &#8220;\e%-12345X\n&#8221;;</p>
<p>close ($sock);</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/skeldoy.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/skeldoy.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/skeldoy.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/skeldoy.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/skeldoy.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/skeldoy.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/skeldoy.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/skeldoy.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/skeldoy.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/skeldoy.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/skeldoy.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/skeldoy.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/skeldoy.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/skeldoy.wordpress.com/56/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=skeldoy.wordpress.com&amp;blog=5978470&amp;post=56&amp;subd=skeldoy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://skeldoy.wordpress.com/2009/01/12/changing-the-text-on-the-display-of-a-hp-printer-using-perl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b13d74cb638dfc631aafe20956d05f05?s=96&#38;d=wavatar&#38;r=R" medium="image">
			<media:title type="html">skeldoy</media:title>
		</media:content>
	</item>
		<item>
		<title>Alerting about new mail on exchange server using bash</title>
		<link>http://skeldoy.wordpress.com/2009/01/12/alerting-about-new-mail-on-exchange-server-using-bash/</link>
		<comments>http://skeldoy.wordpress.com/2009/01/12/alerting-about-new-mail-on-exchange-server-using-bash/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 11:54:30 +0000</pubDate>
		<dc:creator>skeldoy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[e-mail]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[exchange]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[notify]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[webmail]]></category>

		<guid isPermaLink="false">http://skeldoy.wordpress.com/?p=54</guid>
		<description><![CDATA[I am the sole linux user at my office. The other folks use the exchange-client available on their windows-installations. I refuse to use it, so I use the webmail-client. The problem with the webmail is that you have to log on to see whether you&#8217;ve got new mail. I did this script to check it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=skeldoy.wordpress.com&amp;blog=5978470&amp;post=54&amp;subd=skeldoy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I am the sole linux user at my office. The other folks use the exchange-client available on their windows-installations. I refuse to use it, so I use the webmail-client. The problem with the webmail is that you have to log on to see whether you&#8217;ve got new mail. I did this script to check it for me, and I pull it in a timed loop so it checks every ten minutes or so. I even have it playing on the pc-speaker to announce new mail.</p>
<p>Have fun! Remember to fill in the required variables! <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>#!/bin/sh</p>
<p>wget &#8211;user=USERNAME &#8211;password=PASSWORD https://webmail.YOURDOMAIN.WHERE/exchange/EMAIL.ADDRESS/Inbox/?Cmd=contents -O inbox &#8211;quiet</p>
<p>MAILCOUNT= `cat inbox | grep -i -o &#8220;icon-msg-unread.gif&#8221;|wc -l`</p>
<p>echo -n &#8220;You have &#8220;;</p>
<p>if [ $MAILCOUNT != 0 ]; then</p>
<p>echo &#8220;$MAILCOUNT new message(s)&#8221;</p>
<p>else</p>
<p>echo &#8220;no new messages&#8221;</p>
<p>fi</p>
<p>rm inbox</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/skeldoy.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/skeldoy.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/skeldoy.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/skeldoy.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/skeldoy.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/skeldoy.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/skeldoy.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/skeldoy.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/skeldoy.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/skeldoy.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/skeldoy.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/skeldoy.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/skeldoy.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/skeldoy.wordpress.com/54/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=skeldoy.wordpress.com&amp;blog=5978470&amp;post=54&amp;subd=skeldoy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://skeldoy.wordpress.com/2009/01/12/alerting-about-new-mail-on-exchange-server-using-bash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b13d74cb638dfc631aafe20956d05f05?s=96&#38;d=wavatar&#38;r=R" medium="image">
			<media:title type="html">skeldoy</media:title>
		</media:content>
	</item>
		<item>
		<title>Splitting input with bash</title>
		<link>http://skeldoy.wordpress.com/2009/01/12/splitting-input-with-bash-2/</link>
		<comments>http://skeldoy.wordpress.com/2009/01/12/splitting-input-with-bash-2/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 11:47:06 +0000</pubDate>
		<dc:creator>skeldoy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bash split input key value scripting script]]></category>

		<guid isPermaLink="false">http://skeldoy.wordpress.com/2009/01/12/splitting-input-with-bash-2/</guid>
		<description><![CDATA[#!/bin/bash input=$1 key=${input%:*} value=${input#*:} echo $key echo $value<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=skeldoy.wordpress.com&amp;blog=5978470&amp;post=53&amp;subd=skeldoy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>#!/bin/bash<br />
input=$1<br />
key=${input%:*}<br />
value=${input#*:}<br />
echo $key<br />
echo $value</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/skeldoy.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/skeldoy.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/skeldoy.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/skeldoy.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/skeldoy.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/skeldoy.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/skeldoy.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/skeldoy.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/skeldoy.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/skeldoy.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/skeldoy.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/skeldoy.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/skeldoy.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/skeldoy.wordpress.com/53/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=skeldoy.wordpress.com&amp;blog=5978470&amp;post=53&amp;subd=skeldoy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://skeldoy.wordpress.com/2009/01/12/splitting-input-with-bash-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b13d74cb638dfc631aafe20956d05f05?s=96&#38;d=wavatar&#38;r=R" medium="image">
			<media:title type="html">skeldoy</media:title>
		</media:content>
	</item>
		<item>
		<title>Dirty hack for viewing sun rise/set data from yr.no</title>
		<link>http://skeldoy.wordpress.com/2009/01/02/dirty-hack-for-viewing-sun-riseset-data-from-yrno/</link>
		<comments>http://skeldoy.wordpress.com/2009/01/02/dirty-hack-for-viewing-sun-riseset-data-from-yrno/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 13:09:00 +0000</pubDate>
		<dc:creator>skeldoy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[chart]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[light]]></category>
		<category><![CDATA[meteorological]]></category>
		<category><![CDATA[Norway]]></category>
		<category><![CDATA[Oslo]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[sun]]></category>
		<category><![CDATA[sunrise]]></category>
		<category><![CDATA[sunset]]></category>
		<category><![CDATA[weather]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[yr.no]]></category>

		<guid isPermaLink="false">http://skeldoy.wordpress.com/?p=50</guid>
		<description><![CDATA[Ever wondered how many hours of sun light you get during each month of the year? With this quick/dirty perl-hack, you can pull data from the Norwegian Meteorological Institutes astute web-site and see for your self with the google chart APIs. All you need is perl, XML::Simple and LWP::Simple. In this example I use my [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=skeldoy.wordpress.com&amp;blog=5978470&amp;post=50&amp;subd=skeldoy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ever wondered how many hours of sun light you get during each month of the year? With this quick/dirty perl-hack, you can pull data from the Norwegian Meteorological Institutes astute web-site and see for your self with the google chart APIs. All you need is perl, XML::Simple and LWP::Simple. In this example I use my own location (Oslo, Norway). All you need to do to modify it is to find out your latitude and longitude. I have set it up to fire a safari-window with the url by using the &#8220;open&#8221;-statement. You may want to change that to something else.</p>
<p><strong>sunData.pl:</strong></p>
<p><em>#!/usr/bin/perl -w</em></p>
<p><em>use XML::Simple;# qw(:strict);</em></p>
<p><em>use Data::Dumper;</em></p>
<p><em>use LWP::Simple;</em></p>
<p><em>$location = &#8220;lat=59.57;lon=10.42&#8243;;</em></p>
<p><em>for (my $month = 1;$month&lt;13;$month++) {</em></p>
<p><span><em> </em></span><em>for (my $date = 1;$date&lt;31;$date++) {</em></p>
<p><span><em> </em></span><em>$mon = sprintf(&#8220;%02d&#8221;,$month);</em></p>
<p><span><em> </em></span><em>$dat = sprintf(&#8220;%02d&#8221;,$date);</em></p>
<p><span><em> </em></span><em>$url = &#8220;http://api.yr.no/weatherapi/sunrise/0.9/?$location;date=2009-$mon-$dat&#8221;;</em></p>
<p><span><em> </em></span><em>$content = get(&#8220;$url&#8221;);</em></p>
<p><span><em> </em></span><em>if ($content ne &#8220;&#8221;) {</em></p>
<p><span><em> </em></span><em>my $parser = XML::Simple-&gt;new(); </em></p>
<p><span><em> </em></span><em>$sunData = $parser-&gt;XMLin(&#8220;$content&#8221;);</em><span><em> </em></span></p>
<p><span><em> </em></span><em>push (@sunRisings, $sunData-&gt;{time}-&gt;{location}-&gt;{sun}-&gt;{rise});</em></p>
<p><span><em> </em></span><em>push (@sunSettings, $sunData-&gt;{time}-&gt;{location}-&gt;{sun}-&gt;{set});</em></p>
<p><span><em> </em></span><em>}</em></p>
<p><span><em> </em></span><em>} </em></p>
<p><em>}</em></p>
<p><em><br />
</em></p>
<p><em>for (my $i = 0; $i &lt;= $#sunRisings; $i++){</em></p>
<p><span><em> </em></span><em>my $riseTime = substr $sunRisings[$i], 11, 8;</em></p>
<p><span><em> </em></span><em>my $setTime = substr $sunSettings[$i], 11, 8;</em></p>
<p><span><em> </em></span><em>my $riseHour = substr $riseTime, 0,2;</em></p>
<p><span><em> </em></span><em>my $setHour = substr $setTime,0,2;</em></p>
<p><span><em> </em></span><em>my $hoursOfLight = int ((($setHour &#8211; $riseHour)/24)*100);</em></p>
<p><span><em> </em></span><em>push (@lightArray, $hoursOfLight);</em></p>
<p><em>}</em></p>
<p><em>$urlThang = join (&#8216;,&#8217; , @lightArray);</em></p>
<p><em>$chartLink = &#8220;http://chart.apis.google.com/chart?<br />
cht=lc&amp;chd=t:$urlThang&amp;chs=800&#215;300&amp;chco=4D89F9&amp;<br />
chxt=x,y&amp;chxr=0,30,356&amp;chm=o,0066FF,0,-30.0,6&amp;chg=30,5,1,0&#8243;;</em></p>
<p><em>chomp($chartLink);</em></p>
<p><em>`open &#8220;$chartLink&#8221;`;</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/skeldoy.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/skeldoy.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/skeldoy.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/skeldoy.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/skeldoy.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/skeldoy.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/skeldoy.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/skeldoy.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/skeldoy.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/skeldoy.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/skeldoy.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/skeldoy.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/skeldoy.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/skeldoy.wordpress.com/50/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=skeldoy.wordpress.com&amp;blog=5978470&amp;post=50&amp;subd=skeldoy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://skeldoy.wordpress.com/2009/01/02/dirty-hack-for-viewing-sun-riseset-data-from-yrno/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b13d74cb638dfc631aafe20956d05f05?s=96&#38;d=wavatar&#38;r=R" medium="image">
			<media:title type="html">skeldoy</media:title>
		</media:content>
	</item>
	</channel>
</rss>
