<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>dow.ngra.de</title>
	
	<link>http://dow.ngra.de</link>
	<description>no buzzwords allowed</description>
	<lastBuildDate>Sun, 22 Jan 2012 14:52:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/dow_ngra_de" /><feedburner:info uri="dow_ngra_de" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Another excellent Devops Weekly</title>
		<link>http://feedproxy.google.com/~r/dow_ngra_de/~3/R5HL0tQLaXM/</link>
		<comments>http://dow.ngra.de/2012/01/22/another-excellent-devops-weekly/#comments</comments>
		<pubDate>Sun, 22 Jan 2012 14:52:41 +0000</pubDate>
		<dc:creator>Toomas Römer</dc:creator>
				<category><![CDATA[cool]]></category>

		<guid isPermaLink="false">http://dow.ngra.de/?p=1602</guid>
		<description><![CDATA[One of the few newsletters that I actually read is Devops Weekly. It is a no bullshit, just content type of weekly newsletter composed by Gareth Rushgrove every Sunday. As I was reading this week&#8217;s issue (55th) and clicking the links I stumbled upon couple of presentations that I thought I&#8217;ll mention. Some interesting facts [...]]]></description>
			<content:encoded><![CDATA[<p>One of the few newsletters that I actually read is <a href="http://devopsweekly.com/">Devops Weekly</a>. It is a no bullshit, just content type of weekly newsletter composed by <a href="https://twitter.com/#!/garethr">Gareth Rushgrove</a> every Sunday.</p>
<p>As I was reading <a href="http://devopsweekly.com/2012/01/22/issue-55/">this week&#8217;s issue</a> (55th) and clicking the links I stumbled upon couple of presentations that I thought I&#8217;ll mention. Some interesting facts and fiction from the presentations</p>
<ul style="margin-bottom:5px">
<li>Interesting stats about <a href="http://www.etsy.com/">Etsy</a>
<ul style="margin-bottom:5px">
<li>	> 1 billion page views / month</li>
<li>	$300+ million in sales in 2010</li>
<li>	$41.1 million in December alone</li>
<li>	721 deploys in November</li>
<li>	Engineering team grew 4x during past 15months</li>
<li>	Great startup definition</li>
</ul>
<li>	Work in trunk, branch in code</li>
<li>	Focusing on performance</li>
<li>	Logging and graphing almost everything</li>
<li>	Cool pictures and screenshots</li>
<li>	Perf-related data belongs in your server logs</li>
</ul>
<p>Here are the presentations.</p>
<p><iframe src="http://www.slideshare.net/slideshow/embed_code/7298379" width="400" height="337" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe><br/><br/></p>
<p><iframe src="http://www.slideshare.net/slideshow/embed_code/7300057" width="400" height="337" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe><br/><br/></p>
<p><iframe src="http://www.slideshare.net/slideshow/embed_code/7308367" width="400" height="337" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe><br/><br/></p>
<p><iframe src="http://www.slideshare.net/slideshow/embed_code/11159635" width="400" height="337" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe><br/><br/></p>
<img src="http://feeds.feedburner.com/~r/dow_ngra_de/~4/R5HL0tQLaXM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://dow.ngra.de/2012/01/22/another-excellent-devops-weekly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://dow.ngra.de/2012/01/22/another-excellent-devops-weekly/</feedburner:origLink></item>
		<item>
		<title>Skype Bot for Fun and Profit – Part II – Getting it Running</title>
		<link>http://feedproxy.google.com/~r/dow_ngra_de/~3/BXUrrVp6doI/</link>
		<comments>http://dow.ngra.de/2012/01/06/skype-bot-for-fun-and-profit-part-ii-getting-it-running/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 21:10:21 +0000</pubDate>
		<dc:creator>Toomas Römer</dc:creator>
				<category><![CDATA[cool]]></category>
		<category><![CDATA[creative]]></category>
		<category><![CDATA[humour]]></category>

		<guid isPermaLink="false">http://dow.ngra.de/?p=1533</guid>
		<description><![CDATA[This is a post from the Skype Bot for Fun and Profit series. This is the second part in the series and if you want to get your bot running you will need to have some prerequisites filled out, see the first part for the list. Configuring and running There is a skype-bot project at [...]]]></description>
			<content:encoded><![CDATA[<p><em>This is a post from the <a href="http://dow.ngra.de/2012/01/06/skype-bot-for-fun-and-profit">Skype Bot for Fun and Profit</a> series. This is the second part in the series and if you want to get your bot running you will need to have some prerequisites filled out, see the <a href="http://dow.ngra.de/2012/01/06/skype-bot-for-fun-and-profit-part-i-getting-started">first part</a> for the list.</em></p>
<h3>Configuring and running</h3>
<p><img src="http://dow.ngra.de/wp-content/uploads/2012/01/github.png" alt="" title="github" width="84" height="38" class="alignleft size-full wp-image-1580" />There is a skype-bot project at github. It is written in Java and has support for simple functionality. You can clone it via:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">git clone https://github.com/toomasr/skype-bot.git</pre></div></div>

<p>The project is maven based and once you import the project into your favourite IDE that has maven support it should compile out of the box. Before we can actually run the project we need to make couple of adjustments. First make a copy of the <b>project.properties</b> file and make it <b>personal.properties</b>. Then change the username, password and pemfile attributes in the file. Make sure that the folder that has the pem file also has a der file that has the same name (except the extension of course).<br />
<span id="more-1533"></span><br />
Next lets build the project. It is sufficient to just issue a <code>mvn install</code> command. You will end up with a <b>skype-bot-0.0.1-SNAPSHOT.jar</b> in the <code>target</code> folder. Before we can run that we need to start the runtime. See <a href="http://dow.ngra.de/?p=1504">Running the Runtime from the previous post</a>.</p>
<p>Now we are ready to start the bot. Issue a <code>java -jar target/skype-bot-0.0.1-SNAPSHOT.jar</code>. Now expecting that the Runtime is still running and that you updated the credentials in the <b>personal.properties</b> file you should see your need friend come online and you can start a chat.</p>
<p>The bot has the commands that he reacts to defined in the <code>org.zeroturnaround.commands</code> package. But for starters you can tell him &#8220;bot: time&#8221; and it will tell you the time.</p>
<h3>Web Server</h3>
<p>The bot also launches a web server on port <b>2500</b> that has defined handler on the url <code>http://0.0.0.0:2500/post</code>. You can send a <b>POST</b> message there with the parameters <bold>message=?</bold> and <bold>group=?</bold>. This will instruct the bot to issue the <bold>message</bold> to the <bold>group</bold>. The group is looked up from the bot&#8217;s list of groups that matches the <code>Conversation.PROPERTY.displayname</code>.</p>
<p>So what can we do with this? Most of the todays services have webhooks. For example GitHub has <a href="http://help.github.com/post-receive-hooks/">Service Hooks</a>, FogBugz have <a href="http://fogbugz.stackexchange.com/questions/8634/fogbugz-web-hooks">Web Hooks</a> and others have similar services. This means that you can register a web hook and when an event happens the bot will tell you over Skype (in a group chat for example).</p>
<h3>What next?</h3>
<p>This is up to you, hopefully you have a friendly bot. Make him tell you important information that you care about and don&#8217;t let him waste your time. Check back to the <a href="http://dow.ngra.de/2012/01/06/skype-bot-for-fun-and-profit ">original article</a> if I&#8217;ve added anything to the series.</p>
<img src="http://feeds.feedburner.com/~r/dow_ngra_de/~4/BXUrrVp6doI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://dow.ngra.de/2012/01/06/skype-bot-for-fun-and-profit-part-ii-getting-it-running/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		<feedburner:origLink>http://dow.ngra.de/2012/01/06/skype-bot-for-fun-and-profit-part-ii-getting-it-running/</feedburner:origLink></item>
		<item>
		<title>Skype Bot for Fun and Profit – Part I – Getting Started</title>
		<link>http://feedproxy.google.com/~r/dow_ngra_de/~3/6PMGGSirDjY/</link>
		<comments>http://dow.ngra.de/2012/01/06/skype-bot-for-fun-and-profit-part-i-getting-started/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 21:09:44 +0000</pubDate>
		<dc:creator>Toomas Römer</dc:creator>
				<category><![CDATA[cool]]></category>
		<category><![CDATA[creative]]></category>
		<category><![CDATA[humour]]></category>

		<guid isPermaLink="false">http://dow.ngra.de/?p=1504</guid>
		<description><![CDATA[This is a post from the Skype Bot for Fun and Profit series. This is the first part in the series and for a complete list see the original article. Join the Skype Developer Program A lot of necessary documentation and also software is behind a login screen at Skype Developer Program. You will need [...]]]></description>
			<content:encoded><![CDATA[<p><em>This is a post from the <a href="http://dow.ngra.de/2012/01/06/skype-bot-for-fun-and-profit">Skype Bot for Fun and Profit</a> series. This is the first part in the series and for a complete list see the <a href="http://dow.ngra.de/2012/01/06/skype-bot-for-fun-and-profit">original article</a>.</em></p>
<h3>Join the Skype Developer Program</h3>
<div id="dev_program"></div>
<p><img src="http://dow.ngra.de/wp-content/uploads/2012/01/skype_developer-150x150.png" alt="" title="Skype Developer Program" width="150" height="150" class="alignleft size-thumbnail wp-image-1575" />A lot of necessary documentation and also software is behind a login screen at <a href="http://developer.skype.com/" title="Skype Developer Program">Skype Developer Program</a>. You will need to join the program to continue and log in. This will cost you 10$. I personally don&#8217;t like the monetary fee for documentation and a SDK but I&#8217;m happy this is not 100$.<br />
<span id="more-1504"></span><br />
Now the biggest challenge has been conquered and you can also open up Skype&#8217;s own <a href="http://developer.skype.com/skypekit/development-guide/java-tutorial/tutorial-guide-java">Getting Started Guide</a>. That guide will go into more details with some of the next steps, so if you get stuck here be sure to check their documentation also.</p>
<h3>Create a new project at Skype</h3>
<div id="project"></div>
<p>Lets create a new project at the developer page. Navigate to My Projects submenu.There you can choose between multiple projects to create.</p>
<p><img src="http://dow.ngra.de/wp-content/uploads/2011/12/my-projects.png" alt="" title="My Projects" width="500" height="82" class="aligncenter size-full wp-image-1510" /></p>
<p>Right now you need to choose <b>SkypeKit for Desktop</b>. You can name the project something along the lines of <b>chat-bot-demo</b> and fill the rest of the form how ever you like (or they require). Now we have a project in place and we can move on.</p>
<h3>Download the SDK and the Runtime</h3>
<p>Navigate to your just created project and lets get the SDK and Runtime. SDK is the library (com.skype.*) that you will use to talk to the runtime (headless Skype client). The SDK you can download right away but for the Runtime you need to put in a request and it can take up to several hours to get the download link (usually just 5-10 minutes).</p>
<p><img src="http://dow.ngra.de/wp-content/uploads/2011/12/sdk_and_runtime.png" alt="" title="SDK and Runtime" width="500" height="168" class="aligncenter size-full wp-image-1515" /></p>
<h3>Build a sid-java-wrapper.jar file</h3>
<div id="sdk"></div>
<p>The SDK comes in source format only, before we can continue we need to get this into a single JAR file and also install it in your local maven repository. To build it we need <a href="http://ant.apache.org/">ANT</a> to be installed (I presume you do). Issue the following commands now:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">toomasr@cigar:~/$ cd skypekit-sdk_sdk/interfaces/skype/java/api/
toomasr@cigar:~/skypekit-sdk_sdk/interfaces/skype/java/api$ ant
Buildfile: ~/skypekit-sdk_sdk/interfaces/skype/java/api/build.xml
&nbsp;
clean:
   [delete] Deleting directory ~/skypekit-sdk_sdk/interfaces/skype/java/api/bin
&nbsp;
compile:
    [mkdir] Created dir: ~/skypekit-sdk_sdk/interfaces/skype/java/api/bin
    [javac] Compiling 36 source files to ~/skypekit-sdk_sdk/interfaces/skype/java/api/bin
&nbsp;
jar:
      [jar] Building jar: ~/skypekit-sdk_sdk/interfaces/skype/java/api/sid-java-wrapper.jar
&nbsp;
clean-build:
&nbsp;
main:
&nbsp;
BUILD SUCCESSFUL
Total time: 3 seconds</pre></div></div>

<p>We have the sid-java-wrapper.jar file now in that <code>api</code> folder. For easier project setup we will be using maven (and probably for some of you shoot you in the foot as an added bonus). We will need to install the JAR file into our local repository. I will use <b>com.skype</b> as the groupId and <b>skype-sdk</b> as the artifactId. Issue the following command to do the same.</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">toomasr@cigar:~/$ cd ~/skypekit-sdk_sdk/interfaces/skype/java/api/
mvn install:install-file -Dfile=sid-java-wrapper.jar -DgroupId=com.skype -DartifactId=skype-sdk -Dversion=1.0 -Dpackaging=jar</pre></div></div>

<h3>Run the runtime</h3>
<div id="runtime"></div>
<p>Just to check if the runtime starts lets unpack and start the binary. If everything goes successfully you should see something similar. On a Linux machine I had to download couple of different binaries before I got a client that did not die (at least on EC2).</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">toomasr@cigar:~/downloadss/mac-x86-skypekit-novideo_3.5.1.1041_493734/bin/mac-x86$ ./mac-x86-skypekit-novideo 
SkypeRuntime Copyright (C) 2003-2011 Skype Technologies S.A.
SkypeRuntime Version: 3.4.1/mac-x86-skypekit-novideo_3.5.1.1041_493734
Proprietary and confidential, do not share this application.</pre></div></div>

<h3>Development keypair</h3>
<div id="keypair"></div>
<p>Next we need a development keypair. It is a signed RSA private key that you need to request from the Skype developer website. See the screenshot.</p>
<p><img src="http://dow.ngra.de/wp-content/uploads/2012/01/developer_key_pair_resized.png" alt="" title="Developer Key" width="500" height="174" class="alignnone size-full wp-image-1518" /></p>
<p>Once you have the file downloaded lets convert it to a format that is used by the Skype SDK. This is the openssl command for this. Be smarter than me and don&#8217;t accidentally overwrite the downloaded PEM file because they let you download it only once. The keypair is valid for 60 days!</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">openssl pkcs8 -topk8 -in download-pair.pem -outform DER -out downloaded-pair.der -nocrypt</pre></div></div>

<h3>Create a Skype account for the bot</h3>
<div id="account"></div>
<p>Go to <a href="http://www.skype.com/">skype.com</a> and create an account for you bot. Also add this bot to your friend list and log in once with the bot and accept the request.</p>
<h3>Lets sum it up</h3>
<p>By now we should have the following in place</p>
<ul>
<li><a href="#dev_program">Have 10USD less on you bank account</a></li>
<li><a href="#dev_program">Skype Developer account</a></li>
<li><a href="#project">A project created at Skype Developer page</a></li>
<li><a href="#runtime">Working Skype Runtime</a></li>
<li><a href="#sdk">Skype SDK jar file</a></li>
<li><a href="#keypair">Development Keypair in PEM and DER format</a></li>
<li><a href="#account">New contact on your contact list and its username/password</a></li>
</ul>
<p>If you are missing any of those or had problems getting them then check out the more in depth documentation at <a href="https://developer.skype.com/skypekit/development-guide/java-tutorial/tutorial-guide-java">developer.skype.com</a> or post a comment.</p>
<p>Where to go from now? Check out the next part, <a href="http://dow.ngra.de/2012/01/06/skype-bot-for-fun-and-profit-part-ii-getting-it-running">Getting it Running</a>.</p>
<img src="http://feeds.feedburner.com/~r/dow_ngra_de/~4/6PMGGSirDjY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://dow.ngra.de/2012/01/06/skype-bot-for-fun-and-profit-part-i-getting-started/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://dow.ngra.de/2012/01/06/skype-bot-for-fun-and-profit-part-i-getting-started/</feedburner:origLink></item>
		<item>
		<title>Skype Bot for Fun and Profit</title>
		<link>http://feedproxy.google.com/~r/dow_ngra_de/~3/9gw6_aQhqZQ/</link>
		<comments>http://dow.ngra.de/2012/01/06/skype-bot-for-fun-and-profit/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 21:08:53 +0000</pubDate>
		<dc:creator>Toomas Römer</dc:creator>
				<category><![CDATA[cool]]></category>
		<category><![CDATA[creative]]></category>
		<category><![CDATA[humour]]></category>

		<guid isPermaLink="false">http://dow.ngra.de/?p=1497</guid>
		<description><![CDATA[Couple of months ago I was travelling and found myself in a hotel room with many hours to kill. For no particular reason I started hacking on a Java based Skype bot. Couple of weeks later I took the time to polish it and enable it for company wide notification chatroom. Now couple of months [...]]]></description>
			<content:encoded><![CDATA[<p><em>Couple of months ago I was travelling and found myself in a hotel room with many hours to kill. For no particular reason I started hacking on a Java based Skype bot. Couple of weeks later I took the time to polish it and enable it for company wide notification chatroom. Now couple of months later I&#8217;m on vacation and will write about how to write a Skype bot in Java.</em></p>
<h3>The Plan</h3>
<div style="float:left"><img src="http://dow.ngra.de/wp-content/uploads/2012/01/183272970_54862f67b4_b.jpg" alt="" title="Bot" width="100" height="187"/><br/><span style="font-size: xx-small;"><span style="font-family: Arial;">Image by </span><a style="font-family: Arial;" href="http://www.flickr.com/photos/flysi/183272970/">Simon Abrams</a></span></div>
<p>The Skype bot needs a bit more work than your average IRC bot because of the proprietary nature of Skype. There is much clicking and downloading of certificate stuff to get you started for example. Also I want to show you how to put the bot into action, so we will go beyond just the bot.<br />
<span id="more-1497"></span></p>
<h4>Getting started</h4>
<p>In this <a href="http://dow.ngra.de/2012/01/06/skype-bot-for-fun-and-profit-part-i-getting-started">Part I &#8211; Getting Started</a> we will go through the steps to get you started with the Skype developer program and download all the necessary software for the bot. The registration process, necessary accounts etc. Once you complete these steps you can develop any other bot out there.</p>
<h4>Hacking on the Java part</a></h4>
<p>In this <a href="http://dow.ngra.de/2012/01/06/skype-bot-for-fun-and-profit-part-ii-getting-it-running">Part II &#8211; Getting It Running</a> we will take a <a href="https://github.com/toomasr/skype-bot/">Java Skype bot</a> and get it running. It requires a little more than just compile and run so it has its own chapter.</p>
<p>We will also look into how to use this bot to notify about important information to Skype chat rooms. </p>
<h4>And maybe something more</h4>
<p>If everything went well then you have your own bot running now. There are many ways to go forward and improve the bot and the services. Lets see if we have time to cover those.</p>
<p>Hopefully next time that I have a <del>dumb</del> crazy idea I go have a beer instead.</p>
<img src="http://feeds.feedburner.com/~r/dow_ngra_de/~4/9gw6_aQhqZQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://dow.ngra.de/2012/01/06/skype-bot-for-fun-and-profit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://dow.ngra.de/2012/01/06/skype-bot-for-fun-and-profit/</feedburner:origLink></item>
		<item>
		<title>What I saw at Devops Talks Back event in London</title>
		<link>http://feedproxy.google.com/~r/dow_ngra_de/~3/uX4qPS-m09k/</link>
		<comments>http://dow.ngra.de/2011/07/27/what-i-saw-at-devops-talks-back-event-in-london/#comments</comments>
		<pubDate>Wed, 27 Jul 2011 08:57:44 +0000</pubDate>
		<dc:creator>Toomas Römer</dc:creator>
				<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://dow.ngra.de/?p=1482</guid>
		<description><![CDATA[Just had a great evening at the Devops Talks Back event in London. My smartphone was dumb enough not to update its timezone information on arrival to UK and I was 2 hours early. Luckily the event took place at a mini Google like office from the Forward guys, besides coffee and drinks I was [...]]]></description>
			<content:encoded><![CDATA[<p>Just had a great evening at the <a href="https://londondevops.eventwax.com/devops-talks-back">Devops Talks Back event</a> in London. My smartphone was dumb enough not to update its timezone information on arrival to UK and I was 2 hours early. Luckily the event took place at a mini Google like office from the <a href="http://www.forward.co.uk/">Forward</a> guys, besides coffee and drinks I was asked if I needed a laptop to kill time :)</p>
<p>I chatted with the early arrived organizer and speakers about Ruby, Java deployments and British comedy sketches (<a href="http://en.wikipedia.org/wiki/Big_Train">Big Train</a>, <a href="http://en.wikipedia.org/wiki/Little_britain">Little Britain</a> and <a href="http://en.wikipedia.org/wiki/Alan_Partridge">Alan Partridge</a>).<br />
<span id="more-1482"></span><br />
The event had 2 presentations. One was about the <a href="http://aframe.com/">Aframe</a>, doing quite a niche stuff, they build a system for online video production (editing, transcoding, tagging). The presenter, <a href="http://twitter.com/#!/jonlives">John Cowie</a> went over the technical hurdles that they have had to cross to get their product out the door. Also he had a positive story to tell that it is possible to shorten the gap between the ops and dev and thanks to that he is abe to take vacations without having interruptions as he used to (the London underground still told me to Mind the Gap).</p>
<p>The next presenter, <a href="http://twitter.com/#!/johnleach">John Leach</a> talked about the <a href="http://ceph.newdream.net/">Ceph</a> project. A posix compliant distributed network storage and filesystem (think of HDFS, GFS) that happens to be OSS and is quickly maturing. We also got a fun history of the network storage stack. I was lucky enough to have read <a href="http://borthakur.com/ftp/RealtimeHadoopSigmod2011.pdf">Apache Hadoop Goes Realtime at Facebook</a> quite recently and was able to chime in couple of comments at later discussions.</p>
<p>After the presentations there were random chats and we visited a local pub. It was a great no pressure event where you can meet people with similar interest, either technical, comedy wise or board game wise (met a 9kyu <a href="http://en.wikipedia.org/wiki/Go_(game)">Go</a> player). The venue was really comfy and cosy.</p>
<p>PS. It was the second office I&#8217;ve seen so far that has a Go set, the first is <a href="http://www.zeroturnaround.com/">ZeroTurnaround</a>.</p>
<img src="http://feeds.feedburner.com/~r/dow_ngra_de/~4/uX4qPS-m09k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://dow.ngra.de/2011/07/27/what-i-saw-at-devops-talks-back-event-in-london/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://dow.ngra.de/2011/07/27/what-i-saw-at-devops-talks-back-event-in-london/</feedburner:origLink></item>
		<item>
		<title>Fling – Detecting Little Fockers Furballs</title>
		<link>http://feedproxy.google.com/~r/dow_ngra_de/~3/sCfh8JnsB_I/</link>
		<comments>http://dow.ngra.de/2011/06/15/fling-detecting-little-fockers-furballs/#comments</comments>
		<pubDate>Wed, 15 Jun 2011 08:13:44 +0000</pubDate>
		<dc:creator>Toomas Römer</dc:creator>
				<category><![CDATA[cool]]></category>
		<category><![CDATA[creative]]></category>

		<guid isPermaLink="false">http://dow.ngra.de/?p=1384</guid>
		<description><![CDATA[This piece is the second installment in the series of Fling &#8211; Game of Furballs. It has been in the drafts for 6 months because of lack of time and/or interest. I&#8217;m on a bus to Tartu and I just might as well finish this. So in the previous part I gave you an intro [...]]]></description>
			<content:encoded><![CDATA[<p><i>This piece is the second installment in the series of <a href="http://dow.ngra.de/2010/12/27/fling-game-of-furballs/">Fling &#8211; Game of Furballs</a>. It has been in the drafts for 6 months because of lack of time and/or interest. I&#8217;m on a bus to Tartu and I just might as well finish this.</i></p>
<p>So in the previous part I gave you an intro of the game and how I stumbled upon the game and how it took over our lunches (now we have recovered and are back to random discussions). In this part we&#8217;ll look how to detect the furballs from Fling screenshots.</p>
<h2>Abstract</h2>
<p>Lets build a web service that accepts screenshots of Fling and sends you back a webpage link of the solution to the image or just bunch of attachments. </p>
<h2>Solution</h2>
<p>Lets divide and conquer.</p>
<ul>
<li>Image/Color recognition to detect the Furballs (covered in this piece)
<li>Algorithm to solve the puzzles (not covered, but code available)
<li>Algorithm to draw the 1 step screens (not covered, but code available)
<li>Email handling (not covered, but code available)
</ul>
<p><span id="more-1384"></span></p>
<h2>Detecting Furballs</h2>
<p>When I started out with this one I had no idea how to do it. I sent an email to <a href="http://kt.era.ee/">one of my friends</a> who has done image recognition and asked him how to get started. He took a look at the screenshot and asked, why do I need to recognize anything, just detect the color and you can tell if it is an empty square or a furball! It sounded so obvious that I was somewhat ashamed for not thinking of this myself :)</p>
<h2>Python and PIL</h2>
<p>Go get the latest version of <a href="http://www.pythonware.com/products/pil/">PIL</a> installed to have the examples work. Also we&#8217;ll be working from the root of the fling solver project. Just clone my <a href="https://bitbucket.org/hudolejev/flingsolver">BitBucket repo</a>. So lets get started and load up the image and verify that PIL is working. Or you can skip this and take a look at <a href="https://bitbucket.org/hudolejev/flingsolver/src/501a753cea03/blog_demo_1.py">blog_demo_1.py.</a></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">shot = Image.<span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">dirname</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">abspath</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,       
                               <span style="color: #483d8b;">&quot;etc/shots/sample001.png&quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>                          
shot_pix = shot.<span style="color: black;">load</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>                                                              
shot.<span style="color: black;">show</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p><a href="http://dow.ngra.de/wp-content/uploads/2011/06/original.png"><img src="http://dow.ngra.de/wp-content/uploads/2011/06/original-150x150.png" alt="" title="Original Image" width="150" height="150" class="alignright size-thumbnail wp-image-1464" style="margin-left:10px" /></a>Once you execute this an image should pop up, like the one on the right. Now lets isolate a square and dwell into it.</p>
<p>Because the grid is static it is a matter of figuring out the width and height and the offsets as where the squares start. You can use your top notch vision, pixel ruler or little bit of Python to get this right. Run the following and you will see how I&#8217;m using PIL to find the offsets (trial and error). You should see something like <a href="http://dow.ngra.de/wp-content/uploads/2011/06/one_marked.png">this</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">x, y, w, h = <span style="color: #ff4500;">2</span>, <span style="color: #ff4500;">70</span>, <span style="color: #ff4500;">45</span>, <span style="color: #ff4500;">45</span>                                                          
<span style="color: #808080; font-style: italic;"># lets choose the leftmost square and visualise it                                  </span>
draw = ImageDraw.<span style="color: black;">Draw</span><span style="color: black;">&#40;</span>shot<span style="color: black;">&#41;</span>                                                         
draw.<span style="color: black;">rectangle</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span>x, y, x+w, y+h<span style="color: black;">&#93;</span>, outline=<span style="color: black;">&#40;</span><span style="color: #ff4500;">255</span>, <span style="color: #ff4500;">255</span>, <span style="color: #ff4500;">255</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>                           
<span style="color: #ff7700;font-weight:bold;">del</span> draw                                                                            
shot.<span style="color: black;">show</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Ok, excellent. We now know the coordinates. Lets now average the colors. We will iterate through every pixel and take an average of the R, G, B values. We&#8217;ll also display the image for debugging purposes.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;"># lets find the average color</span>
avgR, avgG, avgB = <span style="color: #ff4500;">0</span>,<span style="color: #ff4500;">0</span>,<span style="color: #ff4500;">0</span>
counter = <span style="color: #ff4500;">0</span>
<span style="color: #808080; font-style: italic;"># load pixels of the image</span>
shot_pix = shot.<span style="color: black;">load</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">xrange</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span>, w<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">for</span> j <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">xrange</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span>, h<span style="color: black;">&#41;</span>:
        counter = counter + <span style="color: #ff4500;">1</span>
        avgR = avgR+shot_pix<span style="color: black;">&#91;</span>x+i, y+j<span style="color: black;">&#93;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>
        avgG = avgG+shot_pix<span style="color: black;">&#91;</span>x+i, y+j<span style="color: black;">&#93;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>
        avgB = avgB+shot_pix<span style="color: black;">&#91;</span>x+i, y+j<span style="color: black;">&#93;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span>
&nbsp;
avgR = avgR/counter
avgB = avgB/counter
avgG = avgG/counter
&nbsp;
avgC = <span style="color: black;">&#40;</span>avgR,avgG,avgB<span style="color: black;">&#41;</span>
&nbsp;
draw = ImageDraw.<span style="color: black;">Draw</span><span style="color: black;">&#40;</span>shot<span style="color: black;">&#41;</span>
draw.<span style="color: black;">rectangle</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span>x, y, x+w, y+h<span style="color: black;">&#93;</span>, outline=<span style="color: black;">&#40;</span><span style="color: #ff4500;">255</span>, <span style="color: #ff4500;">255</span>, <span style="color: #ff4500;">255</span><span style="color: black;">&#41;</span>, fill=avgC<span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">del</span> draw
shot.<span style="color: black;">show</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Okay, <a href="http://dow.ngra.de/wp-content/uploads/2011/06/one_avg.png">looks about right</a>. Now lets do this for the whole image. Here I will be reusing code from the flingsolver package. You can do the same.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">fip = ImProcessor<span style="color: black;">&#40;</span><span style="color: #483d8b;">'etc/shots/sample002.png'</span><span style="color: black;">&#41;</span>
fip.<span style="color: black;">debug</span> = <span style="color: #008000;">True</span>
state = fip.<span style="color: black;">process</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
fip.<span style="color: black;">show</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p><img src="http://dow.ngra.de/wp-content/uploads/2011/06/all_average2.png" alt="" title="All Average" width="324" height="478" class="aligncenter size-full wp-image-1474" /></p>
<p>Voila, all squares are marked with their average color. Now detecting furballs and not furballs is quite easy. Just make a conditional based on some color. For example I used:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> isBall<span style="color: black;">&#40;</span>...<span style="color: black;">&#41;</span>
...
<span style="color: #ff7700;font-weight:bold;">if</span> avgR <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">60</span>, <span style="color: #ff4500;">90</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">and</span> avgG <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">90</span>, <span style="color: #ff4500;">130</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">and</span> avgB <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">36</span>,<span style="color: #ff4500;">55</span><span style="color: black;">&#41;</span>:        
	<span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">False</span>
<span style="color: #ff7700;font-weight:bold;">else</span>:                         
	<span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">True</span></pre></div></div>

<p>For the complete demo you can run blog_demo_1.py from the flingsolver repository. It should generate all the images shown in this post. Happy hacking your own images!</p>
<p>Next time when I have time I will continue with the solving Fling and writing the email handling.</p>
<img src="http://feeds.feedburner.com/~r/dow_ngra_de/~4/sCfh8JnsB_I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://dow.ngra.de/2011/06/15/fling-detecting-little-fockers-furballs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://dow.ngra.de/2011/06/15/fling-detecting-little-fockers-furballs/</feedburner:origLink></item>
		<item>
		<title>MailChimp – No More Bananas for You</title>
		<link>http://feedproxy.google.com/~r/dow_ngra_de/~3/eySdyJE6gng/</link>
		<comments>http://dow.ngra.de/2011/06/03/mailchimp-no-more-bananas-for-you/#comments</comments>
		<pubDate>Fri, 03 Jun 2011 15:05:52 +0000</pubDate>
		<dc:creator>Toomas Römer</dc:creator>
				<category><![CDATA[rant]]></category>
		<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://dow.ngra.de/?p=1437</guid>
		<description><![CDATA[I have not ranted for some time but I just heard and saw so much crap about MailChimp that I just had to open up a draft here and let some steam out. MailChimp was my choice of newsletter software years ago and it worked fine if you leave out some quirks here and there. [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://dow.ngra.de/wp-content/uploads/2011/06/noMoreBananas.jpg" alt="" title="No More Bananas" width="238" height="136" class="alignright size-full wp-image-1440" style="margin-left:10px"/>I have not ranted for some time but I just heard and saw so much crap about <a href="http://mailchimp.com/">MailChimp</a> that I just had to open up a draft here and let some steam out. MailChimp was my choice of newsletter software years ago and it worked fine if you leave out some quirks here and there. As the usage has grown it has been brought to my attention that this software does not scale. Throughout the conversations I’ve also discovered a way how to block any account on MailChimp. So lets start.<br />
<span id="more-1437"></span></p>
<h2>Scaling</h2>
<p>Throughout the years you’ve built multiple lists. Your data has grown. You have a big announce to make and you would like to send everyone a message. You make a campaign, duplicate this to the lists and hit send on all of them. You get couple of angry replies that they received multiple messages. Oh, okay, they were on multiple lists, I&#8217;m sure there is a solution for this.</p>
<p>The chimp says that use groups instead of lists. Have a master list with multiple groups and then you won&#8217;t have the problem of people receiving multiple emails of the campaign. Okay, lets give it a try. You create the list, you create the groups, you populate the groups. Some people are on a single group, some are on multiple groups. You send out a master campaign and you see that couple of people unsubscribed.  Thats cool. Then you find out that they were unsubscribed from all the groups and unsubscription did not even let them choose a group. WTF?</p>
<p>You ask the chimp for help and they say that this is a feature. Choose one, a granular approach or bazooka but not both. </p>
<h2>Blocking Any Account at MailChimp</h2>
<p>Scenario: you are a happy chimp and sending out campaigns, everything is fun and cool until one day you are unable to log into your account. You get a message that your account has been blocked because you’re most probably a spammer. Wow, how did that happen?</p>
<p>You send an email to their support and find out that they found your address from <a href="http://www.stopforumspam.com/">stopforumspam.com</a> and they block your account automatically. It does not matter how you ended up on that website ( in this case you have not even registered a forum account with this email address for ages ). You send them one more email and ask what provider do they recommend to use now that this bad luck hit you. They kindly reinstate your account. Weeehah!</p>
<p>So if you want to block somebody from MailChimp, get their email address to one of these stop spam sites.  For quickest results see <a href="http://www.stopforumspam.com/add">stopforumspam.com/add</a> You can be sure that they can’t do anything for 48 hours.</p>
<h2>Conclusions</h2>
<p>Besides the two scenarios that I’ve mentioned I’ve had many more smaller issues with MailChimp. From not being able to call them, not being able to bulk delete people from large groups, not being able to remove email header images, not seeing email addresses of shared accessees etc. </p>
<p>The lists are dumb and cannot talk to each other without extensive scripts from infra wizards. Likewise, even if you are a dummy yourself, you cannot actually communicate with anyone at MC (they do not use telephone technology at all) except via email or Live Chat. Also, you frequently get signed out every 30 minutes whether you are in the middle of typing an email campaign or just sitting there wondering why you chose MC all those years ago&#8230;</p>
<img src="http://feeds.feedburner.com/~r/dow_ngra_de/~4/eySdyJE6gng" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://dow.ngra.de/2011/06/03/mailchimp-no-more-bananas-for-you/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://dow.ngra.de/2011/06/03/mailchimp-no-more-bananas-for-you/</feedburner:origLink></item>
		<item>
		<title>VisualVM and jps Not Finding my Java Process</title>
		<link>http://feedproxy.google.com/~r/dow_ngra_de/~3/W3xgxM9CRyQ/</link>
		<comments>http://dow.ngra.de/2011/05/27/visualvm-and-jps-not-finding-my-java-process/#comments</comments>
		<pubDate>Fri, 27 May 2011 10:07:54 +0000</pubDate>
		<dc:creator>Toomas Römer</dc:creator>
				<category><![CDATA[cool]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://dow.ngra.de/?p=1429</guid>
		<description><![CDATA[Today I was hit by a weird problem and I thought I&#8217;ll share the problem and the solution (thanks for the solution goes to my colleague Lauri). Googling did not help me much (probably bad keywords or not much information about it) and hopefully this post will serve as future destination for a solution for [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was hit by a weird problem and I thought I&#8217;ll share the problem and the solution (thanks for the solution goes to my colleague Lauri). Googling did not help me much (probably bad keywords or not much information about it) and hopefully this post will serve as future destination for a solution for this problem.</p>
<h2>Problem</h2>
<p>You are running Mac OS X (maybe the problem is relevant on other platforms too) and even if you&#8217;ve started Tomcat and you can see the Java process in the Activity Monitor or with <code>ps</code> you <strong>can&#8217;t</strong> see the process with <code>jps</code>. You <strong>are not</strong> able to connect to the process with VisualVM nor JConsole. Bummer.<br />
<span id="more-1429"></span></p>
<h2>Solution</h2>
<p>Tomcat scripts have a variable called CATALINA_TMPDIR and the java process is forked with</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">-Djava.io.tmpdir=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$CATALINA_TMPDIR</span>&quot;</span></pre></div></div>

<p> What happens is that jps and VisualVM/JConsole look for information about processes from the system TMP folder. Once you redefine this they cannot find their information. The solution is to eliminate this variable from the process.</p>
<p>Either execute the commandline that you can copy and paste from</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ps</span> aux <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-i</span> tomcat</pre></div></div>

<p> and exclude the -Djava.io.tmpdir part or modify the script for your debug session. Thats it.</p>
<p>You&#8217;re welcome.</p>
<img src="http://feeds.feedburner.com/~r/dow_ngra_de/~4/W3xgxM9CRyQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://dow.ngra.de/2011/05/27/visualvm-and-jps-not-finding-my-java-process/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://dow.ngra.de/2011/05/27/visualvm-and-jps-not-finding-my-java-process/</feedburner:origLink></item>
		<item>
		<title>I fought the F.A.S.T. and I won</title>
		<link>http://feedproxy.google.com/~r/dow_ngra_de/~3/V16e-b_gEsE/</link>
		<comments>http://dow.ngra.de/2011/03/15/i-fought-the-f-a-s-t-and-i-won/#comments</comments>
		<pubDate>Tue, 15 Mar 2011 10:33:53 +0000</pubDate>
		<dc:creator>Vladimir Šor</dc:creator>
				<category><![CDATA[rant]]></category>

		<guid isPermaLink="false">http://dow.ngra.de/?p=1407</guid>
		<description><![CDATA[Editor note: You probably would want to write a rant or downgrade something when a migration wizard fails and you lose your migrated files? Yes, yes, yes! This is what happened to Volli, he was able to partially save his files but read on for the details&#8230; Introduction My current Lenovo T60 laptop is at [...]]]></description>
			<content:encoded><![CDATA[<p><em>Editor note: You probably would want to write a rant or downgrade something when a migration wizard fails and you lose your migrated files? Yes, yes, yes! This is what happened to Volli, he was able to partially save his files but read on for the details&#8230;</em></p>
<h3>Introduction</h3>
<p>My current Lenovo T60 laptop is at least 4 years old (nobody at my company knows anymore how old it is, as even support department doesn&#8217;t have any records about it) and is waiting for the replacement. It was running Windows XP pretty fine, if one doesn&#8217;t count some sporadic hangs and reboots. Around 1 month ago I started to experiment with different operating systems to see what&#8217;s happening in modern operating systems world.<br />
<span id="more-1407"></span><br />
At first I tried Ubuntu with it&#8217;s smart installer which installs the system somewhere in the existing NTFS file system which is pretty cool. except that laptop hung every other sleep&#8230;</p>
<p>Then I managed to install MacOS X on a separate hard drive, but I couldn&#8217;t find any hackintosh drivers for my particular wireless card (Intel PRO/Wireless 3945ABG).</p>
<p>Then I was back to Windows, which has Windows 7 as it&#8217;s most modern version. Well, it&#8217;s considered to be good practice to reinstall windows time after time so I decided to make a backup and do a clean install. For the first time in my more than 15 year experience with MS software I decided to use it&#8217;s own user state migration tool rather than manually copy all needed files and settings from &#8216;Documents and Settings&#8217; folder. I don&#8217;t usually keep there much because of spaces in the folder names and all sorts of problems because of that, but still I got there some assorted important documents.</p>
<h3>Fail F.A.S.T.</h3>
<p>I happily selected &#8216;Files and Settings Transfer wizard&#8217; (F.A.S.T.) from the Start menu, clicked next-next-next, let windows show me some progress bars and in ended up with a folder with a magic name <code>USMT2.UNC</code> and 2 files inside it: <code>IMG00000001.DAT</code> (with 1.2Gb size) and file called <code>status</code> (with a size of 16 bytes). Somehow I thought that exporting files from windows xp using it&#8217;s migration tool and then importing these settings in windows 7 sounds like a pretty normal usage pattern, but how wrong was I!</p>
<p>I copied all my backups to external hard drive, dropped all partitions and installed windows 7. (In the meantime I managed to fry that hard drive with everything on it, but that&#8217;s another story.) Now it was time to restore files from the backup! </p>
<p>So I went to Accessories menu to find something called &#8216;Easy Transfer&#8217;. Sounds promising&#8230; Except that it doesn&#8217;t know how to handle Windows XP FAST archive, that I had. Hmm. That&#8217;s weird. Searching on MS KB gave no pointers except that if I wanted to migrate files from an old computer I should have installed Windows 7 on a new machine, then created some magic disk for the old system, transferred files with it and then would import stuff back on Win7. How sick is that!? How the hell I&#8217;m supposed to to a clean upgrade if I must have 2 machines to transfer my stuff?</p>
<p>I googled for the magic folder name: <code>USMT2.UNC</code>. This time I found some command-line app called User State Migration Tool, which can be downloaded from MS, but unfortunately its <code>loadstate.exe</code> still couldn&#8217;t do anything with that poor folder. Another bit of information was that I should use exactly the same version of windows xp to restore files from such archive. (What&#8217;s the point of such transfer?) Anyhow, I installed Windows XP in a VirtualBox and was hoping to run restore procedure and then just copy files manually as I have done tens of times so far. Yeah&#8230; FAST said that I have insufficient space on my disk. How&#8217;s that &#8211; I had around 4Gigs of free space there and this stupid archive is only 1,2Gb?! So, even with the same Windows XP my &#8216;backup&#8217; was useless.</p>
<p>Further search revealed a lot of complaining people who found themselves with such useless &#8216;backup&#8217;:</p>
<ul>
<li><a href="http://www.bleepingcomputer.com/forums/topic1153.html">http://www.bleepingcomputer.com/forums/topic1153.html</a></li>
<li><a href="http://answers.microsoft.com/en-us/windows/forum/windows_xp-files/great-yet-very-disappointing/f0d53c52-1c00-483f-bec6-b5e072bb898a">microsoft&#8217;s own forums</a>
</ul>
<p>However, this time I found a link to a tool called <code>fastconv</code>. </p>
<p>Here is a page with lengthy description:<br />
<a href="http://windowsxp.mvps.org/fast.htm">http://windowsxp.mvps.org/fast.htm</a></p>
<p>Ok, let&#8217;s give it a try. At the first try fastconv log said to me: <br />
<code>Error Source store is invalid. [ERROR=13 (Dh)]</code></p>
<p>Along with the fastconv there was one more utility called <code>rmv2opq.exe</code> and it was said that it</p>
<blockquote><p><em>converts a removable media store into a normal compressed store</em></p></blockquote>
<p>Whatever it means. Anyway, I ran it. The result was &#8216;astonishing&#8217; &#8211; target folder contained the same <code>.dat</code> file and <code>status</code> file, but this time status file was 12, rather than 16 bytes! What a progress! However, this time, running <code>fastconv.exe</code> on these &#8216;new&#8217; files gave more information &#8211; it started listing a lot of <code>.dat</code> files but crashed in the end. Fortunately, <code>fastconv</code> had a switch to keep temporary files. When I used that, it generated 2 folders: <code>0000/</code> and <code>TRANS/</code>. </p>
<p>Folder <code>0000/</code> contained 2255 files with names from <code>001.DAT</code> to <code>8CF.DAT</code>. When I looked inside these files I could see that these were extracted original files but with wrong names. <code>TRANS/</code> folder had a binary file <code>DB.DAT</code>. However, when I looked inside I could see both .DAT file names mixed with original file names and all that in unicode, meaning that simple grepping wouldn&#8217;t help as unicode uses 2 bytes per symbol so all names had 0&#215;00 between characters and everything was again mixed with binary data. Fiddling with the fastconv didn&#8217;t give any results as it kept crashing after generating temporary and database files. </p>
<h3>Getting hands dirty</h2>
<p>Ok, lets explore what we have. <code>DB.DAT</code> file&#8217;s header said: &#8216;<code>m e m d b   d a t   f i l e   v 9   n o d b g</code>&#8216;. Couldn&#8217;t find anything reasonable for neither opening it nor format description to write my own parser.</p>
<p>Then I started looked for something to extract unicode text from binary files. And found an application called <a href="http://www.mcafee.com/us/downloads/free-tools/bintext.aspx">BinText</a> from McAfee, that was doing exactly what I needed. From the <code>DB.DAT</code> file it generated me a listing like this: <br />
<a href="http://dow.ngra.de/wp-content/uploads/2011/03/BinText.png"><img src="http://dow.ngra.de/wp-content/uploads/2011/03/BinText-300x257.png" alt="" title="BinText window" width="300" height="257" class="alignnone size-medium wp-image-1413" /></a></p>
<p>At some point I saw such pattern:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">00000002CCB6   00000002CCB6      0   0000002E.DAT
00000002CD3A   00000002CD3A      0   arrow_l.cur
00000002CDB8   00000002CDB8      0   arrow_l.cur
00000002D002   00000002D002      0   arrow_m.cur
00000002D056   00000002D056      0   0000002F.DAT
00000002D0DA   00000002D0DA      0   arrow_m.cur
00000002D158   00000002D158      0   arrow_m.cur
00000002D3A2   00000002D3A2      0   arrow_r.cur
00000002D3F6   00000002D3F6      0   00000030.DAT
00000002D47A   00000002D47A      0   arrow_r.cur
00000002D4F8   00000002D4F8      0   arrow_r.cur</pre></div></div>

<p>Which could be interpreted like this:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">&lt;original file name&gt;
&lt;corresponding .dat file&gt;
&lt;original file name in 8.3 format&gt;
&lt;original file name again in some other format&gt;</pre></div></div>

<p>Following was simple &#8211; clean up the log and leave only original file and .dat file:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">$&gt; grep -B 1 DAT trans.txt &gt; files.log</pre></div></div>

<p>Which resulted in a file that looked like this:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">00000002F0A2   00000002F0A2      0   beam_r.cur
00000002F0F6   00000002F0F6      0   00000038.DAT
--
00000002F442   00000002F442      0   beam_rl.cur
00000002F496   00000002F496      0   00000039.DAT
--
00000002F7E2   00000002F7E2      0   beam_rm.cur
00000002F836   00000002F836      0   0000003A.DAT
--</pre></div></div>

<p>Then I wrote a small program to parse this log and rename files (handling of duplicates was important as I couldn&#8217;t restore directory structure). Before final renaming I ran it several times with writing logs to spot all problems in the log file.</p>
<p>Ok, I lost the directory structure and some file names are still broken, but at least I got my files back and I can fix these small issues by hand.</p>
<p>Lessons learned? Don&#8217;t blindly trust &#8216;migration&#8217; software and keep good ol&#8217; files handy.</p>
<p>P.S. Post named after the song <a href="http://www.youtube.com/watch?v=jbCqwl2geQg">&#8216;I fought the law&#8217;</a> by Dead Kennedys.</p>
<img src="http://feeds.feedburner.com/~r/dow_ngra_de/~4/V16e-b_gEsE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://dow.ngra.de/2011/03/15/i-fought-the-f-a-s-t-and-i-won/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://dow.ngra.de/2011/03/15/i-fought-the-f-a-s-t-and-i-won/</feedburner:origLink></item>
		<item>
		<title>What are the default -Xmx and -Xms values?</title>
		<link>http://feedproxy.google.com/~r/dow_ngra_de/~3/OC3F8-gfqbU/</link>
		<comments>http://dow.ngra.de/2011/01/12/what-are-the-default-xmx-and-xms-values/#comments</comments>
		<pubDate>Wed, 12 Jan 2011 07:57:18 +0000</pubDate>
		<dc:creator>Toomas Römer</dc:creator>
				<category><![CDATA[cool]]></category>

		<guid isPermaLink="false">http://dow.ngra.de/?p=1399</guid>
		<description><![CDATA[Happened to read Inspecting HotSpot JVM Options and found a solution to one of the questions that I have every now and then. What are the default -Xmx and -Xms values for this JVM on this machine? The solution? Invoking java with some flags, check out the terminal session. toomasr@cigarillo-2:~$ java -server -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal -version [...]]]></description>
			<content:encoded><![CDATA[<p>Happened to read <a href="http://q-redux.blogspot.com/2011/01/inspecting-hotspot-jvm-options.html">Inspecting HotSpot JVM Options</a> and found a solution to one of the questions that I have every now and then. <strong>What are the default -Xmx and -Xms values for this JVM on this machine?</strong> The solution? Invoking java with some flags, check out the terminal session.</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">toomasr@cigarillo-2:~$ java -server -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal -version | grep -i heapsize
uintx ErgoHeapSizeLimit                    = 0                {product}
uintx InitialHeapSize                     := 65011712         {product}
uintx LargePageHeapSizeThreshold           = 134217728        {product}
uintx MaxHeapSize                         := 1040187392       {product}
java version &quot;1.6.0_22&quot;
Java(TM) SE Runtime Environment (build 1.6.0_22-b04-307-10M3261)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03-307, mixed mode)
toomasr@cigarillo-2:~$ java -client -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal -version | grep -i heapsize
uintx ErgoHeapSizeLimit                    = 0                {product}
uintx InitialHeapSize                      = 0                {product}
uintx LargePageHeapSizeThreshold           = 134217728        {product}
uintx MaxHeapSize                          = 130862280        {product}
java version &quot;1.6.0_22&quot;
Java(TM) SE Runtime Environment (build 1.6.0_22-b04-307-10M3261)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03-307, mixed mode)</pre></div></div>

<p>If there is an easier way, let me know. Will put this one on my tool belt at the moment.</p>
<img src="http://feeds.feedburner.com/~r/dow_ngra_de/~4/OC3F8-gfqbU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://dow.ngra.de/2011/01/12/what-are-the-default-xmx-and-xms-values/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://dow.ngra.de/2011/01/12/what-are-the-default-xmx-and-xms-values/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 1.448 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-05-05 22:27:31 -->

