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

<channel>
	<title>Michael Dahl (micdah.dk)</title>
	<atom:link href="http://www.micdah.dk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.micdah.dk</link>
	<description>A blog about anything and everything, but mostly something</description>
	<lastBuildDate>Sun, 20 Nov 2011 17:30:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Bodum Macro</title>
		<link>http://www.micdah.dk/2011/08/bodum-macro/</link>
		<comments>http://www.micdah.dk/2011/08/bodum-macro/#comments</comments>
		<pubDate>Mon, 01 Aug 2011 14:54:05 +0000</pubDate>
		<dc:creator>micdah</dc:creator>
				<category><![CDATA[photography]]></category>
		<category><![CDATA[blue sky]]></category>
		<category><![CDATA[bodum]]></category>
		<category><![CDATA[coffee bean]]></category>
		<category><![CDATA[macro]]></category>
		<category><![CDATA[water]]></category>

		<guid isPermaLink="false">http://www.micdah.dk/?p=270</guid>
		<description><![CDATA[It has been itching in me all day long, the desire to be creative and have some fun with my camera. So when the sun peaked out from behind a local cloud coverage, I quickly threw up my tripod and a little setup of water, coffee beans and oh yeah a bodum glass. So this [...]]]></description>
			<content:encoded><![CDATA[<p>It has been itching in me all day long, the desire to be creative and have some fun with my camera. So when the sun peaked out from behind a local cloud coverage, I quickly threw up my tripod and a little setup of water, coffee beans and oh yeah a bodum glass. So this is what came out of it <img src='http://www.micdah.dk/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<div class='alignleft' > <a title="Bodum Macro" href="http://lh6.ggpht.com/-bpUqZ_-tosw/Tja8MfG2UTI/AAAAAAAABU8/hzPD5YQSO7M/s1024/_MG_1527.jpg" rel="lightbox-4e36bd9bce69b"><img class="alignleft" title="Bodum Macro" src="http://lh6.ggpht.com/-bpUqZ_-tosw/Tja8MfG2UTI/AAAAAAAABU8/hzPD5YQSO7M/s150-c/_MG_1527.jpg" alt="_MG_1527.jpg" width="150" height="150" /></a><a title="Bodum Macro" href="http://lh5.ggpht.com/-neDcZ5fMkW4/Tja8Q4r7LsI/AAAAAAAABVM/fiAdkRcyObc/s1024/_MG_1528.jpg" rel="lightbox-4e36bd9bce69b"><img class="alignleft" title="Bodum Macro" src="http://lh5.ggpht.com/-neDcZ5fMkW4/Tja8Q4r7LsI/AAAAAAAABVM/fiAdkRcyObc/s150-c/_MG_1528.jpg" alt="_MG_1528.jpg" width="150" height="150" /></a><a title="Bodum Macro" href="http://lh4.ggpht.com/-r6_5JgWmKrw/Tja8U-NiZLI/AAAAAAAABVc/ogz4FVJGki0/s1024/_MG_1538.jpg" rel="lightbox-4e36bd9bce69b"><img class="alignleft" title="Bodum Macro" src="http://lh4.ggpht.com/-r6_5JgWmKrw/Tja8U-NiZLI/AAAAAAAABVc/ogz4FVJGki0/s150-c/_MG_1538.jpg" alt="_MG_1538.jpg" width="150" height="150" /></a><a title="Bodum Macro" href="http://lh6.ggpht.com/-tInkoWqAHdY/Tja8Ykid47I/AAAAAAAABVk/H4iJ4OIE5eE/s1024/_MG_1539.jpg" rel="lightbox-4e36bd9bce69b"><img class="alignleft" title="Bodum Macro" src="http://lh6.ggpht.com/-tInkoWqAHdY/Tja8Ykid47I/AAAAAAAABVk/H4iJ4OIE5eE/s150-c/_MG_1539.jpg" alt="_MG_1539.jpg" width="150" height="150" /></a></div><div class='clear'></div>
<p><a title="Link to Picasa Web Gallery" href="https://plus.google.com/u/0/photos/109814894178147838918/albums/5635898251697755073" target="_blank">Go to Picasa Web Gallery</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.micdah.dk/2011/08/bodum-macro/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Morning Mist</title>
		<link>http://www.micdah.dk/2011/07/morning-mist/</link>
		<comments>http://www.micdah.dk/2011/07/morning-mist/#comments</comments>
		<pubDate>Wed, 27 Jul 2011 17:37:08 +0000</pubDate>
		<dc:creator>micdah</dc:creator>
				<category><![CDATA[photography]]></category>

		<guid isPermaLink="false">http://www.micdah.dk/?p=260</guid>
		<description><![CDATA[Last night I accidentally stayed up way too late, so that by the time I was ready to head off to slumber land, I noticed that the earliest morning rays of the sun was peaking out coloring the night sky in pretty gradients. So naturally I had to grab my camera and go for a [...]]]></description>
			<content:encoded><![CDATA[<p>Last night I accidentally stayed up way too late, so that by the time I was ready to head off to slumber land, I noticed that the earliest morning rays of the sun was peaking out coloring the night sky in pretty gradients.</p>
<p>So naturally I had to grab my camera and go for a little walk, this is what I ended up with instead of sleep. <img src='http://www.micdah.dk/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<div class='alignleft' > <a title="_MG_1327" href="http://lh5.ggpht.com/-gOPrLaDGGsM/TjBJ_MFs6YI/AAAAAAAABNc/S2QnDbRN0u0/s1024/_MG_1327.jpg" rel="lightbox-4e304c6a40018"><img class="alignleft" title="_MG_1327" src="http://lh5.ggpht.com/-gOPrLaDGGsM/TjBJ_MFs6YI/AAAAAAAABNc/S2QnDbRN0u0/s150-c/_MG_1327.jpg" alt="_MG_1327.jpg" width="150" height="150" /></a><a title="_MG_1329" href="http://lh3.ggpht.com/-v_DyWN9_Xq0/TjBKBRTZU4I/AAAAAAAABNs/hYiziD8ZF-c/s1024/_MG_1329.jpg" rel="lightbox-4e304c6a40018"><img class="alignleft" title="_MG_1329" src="http://lh3.ggpht.com/-v_DyWN9_Xq0/TjBKBRTZU4I/AAAAAAAABNs/hYiziD8ZF-c/s150-c/_MG_1329.jpg" alt="_MG_1329.jpg" width="150" height="150" /></a><a title="_MG_1337" href="http://lh5.ggpht.com/-2Fagajg9dkI/TjBKDEI4f_I/AAAAAAAABN0/DhJwb0PXwtQ/s1024/_MG_1337.jpg" rel="lightbox-4e304c6a40018"><img class="alignleft" title="_MG_1337" src="http://lh5.ggpht.com/-2Fagajg9dkI/TjBKDEI4f_I/AAAAAAAABN0/DhJwb0PXwtQ/s150-c/_MG_1337.jpg" alt="_MG_1337.jpg" width="150" height="150" /></a></div><div class='clear'></div>
<p><a title="Link to Picasa Web Gallery" href="https://plus.google.com/u/0/photos/109814894178147838918/albums/5634083139747955409" target="_blank">Go to Picasa Web Gallery</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.micdah.dk/2011/07/morning-mist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Daddy Longlegs</title>
		<link>http://www.micdah.dk/2011/07/daddy-longlegs/</link>
		<comments>http://www.micdah.dk/2011/07/daddy-longlegs/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 16:53:46 +0000</pubDate>
		<dc:creator>micdah</dc:creator>
				<category><![CDATA[photography]]></category>

		<guid isPermaLink="false">http://www.micdah.dk/?p=232</guid>
		<description><![CDATA[This night a daddy longlegs sneaked into my kitchen, and stayed for the night. It was quite dehydrated, so while providing a drink of water I helped myself to a few macro shots, prior to releasing the little fellow back into nature. Enjoy. Go to Picasa Web Gallery]]></description>
			<content:encoded><![CDATA[<p>This night a daddy longlegs sneaked into my kitchen, and stayed for the night. It was quite dehydrated, so while providing a drink of water I helped myself to a few macro shots, prior to releasing the little fellow back into nature.<br />
Enjoy.</p>
<div class='alignleft' > <a title="Daddy Longlegs" href="http://lh3.ggpht.com/-GQPcQ5EaC_M/TiQ3z6kLb8I/AAAAAAAABIs/knyfkfIxIok/s1024/_MG_0978.jpg" rel="lightbox-4e24634839e9d"><img class="alignleft" title="Daddy Longlegs" src="http://lh3.ggpht.com/-GQPcQ5EaC_M/TiQ3z6kLb8I/AAAAAAAABIs/knyfkfIxIok/s150-c/_MG_0978.jpg" alt="_MG_0978.jpg" width="150" height="150" /></a><a title="Daddy Longlegs" href="http://lh3.ggpht.com/-iymlfRDRFmU/TiQ31HPivfI/AAAAAAAABI0/jLGQRptSNro/s1024/_MG_0984.jpg" rel="lightbox-4e24634839e9d"><img class="alignleft" title="Daddy Longlegs" src="http://lh3.ggpht.com/-iymlfRDRFmU/TiQ31HPivfI/AAAAAAAABI0/jLGQRptSNro/s150-c/_MG_0984.jpg" alt="_MG_0984.jpg" width="150" height="150" /></a><a title="Daddy Longlegs" href="http://lh4.ggpht.com/-AP21cXILy4g/TiQ32ZJyNRI/AAAAAAAABI8/3hEOt1dkInU/s1024/_MG_0995.jpg" rel="lightbox-4e24634839e9d"><img class="alignleft" title="Daddy Longlegs" src="http://lh4.ggpht.com/-AP21cXILy4g/TiQ32ZJyNRI/AAAAAAAABI8/3hEOt1dkInU/s150-c/_MG_0995.jpg" alt="_MG_0995.jpg" width="150" height="150" /></a><a title="Daddy Longlegs" href="http://lh3.ggpht.com/-iOhnUA2Eozk/TiQ33nzkbjI/AAAAAAAABJE/_aqWTp50rAA/s1024/_MG_1010.jpg" rel="lightbox-4e24634839e9d"><img class="alignleft" title="Daddy Longlegs" src="http://lh3.ggpht.com/-iOhnUA2Eozk/TiQ33nzkbjI/AAAAAAAABJE/_aqWTp50rAA/s150-c/_MG_1010.jpg" alt="_MG_1010.jpg" width="150" height="150" /></a></div><div class='clear'></div>
<p><a title="Open Picasa Web gallery" href="https://plus.google.com/u/0/photos/109814894178147838918/albums/5630686710484709249" target="_blank">Go to Picasa Web Gallery</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.micdah.dk/2011/07/daddy-longlegs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shallow Depth of Field</title>
		<link>http://www.micdah.dk/2011/07/shallow-depth-of-field/</link>
		<comments>http://www.micdah.dk/2011/07/shallow-depth-of-field/#comments</comments>
		<pubDate>Sun, 17 Jul 2011 00:13:30 +0000</pubDate>
		<dc:creator>micdah</dc:creator>
				<category><![CDATA[photography]]></category>

		<guid isPermaLink="false">http://www.micdah.dk/?p=212</guid>
		<description><![CDATA[Recently I got the chance to upgrade my (though very decent) Sigma 24-70mm f/2.8 EX DG lens to the top-of-the-line Canon EF 24-70mm f/2.8 L USM lens. As both lenses are similarly spec&#8217;d, the difference is in build quality, features, image quality, sharpness etc., all the little things that together makes an excellent lens. So [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I got the chance to upgrade my (though very decent) Sigma 24-70mm f/2.8 EX DG lens to the top-of-the-line <a title="Canon EF 24-70mm f/2.8 L USM Lens Review at the-digital-picture.com" href="http://the-digital-picture.com/Reviews/Canon-EF-24-70mm-f-2.8-L-USM-Lens-Review.aspx" target="_blank">Canon EF 24-70mm f/2.8 L USM</a> lens. As both lenses are similarly spec&#8217;d, the difference is in build quality, features, image quality, sharpness etc., all the little things that together makes an excellent lens.</p>
<p>So naturally, having this chunk of glass in my hands, I just couldn&#8217;t help myself, getting familiarized with it &#8211; and all I can say is Wow. Now I&#8217;m just sad I can&#8217;t give it a Full Frame sensor to back the image quality and sharpness this lens gives, but that is in the pipeline for later (i.e. for when there is enough money to purchase a Canon 5D mkII <img src='http://www.micdah.dk/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  ).</p>
<p>Anyway, here are some conceptual test shots of a few subjects I had around the home, enjoy.</p>
<div class='alignleft' > <a title="Guitar fret board" href="http://lh4.ggpht.com/-MvSQcStFNDc/TiIgQmKTM3I/AAAAAAAABGw/GPMh61w9dgI/s1024/_MG_0906.jpg" rel="lightbox-4e2464760b10b"><img class="alignleft" title="Guitar fret board" src="http://lh4.ggpht.com/-MvSQcStFNDc/TiIgQmKTM3I/AAAAAAAABGw/GPMh61w9dgI/s150-c/_MG_0906.jpg" alt="_MG_0906.jpg" width="150" height="150" /></a><a title="Audiovector speaker" href="http://lh5.ggpht.com/-eHWBbXPMFWc/TiIgSAo2gsI/AAAAAAAABG4/dg-KbiqQ3sE/s1024/_MG_0928.jpg" rel="lightbox-4e2464760b10b"><img class="alignleft" title="Audiovector speaker" src="http://lh5.ggpht.com/-eHWBbXPMFWc/TiIgSAo2gsI/AAAAAAAABG4/dg-KbiqQ3sE/s150-c/_MG_0928.jpg" alt="_MG_0928.jpg" width="150" height="150" /></a></div><div class='clear'></div>
<p><a title="Open Picasa Web gallery" href="https://plus.google.com/u/0/photos/109814894178147838918/albums/5630097362229871025" target="_blank">Go to Picasa Web Gallery</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.micdah.dk/2011/07/shallow-depth-of-field/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fallout: New Vegas Base ID Sheet</title>
		<link>http://www.micdah.dk/2010/10/fallout-new-vegas-base-id-sheet/</link>
		<comments>http://www.micdah.dk/2010/10/fallout-new-vegas-base-id-sheet/#comments</comments>
		<pubDate>Mon, 25 Oct 2010 16:13:53 +0000</pubDate>
		<dc:creator>micdah</dc:creator>
				<category><![CDATA[games]]></category>
		<category><![CDATA[cheats]]></category>
		<category><![CDATA[fallout new vegas]]></category>
		<category><![CDATA[game]]></category>

		<guid isPermaLink="false">http://www.micdah.dk/?p=180</guid>
		<description><![CDATA[A complete list of all item Base ID's for the new Fallout: New Vegas. With this spreadsheet you get quick access to any ID, ready to enter in the console.]]></description>
			<content:encoded><![CDATA[<p>So now that the new <a title="Link to Bethesda website" href="http://fallout.bethsoft.com/eng/home/home.php" target="_blank">Fallout: New Vegas</a> have been released, we need a new list of so called <em>Base ID</em>&#8216;s of all items in the new game. These are most often (if not always) used to spawn any item in-game via the console.</p>
<p>I have just compiled exactly such a list, <a title="Download Fallout: New Vegas Base ID Sheet" href="http://www.micdah.dk/wp-content/uploads/2010/10/Fallout-New-Vegas-Item-Codes.ods">download here</a> (Open Document Spreadsheet format).</p>
<h3>Spawning items via console</h3>
<p>To spawn an item in-game, open the console by hitting the &#8220;~&#8221; (tilde) key, then type in:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">player.additem [BaseID] [Number]</pre></div></div>

<p>You need to replace [BaseID] with the base id of the item you wish to spawn, and [Number] with the quantity of the item you which to spawn.</p>
<p>E.g. If I want to spawn some .308 Rounds I look up the Base ID and find it to be 0006B53C, I then hit the &#8220;~&#8221; key and type:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">player.additem 0006B53C 10</pre></div></div>

<p>And hit enter. Now I would receive 10 .308 Rounds.</p>
<h3>Extracted list</h3>
<p>The first part of the spreadsheet, is an extracted list optimized for printing, with all the most commonly used items (ammunition,  weapon mods and weapons).</p>
<p><a href="http://www.micdah.dk/wp-content/uploads/2010/10/fallout_new-vegas_extracted.png"><img class="size-medium wp-image-182 aligncenter" title="Fallout: New Vegas Extracted List" src="http://www.micdah.dk/wp-content/uploads/2010/10/fallout_new-vegas_extracted-300x247.png" alt="" width="300" height="247" /></a></p>
<h3>Complete list</h3>
<p>The second part of the spreadsheet, is a complete list of all items in the game with rows for the Base ID (called Form ID here), Editor ID, Type and Name, all of which is filterable via the drop-down boxes for quick access to specific types of items.</p>
<p>From here you can find e.g. all armor items by filtering Type to &#8220;ARMO&#8221;.</p>
<p><a href="http://www.micdah.dk/wp-content/uploads/2010/10/fallout_new-vegas_complete.png"><img class="size-medium wp-image-183 aligncenter" title="Fallout: New Vegas Complete List" src="http://www.micdah.dk/wp-content/uploads/2010/10/fallout_new-vegas_complete-300x247.png" alt="" width="300" height="247" /></a></p>
<h3>List of NPC&#8217;s</h3>
<p>Altough the primary purpose of the list is for item codes, the list actually contains a lot more data than that. If you switch to the &#8220;Complete list&#8221; sheet, you will have access to a large amount of Form ID codes for various things in the game, such as NPC&#8217;s. All you have to do is select the appropriate type from the dropdown menu of the &#8220;Type&#8221; field, so say you are seeking a NPC Form ID, you shall select the &#8220;NPC_&#8221; type. The type names are from within the G.E.C.K utility, so they are all shortened to four letter words, some are easy to guess (such as &#8220;NPC_&#8221;) while others are a bit more tricky (like &#8220;RCCT&#8221;).</p>
<p>Interesting types of Form ID names, are:</p>
<ul>
<li>ALCH &#8211; Items used in alchemy (like &#8220;Human Flesh&#8221;, &#8220;Hydra&#8221; etc.)</li>
<li>ARMO &#8211; Armors, Gloves etc.</li>
<li>BOOK &#8211; Well, books <img src='http://www.micdah.dk/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
<li>CCRD &#8211; Playing cards (if you ever wanted a complete set)</li>
<li>CDCK &#8211; Complete decks</li>
<li>CELL &#8211; Names of the cells (places) in the game</li>
<li>CMNY &#8211; Various currency items (like NCR $)</li>
<li>KEYM &#8211; Various keys for accessing stuff</li>
<li>NPC_ &#8211; All standard game NPC&#8217;s</li>
<li>PERK &#8211; Well all the perks you can acquire</li>
</ul>
<p>Those are the most interesting, but there are plenty of stuff in there, just waiting to be discovered. <img src='http://www.micdah.dk/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<h3>Download</h3>
<p>So go ahead and download it from below, and enjoy. <img src='http://www.micdah.dk/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p style="padding-left: 30px;"><a href="http://www.micdah.dk/wp-content/uploads/2010/10/Fallout-New-Vegas-Item-Codes.ods">Fallout New Vegas Item Codes.ods</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.micdah.dk/2010/10/fallout-new-vegas-base-id-sheet/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>vsFTPd and invalid shells</title>
		<link>http://www.micdah.dk/2010/04/vsftpd-and-invalid-shells/</link>
		<comments>http://www.micdah.dk/2010/04/vsftpd-and-invalid-shells/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 16:41:45 +0000</pubDate>
		<dc:creator>micdah</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[PAM]]></category>
		<category><![CDATA[pam_shells.so]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[vsFTPd]]></category>

		<guid isPermaLink="false">http://www.micdah.dk/?p=169</guid>
		<description><![CDATA[Want vsFTPd to allow local users without a valid shell, so that they may only access FTP but not SSH? Here's how to make vsFTPd allow invalid shells in the user configuration file.]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Recently I have been helping one of my mates with installing and configuring a new server for their business (<a title="Komunikado website" href="http://www.komunikado.dk" target="_blank">Komunikado</a>), and in doing so we came across a feature of <a title="vsFTPd website" href="http://vsftpd.beasts.org/" target="_blank">vsFTPd</a> (very secure ftp daemon) I had encountered prior myself; All <em>local users</em> must have a valid shell to be able to login to the ftp server.</p>
<p style="text-align: justify;">Often though one desires to disallow anonymous logins but neither have SSH login for users of the server (i.e. only ftp access), this might be the case for say web hosting or similar services.</p>
<p style="text-align: justify;">What having a <em>valid shell</em> means, is that the binary pointed to by the user configuration (/etc/passwd in the 6th and last column) must be listed in the /etc/shells file to be considered valid. To disallow SSH login on a local user, you would normally set the users login shell to something non-existent such as /bin/false, /bin/nologin, /dev/null or similar. But doing so will make vsFTPd disallow logins for any such user.</p>
<p style="text-align: justify;">As it turns out, there are two ways to fix this. The choice is up to you.</p>
<h2 style="text-align: justify;">Fix 1. &#8211; Disabling valid shell check for vsFTPd</h2>
<p style="text-align: justify;">This fix will make vsFTPd skip the &#8220;valid shell&#8221; check altogether. As vsFTPd uses the <a title="PAM description on Wikipedia" href="http://en.wikipedia.org/wiki/Pluggable_Authentication_Modules" target="_blank">PAM</a> (Pluggable Authentication Modules) system,  the fix is as easy as opening /etc/pam.d/vsftpd and uncomment the following line using your favorite editor:</p>
<pre style="text-align: justify;">#auth   required        pam_shells.so</pre>
<p style="text-align: justify;">The line is often located at the end of said file. The <a title="Description of pam_shells.so" href="http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/sag-pam_shells.html" target="_blank">pam_shells.so</a> module, is specifically made for checking that a given user has a valid shell, thus there is no loss in security by dropping it from vsFTPd&#8217;s authentication. Now restart your vsFTPd server (in case you are running it in standalone mode) by issuing:</p>
<pre style="text-align: justify;">$ /etc/init.d/vsftpd restart</pre>
<p style="text-align: justify;">If you are using inetd or similar, the changes will take effect on the next session instantiated with the ftp server.</p>
<h2 style="text-align: justify;">Fix 2. &#8211; Adding invalid shell to shells file</h2>
<p style="text-align: justify;">This fix will make whatever invalid binary you have put in your user configuration (/bin/false, /bin/nologin or similar) look like a valid shell without being it (as it&#8217;s a non-existent binary). All you have to do is simply append your invalid shells to the /etc/shells file:</p>
<pre style="text-align: justify;">$ echo "/bin/nologin" &gt;&gt; /etc/shells</pre>
<p style="text-align: justify;">This will make PAM think /bin/nologin is a valid shell and thus the valid shell check will pass for vsFTPd (and any other service!) without the user actually being able to do a SSH login.</p>
<p style="text-align: justify;">Personally  I prefer the first fix as this surgically disables the faulting check in vsFTPd without changing the premise for any other services or changing the system wide environment in general. Adding the invalid shell to the shells file, may or may not adversely affect other services (probably not).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.micdah.dk/2010/04/vsftpd-and-invalid-shells/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Funny Provision problem</title>
		<link>http://www.micdah.dk/2010/03/funny-provision-problem/</link>
		<comments>http://www.micdah.dk/2010/03/funny-provision-problem/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 00:07:24 +0000</pubDate>
		<dc:creator>micdah</dc:creator>
				<category><![CDATA[math]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[provision]]></category>

		<guid isPermaLink="false">http://www.micdah.dk/?p=146</guid>
		<description><![CDATA[An example of a fun math problem I encountered in everyday life. How to calculate a provision knowing only production cost and a provisional percentage of the sales price.]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Recently I ran into a situation where I wanted to calculate a provision so that it was equal to a certain percentage of the total price but I only knew the production price. It quickly became obvious that is wasn&#8217;t as trivial as I had thought.</p>
<p style="text-align: justify;">So stating the problem more clearly; We know the production cost <img src='http://s.wordpress.com/latex.php?latex=c&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='c' title='c' class='latex' /> of some product and we want to determine a provision <img src='http://s.wordpress.com/latex.php?latex=p_v&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p_v' title='p_v' class='latex' /> so that it is equal to a percentage <img src='http://s.wordpress.com/latex.php?latex=p_r&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p_r' title='p_r' class='latex' /> of the sales price <img src='http://s.wordpress.com/latex.php?latex=s&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='s' title='s' class='latex' />.</p>
<p style="text-align: justify;">We know that the sales price is the production cost plus the provision:<br />
<img src='http://s.wordpress.com/latex.php?latex=s%20%3D%20c%20%2B%20p_v&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='s = c + p_v' title='s = c + p_v' class='latex' /></p>
<p style="text-align: justify;">Our requirement can thus be stated as:</p>
<p style="text-align: justify;"><img src='http://s.wordpress.com/latex.php?latex=s%281%20-%20p_r%29%20%3D%20s%20-%20p_v%20&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='s(1 - p_r) = s - p_v ' title='s(1 - p_r) = s - p_v ' class='latex' /><br />
<img src='http://s.wordpress.com/latex.php?latex=%28c%20%2B%20p_v%29%281%20-%20p_r%29%20%3D%20c&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='(c + p_v)(1 - p_r) = c' title='(c + p_v)(1 - p_r) = c' class='latex' /><br />
<img src='http://s.wordpress.com/latex.php?latex=c%281%20-%20p_r%29%20%2B%20p_v%281%20-%20p_r%29%20%3D%20c&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='c(1 - p_r) + p_v(1 - p_r) = c' title='c(1 - p_r) + p_v(1 - p_r) = c' class='latex' /><br />
<img src='http://s.wordpress.com/latex.php?latex=c%281%20-%20p_r%29%20-%20c%20%3D%20-p_v%281%20-%20p_r%29&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='c(1 - p_r) - c = -p_v(1 - p_r)' title='c(1 - p_r) - c = -p_v(1 - p_r)' class='latex' /><br />
<img src='http://s.wordpress.com/latex.php?latex=%5Cfrac%7Bc%281%20-%20p_r%29%20-%20c%7D%7B1%20-%20p_r%7D%20%3D%20-p_v&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\frac{c(1 - p_r) - c}{1 - p_r} = -p_v' title='\frac{c(1 - p_r) - c}{1 - p_r} = -p_v' class='latex' /><br />
<img src='http://s.wordpress.com/latex.php?latex=p_v%20%3D%20-%5Cfrac%7Bc%281%20-%20p_r%29%20-%20c%7D%7B1%20-%20p_r%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p_v = -\frac{c(1 - p_r) - c}{1 - p_r}' title='p_v = -\frac{c(1 - p_r) - c}{1 - p_r}' class='latex' /></p>
<p style="text-align: justify;">Thus we can use this formula directly to calculate a provision matching a certain percentage of the sales price knowing the production cost and said percentage only.</p>
<p style="text-align: justify;">As an example say you have a production cost of 242,- and want 15% of the sales price to go to provision, then we can calculate how much you should add in provision and by definition what your sales price should be:</p>
<p style="text-align: justify;"><img src='http://s.wordpress.com/latex.php?latex=c%20%3D%20242%2C%20p_r%20%3D%20%5Cfrac%7B15%7D%7B100%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='c = 242, p_r = \frac{15}{100}' title='c = 242, p_r = \frac{15}{100}' class='latex' /><br />
<img src='http://s.wordpress.com/latex.php?latex=p_v%20%3D%20-%5Cfrac%7B242%281-%5Cfrac%7B15%7D%7B100%7D%29-242%7D%7B1-%5Cfrac%7B15%7D%7B100%7D%7D%20%3D%20%5Cfrac%7B726%7D%7B17%7D%20%5Capprox%2042.71&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p_v = -\frac{242(1-\frac{15}{100})-242}{1-\frac{15}{100}} = \frac{726}{17} \approx 42.71' title='p_v = -\frac{242(1-\frac{15}{100})-242}{1-\frac{15}{100}} = \frac{726}{17} \approx 42.71' class='latex' /><br />
<img src='http://s.wordpress.com/latex.php?latex=s%20%3D%20c%20%2B%20p_v%20%5Capprox%20284%2C71&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='s = c + p_v \approx 284,71' title='s = c + p_v \approx 284,71' class='latex' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.micdah.dk/2010/03/funny-provision-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Now with my own T-Shirt Shop</title>
		<link>http://www.micdah.dk/2010/03/now-with-my-own-t-shirt-shop/</link>
		<comments>http://www.micdah.dk/2010/03/now-with-my-own-t-shirt-shop/#comments</comments>
		<pubDate>Sun, 21 Mar 2010 21:29:35 +0000</pubDate>
		<dc:creator>micdah</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[single liner]]></category>
		<category><![CDATA[slogan]]></category>
		<category><![CDATA[t-shirt]]></category>

		<guid isPermaLink="false">http://www.micdah.dk/?p=135</guid>
		<description><![CDATA[Quite often you may find yourself, as I sometimes do, coming up with ideas for ridiculous T-Shirt slogans and one liners. Yet again this evening in a conversation with  nullpointer he talked about a project he hadn&#8217;t gotten onto a repository yet &#8211; which led me to the single liner &#8220;everything is better with a [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Quite often you may find yourself, as I sometimes do, coming up with ideas for ridiculous T-Shirt slogans and one liners. Yet again this evening in a conversation with  <a title="Nullpointer's website" href="http://www.nullpointer.dk" target="_blank">nullpointer</a> he talked about a project he hadn&#8217;t gotten onto a repository yet &#8211; which led me to the single liner <a title="Product page for T-Shirt with matching quote" href="http://micdah.spreadshirt.dk/everything-is-better-with-a-repository-A12243462/customize/color/2" target="_blank">&#8220;everything is better with a Repository&#8221;</a>.  So instead of just giggling a bit over my own silliness and let that be that, I thought it would be fun if I could actually put this on a T-Shirt for real instead of just thinking about it.</p>
<p style="text-align: justify;">So that is exactly what I did and as of today I officially have my own line of <em>micdah Designed T-Shirts</em>, go check it out at <a title="Link to my T-Shirt shop" href="http://micdah.spreadshirt.dk" target="_blank">micdah.spreadshirt.dk</a>.</p>
<p style="text-align: justify;">So from now on, all my slogans and single-liners need not dissipate anymore, instead it can get printed onto a cool T-Shirt for all the world to see and ponder about.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.micdah.dk/2010/03/now-with-my-own-t-shirt-shop/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Forcing Logitech G-Series Key Profiler to load game profile</title>
		<link>http://www.micdah.dk/2010/03/forcing-logitech-g-series-key-profiler-to-load-game-profile/</link>
		<comments>http://www.micdah.dk/2010/03/forcing-logitech-g-series-key-profiler-to-load-game-profile/#comments</comments>
		<pubDate>Sun, 21 Mar 2010 15:21:05 +0000</pubDate>
		<dc:creator>micdah</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.micdah.dk/?p=109</guid>
		<description><![CDATA[A step-by-step guide to retrieving a default profile from the Logitech G-Series Key Profiler software if and when the software itself is unable to do so even though you have the game installed.]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">I recently ran into an annoying problem with my Logitech G15 keyboard or more specifically the software (Logitech G-Series Key Profiler) which would not recognize all the games I have installed (<em>using &#8220;Scan for new games&#8221;</em>) so I couldn&#8217;t retrieve the pre-defined profiles the software comes with for a large portion of games.</p>
<p style="text-align: justify;">Naturally all &#8220;official&#8221; solutions were to uninstall  the software and do a clean install &#8211; but that should never be the solution. But a quick look around the resources that come with the software I discovered the file:</p>
<pre>C:\ProgramData\Logitech\G-series Software\Keyboard\Profiles\LGDDefault.lgp</pre>
<p style="text-align: justify;">Which is one large XML file describing each and every profile for the games the software can recognize. The quick hack is then to simply import this profile file from the Logitech software (via Profile -&gt; Import), but this will import each and every profile resulting in a rather large list of profiles (most of which you probably don&#8217;t have the game for).</p>
<p style="text-align: justify;">So the way cleaner solution is to manually retrieve the relevant profiles from the &#8220;master&#8221; profiles file and put them into another XML file also ensuring said file has the correct formatting as expected by the Logitech software. The following is a step-by-step guide to doing that.</p>
<h2>1. Retrieving the profile(s)</h2>
<p style="text-align: justify;">Open the file &#8220;<em>C:\ProgramData\Logitech\G-series Software\Keyboard\Profiles\LGDDefault.lgp</em>&#8221; and do a string-search for the game title in question, which will lead you (assuming there is a profile for that game) a profile description tag, like:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;profile</span> <span style="color: #000066;">guid</span>=<span style="color: #ff0000;">&quot;{BBB9D9AF-1F92-4AD9-9DA5-79D8927403A0}&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Lord of the Rings Online&quot;</span> <span style="color: #000066;">revision</span>=<span style="color: #ff0000;">&quot;3.00&quot;</span> <span style="color: #000066;">lock</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;macros<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;macro</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;F6&quot;</span> <span style="color: #000066;">guid</span>=<span style="color: #ff0000;">&quot;{DCF50AE2-0005-4381-000D-4F0F5A9E9803}&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;singlekey&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;event</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;key&quot;</span> <span style="color: #000066;">keyname</span>=<span style="color: #ff0000;">&quot;F6&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/macro<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 ...
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/macros<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;assignments<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;assignment</span> <span style="color: #000066;">gamekey</span>=<span style="color: #ff0000;">&quot;G26&quot;</span> <span style="color: #000066;">shiftstate</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">macroguid</span>=<span style="color: #ff0000;">&quot;{AD0FFB44-1449-46C7-AC06-C0108BB259B6}&quot;</span> <span style="color: #000066;">playmode</span>=<span style="color: #ff0000;">&quot;oneshot&quot;</span> <span style="color: #000066;">family</span>=<span style="color: #ff0000;">&quot;lhc&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
 ...
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/assignments<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;script</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;signature</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;HKEY_LOCAL_MACHINE&quot;</span> <span style="color: #000066;">subkey</span>=<span style="color: #ff0000;">&quot;SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\12bbe590-c890-11d9-9669-0800200c9a66_is1&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;InstallLocation&quot;</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;lotroclient.exe&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/profile<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Now copy the entire profile tag (from &lt;profile&#8230;&gt; to and including &lt;/profile&gt;) for usage in the next step.</p>
<h2>2.  Creating single profile from copied content</h2>
<p style="text-align: justify;">Create a new file with your favorite XML editor (or Notepad if you have nothing else, it really doesn&#8217;t matter) and wrap your copied profile from step 1., with the following XML to make it readable by the Logitech software.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;profiles<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;profile</span> <span style="color: #000066;">guid</span>=<span style="color: #ff0000;">&quot;{BBB9D9AF-1F92-4AD9-9DA5-79D8927403A0}&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Lord of the Rings Online&quot;</span> <span style="color: #000066;">revision</span>=<span style="color: #ff0000;">&quot;3.00&quot;</span> <span style="color: #000066;">lock</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
 ...
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/profile<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/profiles<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p style="text-align: justify;">Now just go ahead and save this XML file anywhere with the extension .lgp (like &#8220;lotro.lgp&#8221;) as this is the extension the software expects (I suspect it is a acronym for Logitech Gaming Profile).</p>
<p style="text-align: justify;">
<h2>3.  Importing the new gaming profile</h2>
<p>Load up the Logitech G-Series Key Profiler and navigate to &#8220;Profile -&gt; Import&#8221; and select and open the file you created in step 2. Now you will have a new profile in your profiles list for the game you just retrieved with all the macro&#8217;s available for that particular game.</p>
<p>Happy hacking.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.micdah.dk/2010/03/forcing-logitech-g-series-key-profiler-to-load-game-profile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Archive: IJVM Machine Code Example</title>
		<link>http://www.micdah.dk/2010/03/archive-ijvm-machine-code-example/</link>
		<comments>http://www.micdah.dk/2010/03/archive-ijvm-machine-code-example/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 15:50:42 +0000</pubDate>
		<dc:creator>micdah</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[examples]]></category>
		<category><![CDATA[dMasArk]]></category>
		<category><![CDATA[ijvm]]></category>
		<category><![CDATA[isa]]></category>
		<category><![CDATA[opcode]]></category>
		<category><![CDATA[symbolic]]></category>

		<guid isPermaLink="false">http://www.micdah.dk/?p=90</guid>
		<description><![CDATA[Yet another blog post from ye&#8217; old blog. This post was originally titled &#8220;IJVM Machine Code Example&#8221; and posted on the 8th of September, 2007 This is a little addition to my IJVM/ISA theme/posts. Now I will be going a little further into the whole Opcode part of IJVM/ISA. First let me introduce you to [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Yet another blog post from ye&#8217; old blog.</p>
<p style="text-align: justify;">This post was originally titled &#8220;IJVM Machine Code Example&#8221; and posted on the 8th of September, 2007</p>
<hr />
<p style="text-align: justify;">This is a little addition to my IJVM/ISA theme/posts. Now I will be going a little further into the whole Opcode part of IJVM/ISA.</p>
<p style="text-align: justify;">First let me introduce you to a little &#8220;fun&#8221; machine code snippet (<em>Hex representation of IJVM Machine Code</em>):</p>

<div class="wp_syntax"><div class="code"><pre class="asm" style="font-family:monospace;"><span style="color: #0000ff;">00</span> <span style="color: #0000ff;">01</span>
<span style="color: #0000ff;">00</span> <span style="color: #0000ff;">00</span>
<span style="color: #0000ff;">10</span> ff
a7 ff fe</pre></div></div>

<p style="text-align: justify;">It might not be that obvious, but this little 9 byte machine code, will actually make an endless loop, pushing <em>fe</em> (-1) onto the stack for each iteration. The end result will of course be a stack growing until there are no more memory.</p>
<p style="text-align: justify;">Lets try to look at the machine code, and describe how the bytes are formatted/arranged. The first 4-bytes defines how many arguments and local variables there are. The first 2-bytes is a number representing how many arguments there are, and the next 2-bytes how many locals. In this particular case we have:</p>

<div class="wp_syntax"><div class="code"><pre class="asm" style="font-family:monospace;"><span style="color: #0000ff;">00</span> <span style="color: #0000ff;">01</span> = <span style="color: #0000ff;">1</span> argument
<span style="color: #666666; font-style: italic;">; there is always the Obj-Ref/Link Pointer</span>
<span style="color: #0000ff;">00</span> <span style="color: #0000ff;">00</span> = <span style="color: #0000ff;">0</span> locals
<span style="color: #666666; font-style: italic;">; the code isn't using any locals</span></pre></div></div>

<p style="text-align: justify;">Next we have the actual start of the code, from now on, each byte is a representation of either a Opcode, or an argument for the last Opcode. Each opcode, defines how many arguments it is taking. Here are some examples.</p>
<table border="1" cellspacing="0" cellpadding="1">
<tbody>
<tr>
<td valign="top"><strong>Opcode</strong></td>
<td valign="top"><strong>Symoblic name</strong></td>
<td valign="top"><strong>Argument size</strong></td>
<td valign="top"><strong>Description</strong></td>
</tr>
<tr>
<td>0&#215;10</td>
<td>BIPUSH</td>
<td>1-byte</td>
<td>
<p style="text-align: justify;">Pushes the next 1-byte argument (representing an Integer in the range [-128, 127]) onto the stack</p>
</td>
</tr>
<tr>
<td>0&#215;59</td>
<td>DUP</td>
<td>0-byte</td>
<td>
<p style="text-align: justify;">This duplicates (copy) the top-word on the stack</p>
</td>
</tr>
<tr>
<td>0xa7</td>
<td>GOTO</td>
<td>2-byte</td>
<td>
<p style="text-align: justify;">Jumps the execution to the new part in the memory. Moves the pointer relatively to the current pointer by the number of words defined in the 2-byte argument representing an integer in the range [-32.768, 32.767]</p>
</td>
</tr>
</tbody>
</table>
<p style="text-align: justify;">Now lets see what the last 5-bytes of the machine code example, is actually doing.</p>

<div class="wp_syntax"><div class="code"><pre class="asm" style="font-family:monospace;"><span style="color: #0000ff;">10</span> ff = bipush <span style="color: #339933;">-</span><span style="color: #0000ff;">1</span>
<span style="color: #666666; font-style: italic;">; 10 is the opcode for bipush, and takes a 1-byte argument (ff) which is an integer representation of -1</span>
a7 ff fe = <span style="color: #000000; font-weight: bold;">goto</span> <span style="color: #339933;">-</span><span style="color: #0000ff;">2</span>
<span style="color: #666666; font-style: italic;">; a7 is the opcode for goto, and this takes a 2-byte argument (ff fe), which is an integer representation of -2</span></pre></div></div>

<p style="text-align: justify;">So it pushes the number -1 onto the stack, and goes back two bytes (words). Since the pointer is at the 0xa7 instruction when executing, it will go two bytes back, to the 0&#215;10 instruction, which again will make it push another number -1, onto the stack, and so fourth.</p>
<p style="text-align: justify;">To execute this machine code in the IJVM Virtual Machine, you have to add some extra information though. Information of where the main method is starting, and information on the constant pool. Also remember to use UNIX formatting of the file, for example if you are using Windows to edit the files.</p>
<p style="text-align: justify;">Now lets look at this example, wrapped with the information for the virtual machine executer.</p>

<div class="wp_syntax"><div class="code"><pre class="asm" style="font-family:monospace;">main index<span style="color: #339933;">:</span> <span style="color: #0000ff;">0</span>
method area<span style="color: #339933;">:</span> <span style="color: #0000ff;">9</span> bytes
<span style="color: #0000ff;">00</span> <span style="color: #0000ff;">01</span> <span style="color: #0000ff;">00</span> <span style="color: #0000ff;">00</span> <span style="color: #0000ff;">10</span> ff a7 ff fe
constant pool<span style="color: #339933;">:</span> <span style="color: #0000ff;">1</span> words
<span style="color: #adadad; font-style: italic;">00000000</span></pre></div></div>

<p style="text-align: justify;">So that is it, for this example.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.micdah.dk/2010/03/archive-ijvm-machine-code-example/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

