<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom">
 
 <title>Jason Madigan - He's just zis guy, ya know?</title>
 
 <link href="http://jasonmadigan.com/" />
 <updated>2011-02-07T20:19:05+00:00</updated>
 <id>http://jasonmadigan.com/</id>
 <author>
   <name>Jason Madigan</name>
   <email>jason@jasonmadigan.com</email>
 </author>

 
 <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/JasonMadigan" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="jasonmadigan" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry>
   <title>Jekyll</title>
   <link href="http://jasonmadigan.com/2010/09/20/jekyll" />
   <updated>2010-09-20T00:00:00+01:00</updated>
   <id>http://jasonmadigan.com/2010/09/20/jekyll</id>
   <content type="html">&lt;p&gt;Way back in November, 2008, I read an &lt;a href="http://tom.preston-werner.com/2008/11/17/blogging-like-a-hacker.html"&gt;article&lt;/a&gt; by Tom Preston-Werner which detailed his approach to blogging and blogging software. For years I&amp;#8217;ve been trying to use one terrible &lt;span class="caps"&gt;CMS&lt;/span&gt; or another. The idea of sitting down to write &lt;em&gt;yet another&lt;/em&gt; &lt;span class="caps"&gt;CMS&lt;/span&gt; to tackle some of the issues I have with blogging software really didn&amp;#8217;t appeal to me. Remembering his article, I started poking with &lt;a href="http://github.com/mojombo/jekyll"&gt;Jekyll&lt;/a&gt;. I had a pretty good idea of what I wanted:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Simplicity&lt;/li&gt;
	&lt;li&gt;&lt;span class="caps"&gt;CLI&lt;/span&gt;-based editing&lt;/li&gt;
	&lt;li&gt;Posts in a plaintext format, with formatting in a really lightweight markup language like &lt;a href="http://en.wikipedia.org/wiki/Textile_%28markup_language%29"&gt;Textile&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;Static content generation &amp;#8211; if you post something popular, chances are you&amp;#8217;re going to start flushing &amp;#8220;dynamic&amp;#8221; content out to disk as static &lt;span class="caps"&gt;HTML&lt;/span&gt;. Why bother waiting to write posts out as static files?&lt;/li&gt;
	&lt;li&gt;No comments &amp;#8212; as far as I&amp;#8217;m concerned, the effort required to manage spam and user comments simply isn&amp;#8217;t worth it.&lt;/li&gt;
&lt;/ul&gt;</content>
 </entry>
 
 <entry>
   <title>Irish Weather app live on the App Store</title>
   <link href="http://jasonmadigan.com/2009/12/16/irish-weather-app-live-on-the-app-store" />
   <updated>2009-12-16T00:00:00+00:00</updated>
   <id>http://jasonmadigan.com/2009/12/16/irish-weather-app-live-on-the-app-store</id>
   <content type="html">&lt;p&gt;I was bored three weekends ago and had an idea for a simple Irish weather app. Met Eireann have tons of great data available to the public, but finding the good stuff was a little fiddly. Anyway, after a weekend of work in Photoshop and Xcode, I had a pretty nice app. It was finally approved late last night. It&amp;#8217;s free to download, so feel free to give it a spin.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://itunes.apple.com/ie/app/irish-weather/id343679419?mt=8"&gt;Irish Weather 1.0&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>The day a Time Capsule died</title>
   <link href="http://jasonmadigan.com/2009/11/25/the-day-a-time-capsule-died" />
   <updated>2009-11-25T00:00:00+00:00</updated>
   <id>http://jasonmadigan.com/2009/11/25/the-day-a-time-capsule-died</id>
   <content type="html">&lt;p&gt;This is the first Apple product I&amp;#8217;ve owned that&amp;#8217;s died since my old Apple ][. The hard drive seems to be fine though. Plugged it into another machine and it works just fine. I guess all that heat killed the logicboard. I guess it had been warning me with a few months though &amp;#8211; its &lt;span class="caps"&gt;DHCP&lt;/span&gt; server had become very flakey over the past few weeks.&lt;/p&gt;
&lt;p&gt;Oh well, time to dust off my old dependable WRT54GL.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Node.js - Event driven, non-blocking web servers written in JavaScript</title>
   <link href="http://jasonmadigan.com/2009/11/23/node-js-event-driven-non-blocking-web-servers-written-in-javascript" />
   <updated>2009-11-23T00:00:00+00:00</updated>
   <id>http://jasonmadigan.com/2009/11/23/node-js-event-driven-non-blocking-web-servers-written-in-javascript</id>
   <content type="html">&lt;p&gt;I&amp;#8217;ve been fiddling with &lt;a href="http://github.com/ry"&gt;Ryan Dahl&amp;#8217;s&lt;/a&gt; &lt;a href="http://github.com/ry/node"&gt;Node.js&lt;/a&gt; event driven I/O framework for the V8 JavaScript VM over the past couple of days. It&amp;#8217;s probably the coolest piece of software I&amp;#8217;ve come across in ages, and it really builds upon one of JavaScript&amp;#8217;s core strengths: event driven programming. If you&amp;#8217;ve been looking to brush up on your event driven programming, it&amp;#8217;s seriously worth taking the time to play with. As part of his work on Node, Ryan has also released a seriously cool tiny &lt;a href="http://github.com/ry/http-parser"&gt;&lt;span class="caps"&gt;HTTP&lt;/span&gt; parser&lt;/a&gt; in C (and used by Node). At 128 bytes per connection, it&amp;#8217;s perfect for use in any embedded environment which could do with some &lt;span class="caps"&gt;HTTP&lt;/span&gt; love, like the &lt;a href="http://www.arduino.cc/"&gt;Arduino&lt;/a&gt;.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Bluetooth/USB tethering &amp; MMS for O2 Ireland with iPhone OS 3.0</title>
   <link href="http://jasonmadigan.com/2009/03/19/bluetooth-usb-tethering-and-mms-for-o2-ireland-with-iphone-os-3-0" />
   <updated>2009-03-19T00:00:00+00:00</updated>
   <id>http://jasonmadigan.com/2009/03/19/bluetooth-usb-tethering-and-mms-for-o2-ireland-with-iphone-os-3-0</id>
   <content type="html">&lt;p&gt;&lt;strong&gt;Update #2: These carrier settings will work with Beta 2 also. Also, Safari likes to attach a .zip extension to the ipcc, so either rename the downloaded file minus the extension or use Firefox/curl something else to download the updated carrier settings.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update: Updated the &lt;span class="caps"&gt;MMS&lt;/span&gt; proxy settings, the previous version was using an old (dead) proxy. To update just re-download the carrier settings and apply an update once more.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;After a little dicking around prompted by some stuff I noticed on twitter, I cobbled together this updated carrier bundle for O2 Ireland to enable &lt;span class="caps"&gt;USB&lt;/span&gt;/Bluetooth tethering for iPhone OS 3.0. This also enables the sending/recieving of &lt;span class="caps"&gt;MMS&lt;/span&gt; messages a new photo button will appear in Messages.app to send pictures as &lt;span class="caps"&gt;MMS&lt;/span&gt; messages.&lt;/p&gt;
&lt;p&gt;Grab it &lt;a href="http://www.jasonmadigan.com/O2_ie.ipcc"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To install, option (alt) click update in iTunes, and select this updated &lt;span class="caps"&gt;IPCC&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;If something terrible happens, you can grab a backup of the old one to restore &lt;a href="http://www.jasonmadigan.com/O2_ie.ipcc.backup"&gt;here&lt;/a&gt;.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Trip report - #fowadublin</title>
   <link href="http://jasonmadigan.com/2009/03/09/trip-report-fowadublin" />
   <updated>2009-03-09T00:00:00+00:00</updated>
   <id>http://jasonmadigan.com/2009/03/09/trip-report-fowadublin</id>
   <content type="html">&lt;p&gt;I attended &lt;span class="caps"&gt;FOWA&lt;/span&gt; Dublin Friday last, and had a pretty good time. The speakers were the main reason I attended, with &lt;span class="caps"&gt;DHH&lt;/span&gt; &amp;amp; Simon Willison delivering particularly great talks. There were a couple of things that bugged me about the event setup. Not to be a jerk or anything, but there&amp;#8217;s a few points I hope the &lt;a href="http://www.carsonified.com/fowa/"&gt;Carsonified&lt;/a&gt; guys take a look at and fix in time for next year:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Poor WiFi &amp;#8211; I know the guys have apologised about this already, but it stuck in most people&amp;#8217;s craw and I guess it bears repeating. With 400 odd people milling about with iPhones and Macs some decent WiFi would&amp;#8217;ve been nice.&lt;/li&gt;
	&lt;li&gt;Socialising is kind of hard when you&amp;#8217;ve got absolutely no room to move.&lt;/li&gt;
	&lt;li&gt;I don&amp;#8217;t really care about toilets, but I heard there was only one bathroom for guys and one for girls.&lt;/li&gt;
	&lt;li&gt;Lack of freebies. The tickets were pretty pricey (although I&amp;#8217;d guess individuals paying for their own tickets were in the minority). Basically the only thing given away was a name-tag &amp;amp; holder. Free coffee for breaks or something would&amp;#8217;ve gone down nicely.&lt;/li&gt;
&lt;/ul&gt;</content>
 </entry>
 
 <entry>
   <title>Using cookies to calculate a user's timezone</title>
   <link href="http://jasonmadigan.com/2009/01/17/using-cookies-to-calculate-a-users-timezone" />
   <updated>2009-01-17T00:00:00+00:00</updated>
   <id>http://jasonmadigan.com/2009/01/17/using-cookies-to-calculate-a-users-timezone</id>
   <content type="html">&lt;p&gt;A few days ago I &lt;a href="http://github.com/entp/xtt/tree/master"&gt;discovered&lt;/a&gt; a quick &amp;amp; easy way few to use cookies to help your Rails app get a user&amp;#8217;s timezone, without prompting. It&amp;#8217;s pretty easy to implement:&lt;/p&gt;
&lt;p&gt;First up: set a cookie, any cookie:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="javascript"&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;date&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="c1"&gt;// returns offset from GMT in minutes&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;offset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getTimezoneOffset&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// set a cookie however you see fit, I like to use jQuery.cookie&lt;/span&gt;
&lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cookie&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;timezone&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;offset&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;Then, in application.rb or wherever you like:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;browser_timezone&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kp"&gt;nil&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;cookies&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:timezone&lt;/span&gt;&lt;span class="o"&gt;].&lt;/span&gt;&lt;span class="n"&gt;blank?&lt;/span&gt;
  &lt;span class="vi"&gt;@browser_timezone&lt;/span&gt; &lt;span class="o"&gt;||=&lt;/span&gt; &lt;span class="k"&gt;begin&lt;/span&gt;
    &lt;span class="n"&gt;min&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cookies&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:timezone&lt;/span&gt;&lt;span class="o"&gt;].&lt;/span&gt;&lt;span class="n"&gt;to_i&lt;/span&gt;
    &lt;span class="no"&gt;TimeZone&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;minutes&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;The cookie gives you minutes from &lt;span class="caps"&gt;GMT&lt;/span&gt;, but &lt;code&gt;ActiveSupport::TimeZone&lt;/code&gt; expects seconds from &lt;span class="caps"&gt;GMT&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;Anyway, hopefully someone will find my pointing it out useful. It may buckle under pressure (with daylight savings), but guessing and getting it right 50% of the time is better than forcing user interaction. Probably.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>An iPhone app is born</title>
   <link href="http://jasonmadigan.com/2008/12/27/an-iphone-app-is-born" />
   <updated>2008-12-27T00:00:00+00:00</updated>
   <id>http://jasonmadigan.com/2008/12/27/an-iphone-app-is-born</id>
   <content type="html">&lt;p&gt;&lt;a href="http://www.feedhenry.com/"&gt;We&lt;/a&gt; finally saw our first iPhone app land on the App Store a couple of days ago. iPhone app development is pretty wonderful in comparison to some of the other crapheaps out there, but it&amp;#8217;s also pretty damn nice by itself too. It was a ton of fun to write, and it was nice to do something like it for a local paper, &lt;a href="http://www.munster-express.ie/"&gt;The Munster Express&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Check it out &lt;a href="http://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/browserRedirect?url=itms%253A%252F%252Fax.itunes.apple.com%252FWebObjects%252FMZStore.woa%252Fwa%252FviewSoftware%253Fid%253D300295436%2526mt%253D8"&gt;here&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Ruby Christmas</title>
   <link href="http://jasonmadigan.com/2008/12/21/ruby-christmas" />
   <updated>2008-12-21T00:00:00+00:00</updated>
   <id>http://jasonmadigan.com/2008/12/21/ruby-christmas</id>
   <content type="html">&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;                     &lt;span class="s2"&gt;&amp;quot;/|&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
                 &lt;span class="s2"&gt;&amp;quot;/wl)e&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="nb"&gt;eval&lt;/span&gt;&lt;span class="p"&gt;(\&lt;/span&gt;
                    &lt;span class="s2"&gt;&amp;quot;A | A&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
                   &lt;span class="s2"&gt;&amp;quot;A  |  A&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
                       &lt;span class="p"&gt;\&lt;/span&gt;
                    &lt;span class="s2"&gt;&amp;quot;InHhL&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
                   &lt;span class="s2"&gt;&amp;quot;,Z,%w{-&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
                  &lt;span class="s2"&gt;&amp;quot;,Y&amp;amp;/LH,L*&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
                 &lt;span class="s2"&gt;&amp;quot;cCnd,Hh&amp;amp;/d,&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
                &lt;span class="s2"&gt;&amp;quot;YCB/Hh,Y&amp;amp;YHh,&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
               &lt;span class="s2"&gt;&amp;quot;L&amp;amp;xHh,L*v*nHh,*&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
              &lt;span class="s2"&gt;&amp;quot;&amp;amp;ghHh,n&amp;amp;nHh,H*nHh&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
             &lt;span class="s2"&gt;&amp;quot;,*q*v*nHh,Hw*qv*Hh}&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
            &lt;span class="s2"&gt;&amp;quot;Iq&amp;amp;n*L,Z,[,n&amp;amp;qK,n&amp;amp;qK,&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
           &lt;span class="s2"&gt;&amp;quot;@TwC,LH/&amp;amp;ng,gLBbL@K,@Th&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
          &lt;span class="s2"&gt;&amp;quot;/**,YC/k*d,Hh/*QdL@K,@FCB&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
         &lt;span class="s2"&gt;&amp;quot;/,cQqq&amp;amp;ng,=/CcL@K,@F&amp;amp;v*,RBb&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
        &lt;span class="s2"&gt;&amp;quot;y,g*mL!@K,@S&amp;amp;x,mQ/LhQqL,dBm=&amp;amp;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
       &lt;span class="s2"&gt;&amp;quot;ng@K,@S*v*n,dBckL,Q-Hy=&amp;amp;ng@K,@E&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
      &lt;span class="s2"&gt;&amp;quot;&amp;amp;ghH,d&amp;amp;/L,Q-gqCbb&amp;amp;ng@K,@N&amp;amp;n*,/Qng&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
     &lt;span class="s2"&gt;&amp;quot;*L,LH*==&amp;amp;ng@K,@T*n,H/yL,Q-cQHch&amp;amp;ng@&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
    &lt;span class="s2"&gt;&amp;quot;K,@Eq*v*n,&amp;amp;CL,=&amp;amp;=&amp;amp;ng@K,@Tw*qv*,mCnk*y&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
   &lt;span class="s2"&gt;&amp;quot;L,=QHch&amp;amp;ng@,]IDAJJA2)J*Qch,dC,U&amp;amp;UI=/&amp;amp;nH&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
  &lt;span class="s2"&gt;&amp;quot;,@&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;On,Hh*,&lt;/span&gt;&lt;span class="se"&gt;\#&lt;/span&gt;&lt;span class="s2"&gt;{nHhL[&amp;amp;]},dQy,CY,MQHzmQL,my,&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
 &lt;span class="s2"&gt;&amp;quot;H/B*,qCv*,gQv*,HC,m*:&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;@I&amp;amp;JdCwnHCD2),dC,UjU&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
&lt;span class="s2"&gt;&amp;quot;I=/&amp;amp;nH,@,,,&lt;/span&gt;&lt;span class="se"&gt;\#&lt;/span&gt;&lt;span class="s2"&gt;{q&amp;amp;n*L[j]}&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;@I*ndI=/&amp;amp;nHDD&amp;amp;,ZZ,A)&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
                    &lt;span class="s2"&gt;&amp;quot;?,@,,&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
                    &lt;span class="s2"&gt;&amp;quot;,G@,:&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
                    &lt;span class="s2"&gt;&amp;quot;,@,,,&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
                    &lt;span class="s2"&gt;&amp;quot;Gnd,Q&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
                    &lt;span class="s2"&gt;&amp;quot;@)I=/&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
      &lt;span class="s2"&gt;&amp;quot;&amp;amp;nH,@,n*w,v*/L&amp;amp;Cn,CY,RBby!&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;@I*nd&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;
       &lt;span class="s2"&gt;&amp;quot;I&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39; ID/VHLYGBqCA&amp;amp;|*UQJ=Z@K,&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="s1"&gt;&amp;#39;+;(r/tsfAulo1i8e|a.p=&amp;quot;, &amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;Thanks &lt;a href="http://pastie.org/344030"&gt;whoever you are&lt;/a&gt;.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>JavaScript flexes its muscles</title>
   <link href="http://jasonmadigan.com/2008/09/04/javascript-flexes-its-muscles" />
   <updated>2008-09-04T00:00:00+01:00</updated>
   <id>http://jasonmadigan.com/2008/09/04/javascript-flexes-its-muscles</id>
   <content type="html">&lt;p&gt;It&amp;#8217;s an exciting time for JavaScript developers. Over the past few months, we&amp;#8217;ve seen all sorts of cool things coming our way. We&amp;#8217;ve seen new fast, heavily optimised JavaScript virtual machines such as WebKit&amp;#8217;s&amp;quot;SquirrelFish&amp;quot;:http://webkit.org/blog/189/announcing-squirrelfish/, Mozilla&amp;#8217;s &lt;a href="https://wiki.mozilla.org/JavaScript:TraceMonkey"&gt;TraceMonkey&lt;/a&gt; and, most recently, Google&amp;#8217;s &lt;a href="http://code.google.com/p/v8/"&gt;V8&lt;/a&gt;. We&amp;#8217;ve seen all kinds of cool things done with these new VMs, perhaps the coolest (to my mind) is running dynamic languages such as Ruby in the browser &amp;#8211; see &lt;a href="http://macournoyer.wordpress.com/2008/09/02/ruby-on-v8/"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;We&amp;#8217;ve also seen the effective death of the ECMAScript 4 proposal and seen it reborn as ECMAScript Harmony. To top things off, we&amp;#8217;ve also seen some very interesting new JavaScript frameworks designed specifically with complex client-side web applications such as &lt;a href="http://www.sproutcore.com/"&gt;SproutCore&lt;/a&gt; and, just today, &lt;a href="http://cappuccino.org/"&gt;Cappccino &amp;amp; Objective-J&lt;/a&gt;. The web development world is evolving too quickly for the current model of standards adoption remain sustainable, and it&amp;#8217;s nice to see that developers like those behind Cappuccino get it.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Reinventing the wheel, just to see what all the fuss is about.</title>
   <link href="http://jasonmadigan.com/2008/05/24/reinventing-the-wheel-just-to-see-what-all-the-fuss-is-about" />
   <updated>2008-05-24T00:00:00+01:00</updated>
   <id>http://jasonmadigan.com/2008/05/24/reinventing-the-wheel-just-to-see-what-all-the-fuss-is-about</id>
   <content type="html">&lt;p&gt;I&amp;#8217;ve been amassing a small army of broken arduinos over the past two months, but now I have &lt;strong&gt;something&lt;/strong&gt; to show for it &amp;#8211; the bones of a working (but altogether bulky) &lt;span class="caps"&gt;GPS&lt;/span&gt; tracker. The code I used seems kind of nasty to me, mostly because the bit-banging used for serial communication to try to ensure no data is missed in transition. The Arduino &lt;span class="caps"&gt;IDE&lt;/span&gt; is okay I guess (for a Java app), but if you like Ruby you may want to check out &lt;a href="http://rad.rubyforge.org/"&gt;&lt;span class="caps"&gt;RAD&lt;/span&gt;&lt;/a&gt;. Looks like &lt;span class="caps"&gt;RAD&lt;/span&gt; only works with version 10 of the arduino &lt;span class="caps"&gt;SDK&lt;/span&gt; right now though.&lt;/p&gt;
&lt;p&gt;In terms of kit hooked up, we&amp;#8217;ve got an &lt;a href="http://www.sparkfun.com/commerce/product_info.php?products_id=465" title="GPS Module"&gt;EM-406A&lt;/a&gt; &amp;amp; an &lt;a href="http://www.arduino.cc/"&gt;Arduino Mini&lt;/a&gt; along with a &lt;span class="caps"&gt;USB&lt;/span&gt; to serial header. I need to buy a &lt;span class="caps"&gt;EEPROM&lt;/span&gt; for storage, or possibly some kind of microSD reader. Borrowing some code from &lt;a href="http://www.railsonwave.com/railsonwave/2007/7/4/gps-and-google-map-in"&gt;here&lt;/a&gt; we can parse &lt;span class="caps"&gt;NMEA&lt;/span&gt; to take a look at where you are with Google Maps.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="c"&gt;&lt;span class="cp"&gt;#define bit4800Delay 200 &lt;/span&gt;&lt;span class="c1"&gt;//1 bit per 0.2 ms&lt;/span&gt;
&lt;span class="cp"&gt;#define halfBit4800Delay 100 &lt;/span&gt;

&lt;span class="n"&gt;byte&lt;/span&gt; &lt;span class="n"&gt;rx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;//Connect to EM-406A&amp;#39;s TX&lt;/span&gt;
&lt;span class="n"&gt;byte&lt;/span&gt; &lt;span class="n"&gt;tx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;//Connect to EM-406A&amp;#39;s RX&lt;/span&gt;
&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;dataformat&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;$GPGGA&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;    &lt;span class="c1"&gt;//GGA&lt;/span&gt;
&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;messageline&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;latitude&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;longitude&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;setup&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;pinMode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;INPUT&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="n"&gt;pinMode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;OUTPUT&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="n"&gt;digitalWrite&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;HIGH&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// Needs to be pulled high before the EM-406A will return data&lt;/span&gt;
  &lt;span class="n"&gt;digitalWrite&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;HIGH&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// Debugging LED&lt;/span&gt;
  &lt;span class="n"&gt;Serial&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;begin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9600&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;     &lt;span class="c1"&gt;// Echo EM-406A output through serial&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="nf"&gt;SWread&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;byte&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c1"&gt;//Wait for start bit (0)&lt;/span&gt;
  &lt;span class="k"&gt;while&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;digitalRead&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;HIGH&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 

  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;digitalRead&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;LOW&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;delayMicroseconds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;halfBit4800Delay&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;offset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;offset&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;offset&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;delayMicroseconds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bit4800Delay&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="n"&gt;val&lt;/span&gt; &lt;span class="o"&gt;|=&lt;/span&gt; &lt;span class="n"&gt;digitalRead&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;offset&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="n"&gt;delayMicroseconds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bit4800Delay&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 

    &lt;span class="c1"&gt;// Bitbanging&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;128&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;128&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;char2string&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;messageline&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SWread&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;messageline&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;$&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;messageline&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SWread&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="k"&gt;while&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;messageline&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;13&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="n"&gt;messageline&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SWread&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="n"&gt;messageline&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;\0&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;loop&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;char2string&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;strncmp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;messageline&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dataformat&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Serial&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;messageline&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>iRot - iPhone development is fun</title>
   <link href="http://jasonmadigan.com/2008/02/18/irot-iphone-development-is-fun" />
   <updated>2008-02-18T00:00:00+00:00</updated>
   <id>http://jasonmadigan.com/2008/02/18/irot-iphone-development-is-fun</id>
   <content type="html">&lt;p&gt;Over the weekend I decided to try my hand at a little iPhone development. My Objective-C skill is non-existant, and my C skill is incredibly rusty &amp;#8211; but I pressed on. First up was installation of the toolchain required to compile native applications. This one was tough, very tough. After much swearing and shouting, I finally managed to get it to install. The iPhone dev team&amp;#8217;s official instructions were of help right up until&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sed ‘s/^FLAGS_FOR_TARGET=$/FLAGS_FOR_TARGET=${FLAGS_FOR_TARGET-}/g’ \&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This is where things seemed to go horribly wrong for me and others. After scouring google for solutions for what seemed like hours, I finally happened up on &lt;a href="http://www.kdbdallas.com/index.php/2007/11/16/help-with-building-the-iphone-leopard-toolchain/"&gt;this&lt;/a&gt; little golden nugget. With the toolchain finally installed I cracked open my copy of Stephen Kochan&amp;#8217;s &lt;a href="http://www.amazon.com/Programming-Objective-C-Developers-Library-Stephen/dp/0672325861"&gt;Programming in Objective-C&lt;/a&gt; along with &lt;a href="http://www.oreilly.com/catalog/9780596519513/?CMP=ILC-Home3&amp;amp;ATT=9780596519513"&gt;iPhone Open Application Development&lt;/a&gt; &amp;#8211; a book by &lt;span class="caps"&gt;NES&lt;/span&gt;.app&amp;#8217;s developer which I really can&amp;#8217;t recommend at the moment.&lt;/p&gt;
&lt;p&gt;I decided to write a useless little ROT13 app which you can grab by adding &lt;code&gt;http://www.jasonmadigan.com/repo.xml&lt;/code&gt; to your installer.app&amp;#8217;s repository list. I&amp;#8217;ll release the source tomorrow after a quick cleanup.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>An end to a frickin' retarded restore path</title>
   <link href="http://jasonmadigan.com/2008/02/12/an-end-to-a-frickin-retarded-restore-path" />
   <updated>2008-02-12T00:00:00+00:00</updated>
   <id>http://jasonmadigan.com/2008/02/12/an-end-to-a-frickin-retarded-restore-path</id>
   <content type="html">&lt;p&gt;Finally. Restoring an iPhone is no longer quite so painful. No more jumping through hoops downgrading to 1.1.1 and slowly clawing your way back up to 1.1.3 with all manner of retarded soft updates. Thanks to Zibree&amp;#8217;s &lt;a href="http://zibree.blogspot.com/2008/02/ziphone-updated.html"&gt;ZiPhone&lt;/a&gt;, you no longer need to beg and plead with your iPhone to play along with you for two hours to get your iPhone back in working order. Unlocking, activating &amp;amp; jailbreaking any iPhone is now incredibly simple and fast.&lt;/p&gt;
&lt;p&gt;Somebody really had to do this &amp;#8211; when 1.1.4 lands (and it will soon), restoring an iPhone would have previously meant no less than 4 jailbreak hoops to jump through.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Software Unlock for OOTB 1.1.2 &amp; 1.1.3 iPhones</title>
   <link href="http://jasonmadigan.com/2008/02/08/software-unlock-for-ootb-1-1-2-and-1-1-3-iphones" />
   <updated>2008-02-08T00:00:00+00:00</updated>
   <id>http://jasonmadigan.com/2008/02/08/software-unlock-for-ootb-1-1-2-and-1-1-3-iphones</id>
   <content type="html">&lt;p&gt;Mister George Hotz has come through for us once again, with a &lt;a href="http://iphonejtag.blogspot.com/2008/02/11246unlock-good-enough-for-prize.html"&gt;software based unlock&lt;/a&gt; for out of the box 1.1.2 &amp;amp; 1.1.3 iPhones. Now would be a good time to buy one. It uses a delightful &lt;span class="caps"&gt;IPSF&lt;/span&gt; based method but this one doesn&amp;#8217;t zero out your seczones. So should Apple lose their minds in the future and include a bootloader update in a future software release you won&amp;#8217;t end up with a complete brick.&lt;/p&gt;
&lt;p&gt;Hot on it&amp;#8217;s heals was a brief update regarding retarded dev-team/elite team babby drama. It seems Zibri got tired of the two dev teams&amp;#8217; shenanigans once more and decided to jump the gun and &lt;a href="http://code.google.com/p/iphone-elite/wiki/JerrySim"&gt;release&lt;/a&gt; the method used by an upcoming semi-hardware unlock (an exploit piggybacking on a Turbo &lt;span class="caps"&gt;SIM&lt;/span&gt;, once run there&amp;#8217;s no need for the Turbo &lt;span class="caps"&gt;SIM&lt;/span&gt; anymore), the details of which have been known by the dev-team for several weeks now.&lt;/p&gt;
&lt;p&gt;Interesting times. Of course this means I&amp;#8217;m going to be bombarded with a stream of requests for unlocking &amp;#8211; all of which I&amp;#8217;m going to politely decline. The iPhone is great and all, but eventually you come to realise that, with every new firmware release, the time it&amp;#8217;ll take you to restore should something terrible happen is going to increase considerably. I don&amp;#8217;t know about you guys, but as soon as an official release is confirmed for here with 3G, I&amp;#8217;m jumping ship. It&amp;#8217;s just too tiring.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>1.1.3 - IPSF Keep's On Truckin'</title>
   <link href="http://jasonmadigan.com/2008/01/25/1-1-3-ipsf-keeps-on-truckin" />
   <updated>2008-01-25T00:00:00+00:00</updated>
   <id>http://jasonmadigan.com/2008/01/25/1-1-3-ipsf-keeps-on-truckin</id>
   <content type="html">&lt;p&gt;Like I thought, IphoneSimFree&amp;#8217;s unlock continues to work with recent iPhone updates. Taking the baseband out of lockdown requires a little minicom pockery until we see a patched lockdownd &amp;#8211; I&amp;#8217;ll look into patching it this weekend.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Lightweight, fast Rails stack - Thin &amp; nginx</title>
   <link href="http://jasonmadigan.com/2008/01/24/lightweight-fast-rails-stack-thin-and-nginx" />
   <updated>2008-01-24T00:00:00+00:00</updated>
   <id>http://jasonmadigan.com/2008/01/24/lightweight-fast-rails-stack-thin-and-nginx</id>
   <content type="html">&lt;p&gt;Since purchasing a &lt;a href="http://www.slicehost.com" title="http://www.slicehost.com"&gt;slice of heaven&lt;/a&gt; a few days ago, I&amp;#8217;ve setup a very lightweight Rails stack consisting of &lt;a href="http://code.macournoyer.com/thin/" title="http://code.macournoyer.com/thin/"&gt;Thin&lt;/a&gt; &amp;amp; &lt;a href="http://nginx.net/" title="http://nginx.net/"&gt;nginx&lt;/a&gt; for my Rails needs. Since I went for a slice with just 256MB of &lt;span class="caps"&gt;RAM&lt;/span&gt;, memory consumption becomes a pretty serious issue. nginx has been around for quite a while now, and has recently started to become more and more popular in Rails deployments due to the fact that&amp;#8217;s incredibly lightweight, very fast and stable &amp;#8211; perfect not only for &lt;span class="caps"&gt;VPS&lt;/span&gt; jerks like me, but for anyone who really doesn&amp;#8217;t feel it&amp;#8217;s necessary to run Apache for static content/cluster proxying/load balancing. Thin is something I came across very recently and I decided to try is as a replacement for mongrel since I&amp;#8217;d heard some great things about it, even if it is still alpha. It&amp;#8217;s performance in comparison to mongrel (even with a tacked on event machine) looks very impressive on paper.&lt;/p&gt;
&lt;p&gt;Setting up clustering with it is a snap, just spawn the processes and pipe them into nginx. Here&amp;#8217;s a startup script borrowed from &lt;a href="http://groups.google.com/group/thin-ruby/msg/7775cc00e316b25a" title="http://groups.google.com/group/thin-ruby/msg/7775cc00e316b25a"&gt;Stephen Celis&lt;/a&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="n"&gt;namespace&lt;/span&gt; &lt;span class="ss"&gt;:thin&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="n"&gt;namespace&lt;/span&gt; &lt;span class="ss"&gt;:cluster&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;    &lt;span class="n"&gt;desc&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;Start thin cluster&amp;#39;&lt;/span&gt;
    &lt;span class="n"&gt;task&lt;/span&gt; &lt;span class="ss"&gt;:start&lt;/span&gt; &lt;span class="o"&gt;=&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="ss"&gt;:environment&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
      &lt;span class="sb"&gt;`cd &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="no"&gt;RAILS_ROOT&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;
      &lt;span class="n"&gt;port_range&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;RAILS_ENV&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;development&amp;#39;&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;
      &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;ENV&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;SIZE&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="no"&gt;ENV&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;SIZE&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;].&lt;/span&gt;&lt;span class="n"&gt;to_i&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;times&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
        &lt;span class="no"&gt;Thread&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
          &lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;ENV&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;PORT&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="no"&gt;ENV&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;PORT&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;].&lt;/span&gt;&lt;span class="n"&gt;to_i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;port_range&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;%03d&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
          &lt;span class="n"&gt;str&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;thin start -d -p&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; -Ptmp/pids/thin-&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;.pid&amp;quot;&lt;/span&gt;
          &lt;span class="n"&gt;str&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot; -e&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="no"&gt;RAILS_ENV&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;
          &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;str&lt;/span&gt;
          &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Starting server on port &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;...&amp;quot;&lt;/span&gt;
          &lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;
        &lt;span class="k"&gt;end&lt;/span&gt;
      &lt;span class="k"&gt;end&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
    &lt;span class="n"&gt;desc&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;Stop all thin clusters&amp;#39;&lt;/span&gt;
    &lt;span class="n"&gt;task&lt;/span&gt; &lt;span class="ss"&gt;:stop&lt;/span&gt; &lt;span class="o"&gt;=&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="ss"&gt;:environment&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
      &lt;span class="sb"&gt;`cd &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="no"&gt;RAILS_ROOT&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;
      &lt;span class="no"&gt;Dir&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="no"&gt;RAILS_ROOT&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/tmp/pids&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;each&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
        &lt;span class="no"&gt;Thread&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
          &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;starts_with?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;thin-&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;str&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;thin stop -Ptmp/pids/&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;
            &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Stopping server on port &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="o"&gt;[/&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="o"&gt;+/]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;...&amp;quot;&lt;/span&gt;
            &lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;
          &lt;span class="k"&gt;end&lt;/span&gt;
        &lt;span class="k"&gt;end&lt;/span&gt;
      &lt;span class="k"&gt;end&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;Then spawn however many processes you want using something like:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;rake thin:cluster:start &lt;span class="nv"&gt;RAILS_ENV&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;production &lt;span class="nv"&gt;SIZE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2 &lt;span class="nv"&gt;PORT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;3000
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;To stop them, use:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;rake thin:cluster:stop
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;With that all nicely setup, you can use an nginx config similar to mine to get things in order:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="nginx"&gt;&lt;span class="k"&gt;upstream&lt;/span&gt; &lt;span class="s"&gt;dapperjerk&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kn"&gt;server&lt;/span&gt; &lt;span class="n"&gt;127.0.0.1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kn"&gt;server&lt;/span&gt; &lt;span class="n"&gt;127.0.0.1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;3001&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kn"&gt;listen&lt;/span&gt;   &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kn"&gt;server_name&lt;/span&gt;  &lt;span class="s"&gt;www.dapperjerk.com&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kn"&gt;rewrite&lt;/span&gt; &lt;span class="s"&gt;^/(.*)&lt;/span&gt; &lt;span class="s"&gt;http://dapperjerk.com&lt;/span&gt; &lt;span class="s"&gt;permanent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kn"&gt;listen&lt;/span&gt;   &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kn"&gt;server_name&lt;/span&gt; &lt;span class="s"&gt;dapperjerk.com&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kn"&gt;access_log&lt;/span&gt; &lt;span class="s"&gt;/home/jason/public_html/blog/log/access.log&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kn"&gt;error_log&lt;/span&gt; &lt;span class="s"&gt;/home/jason/public_html/blog/log/error.log&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kn"&gt;root&lt;/span&gt;   &lt;span class="s"&gt;/home/jason/public_html/blog/public/&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kn"&gt;index&lt;/span&gt;  &lt;span class="s"&gt;index.html&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kn"&gt;location&lt;/span&gt; &lt;span class="s"&gt;/&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt;  &lt;span class="s"&gt;X-Real-IP&lt;/span&gt;  &lt;span class="nv"&gt;$remote_addr&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt;  &lt;span class="s"&gt;X-Forwarded-For&lt;/span&gt; &lt;span class="nv"&gt;$proxy_add_x_forwarded_for&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;Host&lt;/span&gt; &lt;span class="nv"&gt;$http_host&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;proxy_redirect&lt;/span&gt; &lt;span class="s"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kn"&gt;if&lt;/span&gt; &lt;span class="s"&gt;(-f&lt;/span&gt; &lt;span class="nv"&gt;$request_filename/index.html&lt;/span&gt;&lt;span class="s"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kn"&gt;rewrite&lt;/span&gt; &lt;span class="s"&gt;(.*)&lt;/span&gt; &lt;span class="nv"&gt;$1/index.html&lt;/span&gt; &lt;span class="s"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="kn"&gt;if&lt;/span&gt; &lt;span class="s"&gt;(-f&lt;/span&gt; &lt;span class="nv"&gt;$request_filename.html&lt;/span&gt;&lt;span class="s"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kn"&gt;rewrite&lt;/span&gt; &lt;span class="s"&gt;(.*)&lt;/span&gt; &lt;span class="nv"&gt;$1.html&lt;/span&gt; &lt;span class="s"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="kn"&gt;if&lt;/span&gt; &lt;span class="s"&gt;(!-f&lt;/span&gt; &lt;span class="nv"&gt;$request_filename&lt;/span&gt;&lt;span class="s"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kn"&gt;proxy_pass&lt;/span&gt; &lt;span class="s"&gt;http://dapperjerk&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kn"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;And that&amp;#8217;s really all there is too it. I&amp;#8217;m not a masochist so I&amp;#8217;ve never bothered to fully read Apache&amp;#8217;s documentation, but I don&amp;#8217;t think I&amp;#8217;m going out on a limb here by saying that it seems to be a lot easier to manage nginx. I haven&amp;#8217;t really put thin through its paces yet, but we&amp;#8217;ll see in the coming weeks as I cobble together a custom blog app to run this place.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>1.1.2 OTB Unlocked (Hardware)</title>
   <link href="http://jasonmadigan.com/2008/01/18/1-1-2-otb-unlocked-hardware" />
   <updated>2008-01-18T00:00:00+00:00</updated>
   <id>http://jasonmadigan.com/2008/01/18/1-1-2-otb-unlocked-hardware</id>
   <content type="html">&lt;p&gt;Some semi-good news for poor sods with 1.1.2 out of the box iPhones reached my eyes &amp;amp; ears this morning &amp;#8211; 1.1.2 iPhones with the v4.6 bootloader can now have their bootloader downgraded to 3.9 and then unlocked. Unfortunately this remains a hardware testpoint method for the time being. If you&amp;#8217;re brave and fearless you can follow geohot&amp;#8217;s guide to doing this &lt;a href="http://iphonejtag.blogspot.com/2008/01/112-otb-unlocked.html"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;A 1.1.3 jailbreak still seems to be a ways off, with the good old symbolic link method seemingly neutered.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Dearest NVIDIA,</title>
   <link href="http://jasonmadigan.com/2008/01/04/dearest-nvidia" />
   <updated>2008-01-04T00:00:00+00:00</updated>
   <id>http://jasonmadigan.com/2008/01/04/dearest-nvidia</id>
   <content type="html">&lt;p&gt;Please please please fire whoever is in charge of naming conventions. I present to you, dear readers, the 8800 series in order of performance:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;8800 GS 384MB&lt;/li&gt;
	&lt;li&gt;8800 GS 768MB&lt;/li&gt;
	&lt;li&gt;8800 &lt;span class="caps"&gt;GTS&lt;/span&gt; 320MB&lt;/li&gt;
	&lt;li&gt;8800 &lt;span class="caps"&gt;GTS&lt;/span&gt; 640MB&lt;/li&gt;
	&lt;li&gt;8800 GT 256MB&lt;/li&gt;
	&lt;li&gt;8800 GT 512MB&lt;/li&gt;
	&lt;li&gt;8800 &lt;span class="caps"&gt;GTS&lt;/span&gt; 512MB&lt;/li&gt;
	&lt;li&gt;8800 &lt;span class="caps"&gt;GTX&lt;/span&gt; 768MB&lt;/li&gt;
	&lt;li&gt;8800 &lt;span class="caps"&gt;ULTRA&lt;/span&gt; 768MB&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Remember the old days when explaining what graphics card you had went something like this?&lt;/p&gt;
&lt;p&gt;&amp;#8220;So yeah, what kind of graphics card do you have?&amp;#8221;&lt;/p&gt;
&lt;p&gt;&amp;#8220;Voodoo 2&amp;#8221;&lt;/p&gt;
&lt;p&gt;&amp;#8220;Cool, 8MB or 12MB?&amp;#8221;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>ROT13 in Ruby</title>
   <link href="http://jasonmadigan.com/2007/12/19/rot13-in-ruby" />
   <updated>2007-12-19T00:00:00+00:00</updated>
   <id>http://jasonmadigan.com/2007/12/19/rot13-in-ruby</id>
   <content type="html">&lt;p&gt;Ruby&amp;#8217;s string lib is pretty cool ok:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="s2"&gt;&amp;quot;babby&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;A-Ma-mN-Zn-z&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;N-Zn-zA-Ma-m&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;onool&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>iPhone bootloader changes</title>
   <link href="http://jasonmadigan.com/2007/11/19/iphone-bootloader-changes" />
   <updated>2007-11-19T00:00:00+00:00</updated>
   <id>http://jasonmadigan.com/2007/11/19/iphone-bootloader-changes</id>
   <content type="html">&lt;p&gt;For anyone thinking of purchasing an iPhone in the near future, be aware that Apple is now shipping iPhones with an updated bootloader (4.6_M3S2) which has seen the a number of unlocking avenues closed.&lt;/p&gt;
&lt;p&gt;All iPhone&amp;#8217;s shipped after week 45 are very likely to have 1.1.2 pre-installed with this new bootloader &amp;#8211; you can check to see the week of manufacture by looking at the devices serial number (e.g.xxx45xxxxxx means it was manufactured during week 45) or by issuing the following command within a shell:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;-sh-3.2# ./bbupdater -v
Resetting target...
pinging the baseband...
issuing +xgendata...
firmware: DEV_ICE_MODEM_04.02.13_G
eep version: EEP_VERSION:208
eep revision: EEP_REVISION:1
bootloader: BOOTLOADER_VERSION:4.6_M3S2
Done
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;Thankfully (obviously) Apple has not seen fit to include a bootloader update with their firmware releases, so iphonesimfree users with their zero&amp;#8217;d seczones should be okay for the foreseeable future. Updating the bootloader would create all kinds of headaches for all end users &amp;#8211; upgrading a bootloader is always a risky proposition.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Building &amp; installing your own OSx86 Leopard</title>
   <link href="http://jasonmadigan.com/2007/11/04/building-and-installing-your-own-osx86-leopard" />
   <updated>2007-11-04T00:00:00+00:00</updated>
   <id>http://jasonmadigan.com/2007/11/04/building-and-installing-your-own-osx86-leopard</id>
   <content type="html">&lt;p&gt;Over the past week I became curious as to how difficult it would be to develop my own Leopard &lt;span class="caps"&gt;DVD&lt;/span&gt; to install on a regular PC which has been gathering dust for the past few months, so I decided to give it a shot. I did it mostly out of curiosity, since I already own an iMac and a MacBook Pro &amp;#8211; both with Leopard installed using a family pack (thus I had three licenses to spare). It wasn&amp;#8217;t really all that difficult to put together, but your mileage will vary pretty wildly depending on the kind of hardware you&amp;#8217;re using. I should probably start this out with an obnoxious disclaimer:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Installing Mac OS X onto hardware not manufactured by Apple is a violation of the software&amp;#8217;s &lt;span class="caps"&gt;EULA&lt;/span&gt;:&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Permitted License Uses and Restrictions.&lt;br /&gt;
A. This License allows you to install and use one copy of the Apple Software on a single Apple-labeled computer at a time. This License does not allow the Apple Software to exist on more than one computer at a time,and you may not make the Apple Software available over a network where it could be used by multiple computers at the same time. You may make one copy of the Apple Software (excluding the Boot &lt;span class="caps"&gt;ROM&lt;/span&gt; code) in machine-readable form for backup purposes only; provided that the backup copy must include all copyright or other proprietary notices contained on the original.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Violating a &lt;span class="caps"&gt;EULA&lt;/span&gt; is not illegal in most countries. Installing a copy of Mac OS X which you have not purchased most definitely &lt;strong&gt;is&lt;/strong&gt; illegal in most countries.&lt;/p&gt;
&lt;p&gt;Most of this guide is made using information supplied from all manner of places, &lt;a href="http://forum.osx86scene.com/viewtopic.php?f=16&amp;amp;t=2008"&gt;this thread&lt;/a&gt; on the OSx86 Scene forums in particular. Why not just use the guide there you ask? Well, there are some things which are not explained very well and one or two things which are slightly inaccurate so hopefully this should be easier to follow. The files/shell scripts provided by BrazilMAC work great and form the basis for the scripts supplied with this guide. It should be noted that these files and shell scripts are largely taken from a Leopard patch which was leaked some months ago for earlier Leopard builds. I make no claim for having created these shell scripts, I&amp;#8217;ve just made some minor changes and included some files necessary for making the drive bootable way easier. These files also originally came with assembler source to decrypt Leopard&amp;#8217;s encrypted kernel &amp;#8211; this can be found if you look hard enough (but is not required for what we&amp;#8217;re doing here). With that out of the way and my shrink-wrapped copy of Leopard in hand, lets start.&lt;/p&gt;
&lt;p&gt;Note: this entire guide assumes you have a Mac OS X installation available to you prior to actually installing Leopard on a regular home PC.&lt;/p&gt;
&lt;p&gt;The files you&amp;#8217;ll need &amp;#8211; &lt;a href="http://rapidshare.com/files/67346070/patch.zip"&gt;patch.zip&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;1. Preparing a disc image&lt;/h2&gt;
&lt;ul&gt;
	&lt;li&gt;Before we begin, we need to create a disc image of our original Leopard &lt;span class="caps"&gt;DVD&lt;/span&gt;. The Leopard &lt;span class="caps"&gt;DVD&lt;/span&gt; is a dual-layer &lt;span class="caps"&gt;DVD&lt;/span&gt; and since dual-layer media is still hideously expensive, we&amp;#8217;re going to do some fiddling to reduce the size of our installer &lt;span class="caps"&gt;DVD&lt;/span&gt; down to 4.7GB so it will fit on a single layer &lt;span class="caps"&gt;DVD&lt;/span&gt;. Creating a disc image is really easy.&lt;/li&gt;
	&lt;li&gt;Open up &lt;code&gt;Disk Utility&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;Select &lt;code&gt;Mac OS X Install Disc&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;Click the &lt;code&gt;New Image&lt;/code&gt; button, leave the settings as they are, and save this disc image to your Desktop&lt;/li&gt;
	&lt;li&gt;This will take a little bit of time, so go grab a coffee while it&amp;#8217;s doing its thing.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;2. Patching our disc image&lt;/h2&gt;
&lt;ul&gt;
	&lt;li&gt;Right, we now have a disc image. Put this image on your Desktop if it isn&amp;#8217;t there already.&lt;/li&gt;
	&lt;li&gt;Place the contents &amp;#8220;patch&amp;#8221; (3 folders, 2 files)  directory in the zip you downloaded earlier onto your Desktop&lt;/li&gt;
	&lt;li&gt;Time for a little shell script editing. Open patch.sh in a text editor of your choice.&lt;br /&gt;
&lt;code&gt;APDIR=/Users/YOUR_USERNAME/Desktop&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;DMG="/Users/YOUR_USERNAME/Desktop/YOUR_DISC_IMAGE.dmg"&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;Change YOUR_USERNAME to your account username under the Mac OS X install you&amp;#8217;re currently in and change YOUR_DISC_IMAGE.dmg to the filename of your newly created Leopard image.&lt;/li&gt;
	&lt;li&gt;We&amp;#8217;re now ready to patch our disc image. Open up a terminal window.&lt;/li&gt;
	&lt;li&gt;Run &lt;code&gt;cd Desktop&lt;/code&gt; (you did remember to place the contents of the patch folder from the zip on your Desktop, right?)&lt;/li&gt;
	&lt;li&gt;Run &lt;code&gt;sudo ./patch.sh&lt;/code&gt;and enter your password.&lt;/li&gt;
	&lt;li&gt;This will take a while, the shell script is going to first of all copy the contents of the &lt;span class="caps"&gt;DMG&lt;/span&gt; to an editable image for us, then it&amp;#8217;ll remove unnecessary stuff to squeeze our &lt;span class="caps"&gt;DVD&lt;/span&gt; down to 4.7GB. It will also replace some kernel extensions as well as the installer DVD&amp;#8217;s kernel itself. It&amp;#8217;s worth noting that the kernel and kernel extensions the script is replacing are the ones used by the installer &lt;span class="caps"&gt;DVD&lt;/span&gt; itself to boot into its installation environment. The kernel extensions and kernel which is actually installed by the installer to your HD are unpatched &amp;#8211; hence why we&amp;#8217;ll need to do a little fiddling prior to our first boot after installation.&lt;/li&gt;
	&lt;li&gt;You may see some binding error messages regarding frameworks, but this is normal.&lt;/li&gt;
	&lt;li&gt;After patching, we&amp;#8217;re left with a nice 4.7GB &lt;span class="caps"&gt;DVD&lt;/span&gt; image (Leo_Patched_DVD.iso &amp;#8211; should be 4,698,669,056 bytes but if it&amp;#8217;s a little out relax, it&amp;#8217;s probably fine) which we can fit onto a regular &lt;span class="caps"&gt;DVD&lt;/span&gt;.&lt;/li&gt;
	&lt;li&gt;Burn this image to &lt;span class="caps"&gt;DVD&lt;/span&gt; and grab another a coffee.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;3. Installing Leopard&lt;/h2&gt;
&lt;ul&gt;
	&lt;li&gt;Pop your &lt;span class="caps"&gt;DVD&lt;/span&gt; into your regular PC and boot using it &amp;#8211; either change your boot device priority to place a CD-&lt;span class="caps"&gt;ROM&lt;/span&gt;/&lt;span class="caps"&gt;DVD&lt;/span&gt;-&lt;span class="caps"&gt;ROM&lt;/span&gt; prior to any hard drives or (usually) hit &lt;code&gt;F12&lt;/code&gt; to get a boot menu in which you can select a device to boot using.&lt;/li&gt;
	&lt;li&gt;When you see the Darwin bootloader, it will ask you to either press any key to begin installation or to press &lt;code&gt;F8&lt;/code&gt; to enter startup options. You&amp;#8217;re probably going to want to become familiar with verbose boot mode for troubleshooting later so why not start now. Hit &lt;code&gt;F8&lt;/code&gt; and type &lt;code&gt;-v&lt;/code&gt;and press return. This will boot OS X in verbose mode so we can see what&amp;#8217;s happening.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;All going well, the installer should eventually land us at a language selection screen in a few minutes. Once in the installer we need to setup the hard drive we&amp;#8217;re going to install OS X onto. For simplicity&amp;#8217;s sake I&amp;#8217;m going to assume you&amp;#8217;ve got an entire disk to dedicate to installing OS X upon. Go into the disk utilty and select the disk you wish to install OS X onto. Go to the partition tab and using the drop down menu select &amp;#8220;1 Partition&amp;#8221; and use a Macintosh Journaled filesystem (HFS+). Give your partition a name (and take note of it, we&amp;#8217;ll use this later). Now, there&amp;#8217;s something which is really important to do here so please don&amp;#8217;t skip this. You wouldn&amp;#8217;t believe the amount of people who miss this step and then wonder why in the hell they can&amp;#8217;t boot OS X after installation. Click @Options@and select Master Boot Record since regular PC&amp;#8217;s use a &lt;span class="caps"&gt;BIOS&lt;/span&gt; instead of &lt;span class="caps"&gt;EFI&lt;/span&gt; and so can&amp;#8217;t boot using a &lt;span class="caps"&gt;GUID&lt;/span&gt; disk. Click partition and then close the disk utility.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;Within the installer wizard, on the screen with the &amp;#8220;customize&amp;#8221; button, click it and de-select everything you can (you won&amp;#8217;t be able to de-select the base system of course). Failing to do this will cause the installer to fail since we removed a lot of stuff when we patched our &lt;span class="caps"&gt;DVD&lt;/span&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;Install OS X and grab several coffees.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;4. Leopard post patching&lt;/h2&gt;
&lt;ul&gt;
	&lt;li&gt;Leopard is now (hopefully) installed, but before we can actually boot into it we need to do some post patching (replacing the kernel and some kernel extensions). We also need to flag our partition as bootable and install the Darwin bootloader. There&amp;#8217;s a few ways of doing this including booting into a prior OSx86 installation of Tiger but I&amp;#8217;m going to assume that such an installation isn&amp;#8217;t available to you. So to do all of this we&amp;#8217;re going to copy the files we need to a portable &lt;span class="caps"&gt;USB&lt;/span&gt; hard drive or thumb drive, whichever is available to you.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;Extract the contents of the &amp;#8220;patch&amp;#8221; (3 folders, 2 files) folder within the zip you downloaded earlier into the root directory of your &lt;span class="caps"&gt;USB&lt;/span&gt; drive.&lt;/li&gt;
	&lt;li&gt;Time for more shell script editing. Open postpatch.sh in a text editor of your choice.&lt;br /&gt;
&lt;code&gt;PATCH="/Volumes/YOUR_USB_VOLUME_NAME/leopatch/"&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;LEO="/Volumes/Leopard"&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;Take note of the volume name for your &lt;span class="caps"&gt;USB&lt;/span&gt; drive and place it where YOUR_USB_VOLUME_NAME appears.&lt;/li&gt;
	&lt;li&gt;Remember when you took note of the volume name you installed Leopard onto earlier? Change &lt;code&gt;/Volumes/Leopard&lt;/code&gt; to reflect the name of the volume where you installed Leopard to.&lt;/li&gt;
	&lt;li&gt;Boot into your Leopard installer once more. Plug your &lt;span class="caps"&gt;USB&lt;/span&gt; drive in at any time.&lt;/li&gt;
	&lt;li&gt;While in the installer, open up a terminal.&lt;/li&gt;
	&lt;li&gt;Run cd /Volumes/YOUR_USB_VOLUME_NAME&lt;/li&gt;
	&lt;li&gt;Run ./postpatch.sh&lt;/li&gt;
	&lt;li&gt;This should execute pretty quickly and may throw some errors regarding unfound kexts but that&amp;#8217;s usually okay.&lt;/li&gt;
	&lt;li&gt;Assuming all went well you should now have a good Leopard install, now all we need to do is make it bootable.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;5. Making it bootable&lt;/h2&gt;
&lt;ul&gt;
	&lt;li&gt;This bit is/was annoying as hell and pretty much every guide out there was either completely wrong or was worded incorrectly, so this is my own explanation of how to do it.&lt;/li&gt;
	&lt;li&gt;Open a terminal within the installer &lt;span class="caps"&gt;DVD&lt;/span&gt; once more&lt;/li&gt;
	&lt;li&gt;Run &lt;em&gt;diskutil list&lt;/em&gt;&lt;/li&gt;
	&lt;li&gt;You&amp;#8217;ll see a list of things like this:&lt;/li&gt;
&lt;/ul&gt;
&lt;table&gt;
	&lt;tr&gt;
		&lt;th&gt;/dev/disk0 #: &lt;/th&gt;
		&lt;th&gt;&lt;span class="caps"&gt;TYPE&lt;/span&gt; &lt;/th&gt;
		&lt;th&gt;&lt;span class="caps"&gt;NAME&lt;/span&gt; &lt;/th&gt;
		&lt;th&gt;&lt;span class="caps"&gt;SIZE&lt;/span&gt; &lt;/th&gt;
		&lt;th&gt;&lt;span class="caps"&gt;IDENTIFIER&lt;/span&gt; &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt; 0: &lt;/td&gt;
		&lt;td&gt; FDisk_partition_scheme &lt;/td&gt;
		&lt;td&gt; &lt;/td&gt;
		&lt;td&gt; *69.2 Gi &lt;/td&gt;
		&lt;td&gt; disk0 &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt; 1: &lt;/td&gt;
		&lt;td&gt; Apple_HFS &lt;/td&gt;
		&lt;td&gt; Macintosh HD &lt;/td&gt;
		&lt;td&gt; 69.2 Gi &lt;/td&gt;
		&lt;td&gt; disk0s1 &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;ul&gt;
	&lt;li&gt;Take note of /dev/disk&lt;strong&gt;0&lt;/strong&gt;- the 0 is our disk number. Also take note of the # of the partition corresponding to where we installed Leopard, in this case &lt;strong&gt;1&lt;/strong&gt;. With this in mind we know we can access our Leopard partition, in this case, through /dev/disk&lt;strong&gt;0&lt;/strong&gt;s&lt;strong&gt;1 &lt;/strong&gt;- disk 0, partition 1.&lt;/li&gt;
	&lt;li&gt;Unmount your Leopard partition before you do anything else &amp;#8211; either by going into disk utility and pressing the unmount button or by running &lt;code&gt;diskutil unmount /dev/diskXsx&lt;/code&gt; replacing diskXsx with the disk and partition number where Leopard is installed.&lt;/li&gt;
	&lt;li&gt;Run &lt;code&gt;fdisk -e /dev/rdiskX&lt;/code&gt; where X is our disk number&lt;/li&gt;
	&lt;li&gt;Run &lt;code&gt;update&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;Run &lt;code&gt;flag 1&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;Run &lt;code&gt;w&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;Run @ q@&lt;/li&gt;
	&lt;li&gt;Right, that should see our partition active. Now to install the darwin bootloader.&lt;/li&gt;
	&lt;li&gt;Use &lt;code&gt;cd @to move into the @makebootable&lt;/code&gt;folder in our &lt;span class="caps"&gt;USB&lt;/span&gt; drive, e.g. &lt;code&gt;cd /Volume/MyUSBDrive/makebootable"&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;Lets put the bootloader, &lt;strong&gt;boot1h&lt;/strong&gt; at the start of our partition&lt;/li&gt;
	&lt;li&gt;Run &lt;code&gt;dd if=boot1h of=/dev/rdiskXsx bs=512 count=1&lt;/code&gt; with &lt;code&gt;rdiskXsx&lt;/code&gt; being replaced with the disk and partition number where Leopard is installed.&lt;/li&gt;
	&lt;li&gt;Enable the bootloader using startupfiletool&lt;/li&gt;
	&lt;li&gt;Run &lt;code&gt;./startupfiletool -v /dev/rdiskXsx boot&lt;/code&gt; again, replacing &lt;code&gt;rdiskXsx&lt;/code&gt; with where Leopard is installed&lt;/li&gt;
	&lt;li&gt;Now, lets bless the drive: &lt;code&gt;./bless24 -device /dev/diskXsx -setBoot -verbose&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;Almost there! Mount the drive: &lt;code&gt;diskutil mount /dev/diskXsx&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;Finally, bless the mount: &lt;code&gt;./bless24 -mount /Volumes/YOUR_VOLUME_NAME -setBoot -verbose&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;Congratulations if you made it this far, we should now be good to go. Reboot your machine and it should (hopefully) boot into Leopard.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;6. In closing&lt;/h2&gt;
&lt;p&gt;If everything works right away, fantastic! If not, there&amp;#8217;s plenty of help at hand from the helpful folk at the OSx86 Scene Forums. Please please &lt;strong&gt;please&lt;/strong&gt; don&amp;#8217;t ask me to troubleshoot any problems you come across &amp;#8211; there&amp;#8217;s way too much that can go wrong with a regular OSx86 installation for me to know how to fix everything. Use the OSx86 forum&amp;#8217;s search feature or chat to some of the people from there on &lt;span class="caps"&gt;IRC&lt;/span&gt;. If you spot something wrong in the guide, please let me know. I wrote in parts so I may have left something out or made a mistake or two here and there.&lt;/p&gt;
&lt;p&gt;Hopefully after installing Leopard and having used it for a time you&amp;#8217;ll do the right (and sane) thing and just buy a Mac. It&amp;#8217;s easier and you won&amp;#8217;t have to rely on a bunch of third party hackers to cobble together support. That said, it is an interesting thing to do and in doing so you will learn tons about Mac OS X&amp;#8217;s innards &amp;#8211; this alone was reason enough for me to give it a shot.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Turbo SIM working with downgraded 1.1.1</title>
   <link href="http://jasonmadigan.com/2007/10/07/turbo-sim-working-with-downgraded-1-1-1" />
   <updated>2007-10-07T00:00:00+01:00</updated>
   <id>http://jasonmadigan.com/2007/10/07/turbo-sim-working-with-downgraded-1-1-1</id>
   <content type="html">&lt;p&gt;I was pretty sure this would be possible, but reports about this working out there are sketchy at best so I wanted to put it to the test. Since I now have a test iPhone to break before selling it on, I upgraded it to 1.1.1 to dump the filesystem over the past few days. I also got to test to see if the upgraded modem baseband firmware would still work with a TurboSIM. To test, I downgraded from 1.1.1 to 1.02 &amp;#8211; the modem firmware obviously remains intact from 1.1.1. Everything works as before with baseband version 03.14.08_G. I was half expecting to maybe run into some issues with Applesaft, as 04.01.13_G reads the AT&amp;amp;T &lt;span class="caps"&gt;IMSI&lt;/span&gt; three times as opposed to one, but all seems fine.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Meteor GPRS/EDGE fix</title>
   <link href="http://jasonmadigan.com/2007/10/07/meteor-gprs-edge-fix" />
   <updated>2007-10-07T00:00:00+01:00</updated>
   <id>http://jasonmadigan.com/2007/10/07/meteor-gprs-edge-fix</id>
   <content type="html">&lt;p&gt;I should probably stop posting about the iPhone, but hey, what can I say &amp;#8211; this little device has captured my heart.&lt;/p&gt;
&lt;p&gt;To get &lt;span class="caps"&gt;GPRS&lt;/span&gt;/&lt;span class="caps"&gt;EDGE&lt;/span&gt; working with Meteor and your iPhone is pretty simple, all we need is a proxy auto-config file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="javascript"&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;FindProxyForURL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;host&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;isInNet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;myIpAddress&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;10.0.0.0&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;255.0.0.0&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;PROXY 10.85.85.85:8799&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;DIRECT&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;Save this as &lt;code&gt;proxy.pac&lt;/code&gt; and pop this into &lt;code&gt;/private/var/root&lt;/code&gt;. Next add the following key to &lt;code&gt;private/var/root/Library/Preferences/SystemConfiguration/preferences.plist&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="xml"&gt;&lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;Proxies&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;dict&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;ProxyAutoConfigEnable&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;integer&amp;gt;&lt;/span&gt;1&lt;span class="nt"&gt;&amp;lt;/integer&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;ProxyAutoConfigURLString&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;file:///private/var/root/proxy.pac&lt;span class="nt"&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/dict&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;And that should be it. I haven&amp;#8217;t actually tested this yet, so if some kind soul would be good enough to that would be great. Any &lt;span class="caps"&gt;HTTP&lt;/span&gt; traffic should now get routed over Meteor&amp;#8217;s proxy. Mail probably won&amp;#8217;t work, I&amp;#8217;ll try to fix this when I get my hands on a Meteor &lt;span class="caps"&gt;SIM&lt;/span&gt;.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Symbolic links are pretty cool - read access to the 1.1.1 filesystem</title>
   <link href="http://jasonmadigan.com/2007/10/05/symbolic-links-are-pretty-cool-read-access-to-the-1-1-1-filesystem" />
   <updated>2007-10-05T00:00:00+01:00</updated>
   <id>http://jasonmadigan.com/2007/10/05/symbolic-links-are-pretty-cool-read-access-to-the-1-1-1-filesystem</id>
   <content type="html">&lt;p&gt;On 1.02:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /var/root
mv Media backup
ln -s / Media
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;Restore to 1.1.1, run the latest version of iphuc. Media is now / for 1.1.1.&lt;/p&gt;
&lt;p&gt;&amp;#8217;sup MobileStore.app. Now to pop in kmem and get read/write access.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Turbo SIM / Hardware unlock remain working</title>
   <link href="http://jasonmadigan.com/2007/09/28/turbo-sim-hardware-unlock-remain-working" />
   <updated>2007-09-28T00:00:00+01:00</updated>
   <id>http://jasonmadigan.com/2007/09/28/turbo-sim-hardware-unlock-remain-working</id>
   <content type="html">&lt;p&gt;As I sort of suspected, the &lt;span class="caps"&gt;IMSI&lt;/span&gt; read flaw in the iPhone&amp;#8217;s baseband has yet to be patched, so Turbo SIM&amp;#8217;s should still work with 1.1.1. In addition it should be noted that unlocking via hardware using geohot&amp;#8217;s method should always work, regardless of updates.&lt;/p&gt;
&lt;p&gt;The problem, of course, is that in order to actually use your unlocked phone you need to activate it. And this can&amp;#8217;t be done without having write access to the iPhone&amp;#8217;s filesystem. iPhoneSimFree.com reported that their software unlock remains working, but without a way of activating 1.1.1 iPhone&amp;#8217;s this can&amp;#8217;t really be confirmed.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>iPhone relocked</title>
   <link href="http://jasonmadigan.com/2007/09/27/iphone-relocked" />
   <updated>2007-09-27T00:00:00+01:00</updated>
   <id>http://jasonmadigan.com/2007/09/27/iphone-relocked</id>
   <content type="html">&lt;p&gt;We knew this would happen weeks ago. Most of us knew that the iPhone was going to be locked down for third party applications as well as &lt;span class="caps"&gt;SIM&lt;/span&gt; unlocks. It isn&amp;#8217;t possible (currently) to jailbreak an iPod touch and the same can now be said of any iPhone running 1.1.1. iTunes no longer communicates &lt;strong&gt;with&lt;/strong&gt; the iPhone, instead iTunes listens for commands sent &lt;em&gt;from&lt;/em&gt; the iPhone. This means listening for keys is no longer possible, which means decrypting ramdisks is also no longer possible. The whole thing is a tremendous pain in the ass but absolutely nobody can say this wasn&amp;#8217;t expected. Just deal with it and accept it; we all knew what we were getting ourselves in for.&lt;/p&gt;
&lt;p&gt;Incidentally, if you do need to restore your iPhone, download this:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://content.info.apple.com/iPhone/061-3823.20070821.vormd/iPhone1,1_1.0.2_1C28_Restore.ipsw"&gt;iPhone1,1_1.0.2_1C28_Restore.ipsw&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And alt-click the restore button in iTunes. You&amp;#8217;ll be able to choose the firmware you wish to restore using.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>iPhone - Voicemail Notification</title>
   <link href="http://jasonmadigan.com/2007/09/15/iphone-voicemail-notification" />
   <updated>2007-09-15T00:00:00+01:00</updated>
   <id>http://jasonmadigan.com/2007/09/15/iphone-voicemail-notification</id>
   <content type="html">&lt;p&gt;I&amp;#8217;ve noticed some weird issues regarding certain kinds of &lt;span class="caps"&gt;SMS&lt;/span&gt; messages not being delivered properly to my iPhone. Specifically, voicemail alert alerts sent by &lt;span class="caps"&gt;SMS&lt;/span&gt; never land in my inbox at all. After doing a little digging, it seems that the iPhone&amp;#8217;s baseband has trouble interpreting incoming &lt;span class="caps"&gt;SMS&lt;/span&gt; messages coming from &lt;a href="http://en.wikipedia.org/wiki/Short_code"&gt;short codes&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Since short codes are used quite a bit in Europe for promotions, banking and the like I should think that the firmware shipping on European iPhone&amp;#8217;s will have fixed this. In the meantime we&amp;#8217;ll have to keep digging to try to find a workaround.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>iPhone - Voicemail Button</title>
   <link href="http://jasonmadigan.com/2007/09/13/iphone-voicemail-button" />
   <updated>2007-09-13T00:00:00+01:00</updated>
   <id>http://jasonmadigan.com/2007/09/13/iphone-voicemail-button</id>
   <content type="html">&lt;p&gt;You can use your iPhone&amp;#8217;s Voicemail button to call your local carriers voicemail number by doing the following:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Disable your &lt;span class="caps"&gt;SIM&lt;/span&gt; &lt;span class="caps"&gt;PIN&lt;/span&gt;, if enabled.&lt;/li&gt;
	&lt;li&gt;&lt;span class="caps"&gt;SSH&lt;/span&gt; into your iPhone &amp;#8211; I&amp;#8217;m going to assume your iPhone has been jailbroken, has &lt;span class="caps"&gt;SSH&lt;/span&gt; installed and the latest &lt;span class="caps"&gt;BSD&lt;/span&gt; Subsystem installed.&lt;/li&gt;
	&lt;li&gt;The latest &lt;span class="caps"&gt;BSD&lt;/span&gt; Subsystem (1.5) comes with minicom, but you&amp;#8217;ll need to generate a configuration file for it to interact with the baseband. You&amp;#8217;ll need to create &lt;code&gt;/local/etc/&lt;/code&gt; in &lt;code&gt;/usr/&lt;/code&gt;.&lt;/li&gt;
	&lt;li&gt;In &lt;code&gt;/usr/local/etc/&lt;/code&gt;, run &lt;code&gt;nano minirc.dfl&lt;/code&gt; and paste &lt;code&gt;pu port /dev/tty.baseband&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;Save the file, &lt;code&gt;CTRL-O&lt;/code&gt;, exit nano &lt;code&gt;CTRL-X&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;Disable the commcenter &amp;#8211; &lt;code&gt;launchctl unload -w /System/Library/LaunchDaemons/com.apple.CommCenter.plist&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;Run@ minicom@&lt;br /&gt;
*	Run@ AT+CSVM=1,&amp;#8220;171&amp;#8221; @where 171 is your carriers voicemail number&lt;/li&gt;
	&lt;li&gt;Exit minicom &amp;#8211; &lt;code&gt;CTRL-a&lt;/code&gt;, then &lt;code&gt;q&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;Restart the commcenter &lt;code&gt;- launchctl load -w /System/Library/LaunchDaemons/com.apple.CommCenter.plist&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;Done!&lt;/li&gt;
&lt;/ul&gt;</content>
 </entry>
 
 <entry>
   <title>Mail.app - IMAP Niggles</title>
   <link href="http://jasonmadigan.com/2007/08/24/mail-app-imap-niggles" />
   <updated>2007-08-24T00:00:00+01:00</updated>
   <id>http://jasonmadigan.com/2007/08/24/mail-app-imap-niggles</id>
   <content type="html">&lt;p&gt;I&amp;#8217;d always used one single email account and tried, wherever possible, to keep these accounts completely separate from one another. At work I now find myself using two &lt;span class="caps"&gt;IMAP&lt;/span&gt; accounts, one for work and one personal account. Setting the accounts up is a doddle, but I noticed that messages I was sending from my work account where not getting stored in my mailbox.&lt;/p&gt;
&lt;p&gt;After some fiddling I found that to have messages sent from one account stored in the sent mailbox for that account, you need to explicitly tell Mail.app what each of the server-side folders are to be used for. To specify this, click on them and go to Mailbox &amp;gt;Use this mailbox for &amp;gt; Sent/Drafts/Trash. I just thought I&amp;#8217;d share in case anyone else comes up against this problem.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Guide to unlocking your iPhone with a Turbo SIM</title>
   <link href="http://jasonmadigan.com/2007/08/16/guide-to-unlocking-your-iphone-with-a-turbo-sim" />
   <updated>2007-08-16T00:00:00+01:00</updated>
   <id>http://jasonmadigan.com/2007/08/16/guide-to-unlocking-your-iphone-with-a-turbo-sim</id>
   <content type="html">&lt;p&gt;Since receiving my Turbo &lt;span class="caps"&gt;SIM&lt;/span&gt; yesterday and successfully getting it to work with O2 Ireland, I thought I&amp;#8217;d write up a clear, easy to understand guide outlining the process.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Disclaimer: If you break something it&amp;#8217;s your own stupid fault jerkface.&lt;/em&gt;&lt;/p&gt;
&lt;h1&gt;What you will need&lt;/h1&gt;
&lt;h2&gt;An iPhone&lt;/h2&gt;
&lt;p&gt;Your iPhone will need to be Jailbroken, have &lt;span class="caps"&gt;SSH&lt;/span&gt; installed and it will need to have been activated using AT&amp;amp;T&amp;#8217;s &lt;span class="caps"&gt;ICCID&lt;/span&gt; (use iASign). If you don&amp;#8217;t know what any of this means, do some reading. There are a million zillion guides out there explaining the procedures for doing these things. If, after reading, you still don&amp;#8217;t know what any of this means, this method is not for you. Wait for a software based unlock.&lt;/p&gt;
&lt;h2&gt;A Turbo &lt;span class="caps"&gt;SIM&lt;/span&gt; &amp;#8211; &lt;a href="http://www.bladox.com/shop.php?lang=en"&gt;Available here&lt;/a&gt; (sold out at the time of writing)&lt;/h2&gt;
&lt;p&gt;As explained in previous blog posts, this little device is sandwiched between your carriers &lt;span class="caps"&gt;SIM&lt;/span&gt; and itself. It&amp;#8217;s capable of running small &lt;span class="caps"&gt;SIM&lt;/span&gt; level applications, one of which, Applesaft, is capable of unlocking the iPhone by exploiting a flaw in the iPhone&amp;#8217;s baseband. I&amp;#8217;m not going to explain how this works because anytime I do I get strange looks from people as though I&amp;#8217;d just asked them if they&amp;#8217;d ever been abducted by aliens. At the time of writing this, the poor small team at Bladox churning these little devices out have become inundated with orders and have had to temporarily close their online store.&lt;/p&gt;
&lt;h2&gt;Some software&lt;/h2&gt;
&lt;p&gt;&lt;a href="http://www.mediafire.com/?5c3gvjc44zz"&gt;applesaft-0.92.tar.gz&lt;/a&gt; &amp;amp; &lt;a href="http://www.mediafire.com/?eoxhg0ynb5y"&gt;turbo-cable-utils-iPhone-0.7.0-rev1.tar.gz&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Steps:&lt;/h2&gt;
&lt;ul&gt;
	&lt;li&gt;Extract the contents of turbo-cable-utils-iPhone-0.7.0-rev1.tar.gz to somewhere on your computer&lt;/li&gt;
	&lt;li&gt;Upload the contents of /bin-iPhone from the file you just unpacked to /bin on your iPhone (through &lt;span class="caps"&gt;SCP&lt;/span&gt; or &lt;span class="caps"&gt;SSHFS&lt;/span&gt;, whichever you prefer)&lt;/li&gt;
	&lt;li&gt;&lt;span class="caps"&gt;SSH&lt;/span&gt; into your iPhone&lt;/li&gt;
	&lt;li&gt;Run &lt;code&gt;cd /bin/&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;Now you&amp;#8217;ll need to change the permissions for each of the binary applications which you just uploaded to &lt;code&gt;/bin/&lt;/code&gt; using the command &lt;code&gt;chmod +x turbo-APPNAME&lt;/code&gt;. There are 10 applications in total which you need to do this for.&lt;/li&gt;
	&lt;li&gt;Extract the contents of applesaft-0.92.tar.gz and copy the applesaft.trb file containted within to your &lt;code&gt;/bin/&lt;/code&gt; folder on your iPhone the same as you uploaded the turbo cable utilities mentioned above. You can remove this and the &lt;code&gt;turbo-APPNAME&lt;/code&gt; files later. Run &lt;code&gt;chmod 777 /bin/applesaft.trb&lt;/code&gt; to give the file the permissions it needs.&lt;/li&gt;
	&lt;li&gt;Download and edit (or edit on the iPhone locally if you have something like &lt;span class="caps"&gt;VIM&lt;/span&gt; installed) the file &lt;code&gt;com.apple.CommCenter.plist&lt;/code&gt; located in &lt;code&gt;/System/Library/LaunchDaemons/&lt;/code&gt; on your iPhone.&lt;/li&gt;
	&lt;li&gt;Disable the commcenter by placing &lt;code&gt;&amp;lt;key&amp;gt;Disabled&amp;lt;/key&amp;gt;&amp;lt;true/&amp;gt;&lt;/code&gt; after &lt;code&gt;&amp;lt;key&amp;gt;OnDemand&amp;lt;/key&amp;gt;&amp;lt;false/&amp;gt;&lt;/code&gt; and copy the file back/save it.&lt;/li&gt;
	&lt;li&gt;Reboot the iPhone.&lt;/li&gt;
	&lt;li&gt;Now comes the tricky bit. Carefully &lt;strong&gt;&lt;span class="caps"&gt;CAREFULLY&lt;/span&gt;&lt;/strong&gt; remove your Turbo &lt;span class="caps"&gt;SIM&lt;/span&gt; from its plastic casing. Seriously, Jesus Christ be careful. Oh god you&amp;#8217;re going to break it &lt;strong&gt;&lt;span class="caps"&gt;WHAT&lt;/span&gt; &lt;span class="caps"&gt;ARE&lt;/span&gt; &lt;span class="caps"&gt;YOU&lt;/span&gt; &lt;span class="caps"&gt;DOING&lt;/span&gt;&lt;/strong&gt;.&lt;/li&gt;
	&lt;li&gt;Take your AT&amp;amp;T &lt;span class="caps"&gt;SIM&lt;/span&gt; card out of your iPhone using a paperclip and carefully trim it according the the printed instructions on the Turbo SIM&amp;#8217;s packaging. Don&amp;#8217;t be afraid to trim it really tight around the SIM&amp;#8217;s contacts for a snug fit.&lt;/li&gt;
	&lt;li&gt;Carefully sandwich the trimmed AT&amp;amp;T card with your Turbo &lt;span class="caps"&gt;SIM&lt;/span&gt; and place them both into the iPhone&amp;#8217;s &lt;span class="caps"&gt;SIM&lt;/span&gt; tray. You&amp;#8217;ll have to be gentle here as there&amp;#8217;s just barely enough clearance for both devices to fit snuggly into the &lt;span class="caps"&gt;SIM&lt;/span&gt; tray.&lt;/li&gt;
	&lt;li&gt;The carrier name area at the top left of the screen will continue to say &amp;#8220;No Service&amp;#8221;, this is fine. If it says &amp;#8220;No &lt;span class="caps"&gt;SIM&lt;/span&gt;&amp;#8221; the contacts between your &lt;span class="caps"&gt;SIM&lt;/span&gt; and the Turbo &lt;span class="caps"&gt;SIM&lt;/span&gt; aren&amp;#8217;t properly seated, fiddle with it a bit to make sure they&amp;#8217;re square atop of one another.&lt;/li&gt;
	&lt;li&gt;&lt;span class="caps"&gt;SSH&lt;/span&gt; into your iPhone again and run the following command to ensure the iPhone can communicate properly with the Turbo &lt;span class="caps"&gt;SIM&lt;/span&gt; &amp;#8211; &amp;#8220;turbo-info&amp;#8221;. Assuming everything is correct, this command should return &amp;#8220;OK&amp;#8221; along with the serial of your Turbo &lt;span class="caps"&gt;SIM&lt;/span&gt;.&lt;/li&gt;
	&lt;li&gt;Now, lets install the applesaft application. Run the following:&lt;br /&gt;
	&lt;code&gt;turbo-app /bin/applesaft.trb&lt;/code&gt;&lt;br /&gt;
If all goes well you should receive an  &amp;#8220;OK&amp;#8221; after some initial messages about the modem being initialised.&lt;/li&gt;
	&lt;li&gt;Alter the &lt;code&gt;com.apple.CommCenter.plist&lt;/code&gt;file we edited above and remove the line we added &lt;code&gt;&amp;lt;key&amp;gt;Disabled&amp;lt;/key&amp;gt;&amp;lt;true/&amp;gt;&lt;/code&gt; and reboot.&lt;/li&gt;
	&lt;li&gt;On your iPhone, go to Settings&amp;gt;Phone&amp;gt;SIM Applications&amp;gt;Apple Saft and press &amp;#8220;&lt;span class="caps"&gt;SET&lt;/span&gt;&amp;#8221;. A prompt should indicate that the &lt;span class="caps"&gt;IMSI&lt;/span&gt; and &lt;span class="caps"&gt;ICCID&lt;/span&gt; of the AT&amp;amp;T &lt;span class="caps"&gt;SIM&lt;/span&gt; has been read and recorded successfully.&lt;/li&gt;
	&lt;li&gt;Now, remove the Turbo &lt;span class="caps"&gt;SIM&lt;/span&gt; and AT&amp;amp;T &lt;span class="caps"&gt;SIM&lt;/span&gt;.&lt;/li&gt;
	&lt;li&gt;Trim your carriers &lt;span class="caps"&gt;SIM&lt;/span&gt; card just like the AT&amp;amp;T one and insert the sandwiched pair into the iPhone.&lt;/li&gt;
	&lt;li&gt;Reboot the iPhone.&lt;/li&gt;
	&lt;li&gt;All going well, your iPhone should now properly register on your carriers network and everything should pretty much work straight away. To get &lt;span class="caps"&gt;EDGE&lt;/span&gt;/&lt;span class="caps"&gt;GPRS&lt;/span&gt; working, alter the settings in Settings&amp;gt;General&amp;gt;EDGE to use your carriers &lt;span class="caps"&gt;APN&lt;/span&gt;/Username/Password.&lt;/li&gt;
	&lt;li&gt;Pat yourself on the back.&lt;/li&gt;
&lt;/ul&gt;</content>
 </entry>
 
 <entry>
   <title>iPhone - Working perfectly with O2 Ireland</title>
   <link href="http://jasonmadigan.com/2007/08/15/iphone-working-perfectly-with-o2-ireland" />
   <updated>2007-08-15T00:00:00+01:00</updated>
   <id>http://jasonmadigan.com/2007/08/15/iphone-working-perfectly-with-o2-ireland</id>
   <content type="html">&lt;p&gt;My Turbo &lt;span class="caps"&gt;SIM&lt;/span&gt; arrived today and with little effort whatsoever I had my iPhone working fine with my carrier, O2 Ireland. Everything works, calls/&lt;span class="caps"&gt;SMS&lt;/span&gt;/data (&lt;span class="caps"&gt;GPRS&lt;/span&gt; at an amazing 35kbps).&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>TurboSIM iPhone unlock - confirmed working</title>
   <link href="http://jasonmadigan.com/2007/08/13/turbosim-iphone-unlock-confirmed-working" />
   <updated>2007-08-13T00:00:00+01:00</updated>
   <id>http://jasonmadigan.com/2007/08/13/turbosim-iphone-unlock-confirmed-working</id>
   <content type="html">&lt;p&gt;Two iPhone users have reported that their TurboSIMs have been successfully used to unlock their iPhones. Both have warned that the device is quite fragile and can be destroyed if forced into a &lt;span class="caps"&gt;SIM&lt;/span&gt; slot, so be careful.&lt;/p&gt;
&lt;p&gt;Ozbimmer, another member of the Hackint0sh forums &lt;a href="http://www.bladox.com/forum/viewtopic.php?p=2236#2236"&gt;posted&lt;/a&gt; to confirm that his Turbo &lt;span class="caps"&gt;SIM&lt;/span&gt; works as expected. Zf_ was also kind enough to provide a quick guide:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;First, your phone must be activated (with the AT&amp;amp;T &lt;span class="caps"&gt;SIM&lt;/span&gt;), jailbreaked, and with &lt;span class="caps"&gt;SSH&lt;/span&gt; and vim. Refer to previous tutorials to do that.&lt;/li&gt;
	&lt;li&gt;Download the port of &lt;a href="http://www.hackint0sh.org/forum/showpost.php?p=15335&amp;amp;postcount=16"&gt;Bladox utilities&lt;/a&gt; on your computer, extract it on your computer (you need the binary file turbo-app)&lt;/li&gt;
	&lt;li&gt;Download AppleSaft 0.92 from Bladox (see the link on their forum, don&amp;#8217;t remember it), extract it on your computer (you need the .trb file)&lt;/li&gt;
	&lt;li&gt;Turn on your phone with Turbo &lt;span class="caps"&gt;SIM&lt;/span&gt; + AT&amp;amp;T subscription&lt;/li&gt;
	&lt;li&gt;Disable CommCenter &amp;#8211; ssh to your phone, vim /System/Library/LaunchDaemons/com.apple.CommCenter.plist add:&lt;br /&gt;
	@&lt;br /&gt;
		&lt;key&gt;Disabled&lt;/key&gt;&lt;true/&gt;&lt;br /&gt;
	@&lt;/li&gt;
	&lt;li&gt;If you don&amp;#8217;t like vim, you can do this modification on your desktop computer (iPhuc/iPhoneInterface getfile, modify the file, and putfile)&lt;/li&gt;
	&lt;li&gt;Reboot&lt;/li&gt;
	&lt;li&gt;Copy turbo-app to your phone (for example in /opt/bladox)&lt;/li&gt;
	&lt;li&gt;Copy applesaft.trb to your phone (for example in /tmp)&lt;/li&gt;
	&lt;li&gt;ssh to your phone, set the executable permission to turbo-app (chmod a+x /opt/bladox/turbo-app) and run it with /opt/bladox/turbo-app /tmp/applesaft.trb. It should take approximately 30 seconds and you shouldn&amp;#8217;t see any error. Please panic if you see one.&lt;/li&gt;
	&lt;li&gt;Reenable CommCenter &amp;#8211; ssh to your phone, vim /System/Library/LaunchDaemons/com.apple.CommCenter.plist and delete the lines you added previously&lt;/li&gt;
	&lt;li&gt;Reboot&lt;/li&gt;
	&lt;li&gt;Go into Settings/Phone/&lt;span class="caps"&gt;SIM&lt;/span&gt; Applications/Apple Saft and choose Set&lt;/li&gt;
	&lt;li&gt;Turn off your phone&lt;/li&gt;
	&lt;li&gt;Turn on your phone with Turbo &lt;span class="caps"&gt;SIM&lt;/span&gt; + your subscription and test.&lt;/li&gt;
&lt;/ul&gt;</content>
 </entry>
 
 <entry>
   <title>Unlocking the iPhone</title>
   <link href="http://jasonmadigan.com/2007/08/08/unlocking-the-iphone" />
   <updated>2007-08-08T00:00:00+01:00</updated>
   <id>http://jasonmadigan.com/2007/08/08/unlocking-the-iphone</id>
   <content type="html">&lt;p&gt;There are two available solutions for unlocking the iPhone at the moment, and both hinge upon a &amp;#8220;flaw&amp;#8221; in the iPhone&amp;#8217;s baseband. All shipped iPhones are locked with a PN (personalized network) lock to at&amp;amp;t. The iPhone, upon startup, enforces this PN lock by reading the included at&amp;amp;t &lt;span class="caps"&gt;SIM&lt;/span&gt; card&amp;#8217;s &lt;a href="http://en.wikipedia.org/wiki/International_Mobile_Subscriber_Identity"&gt;&lt;span class="caps"&gt;IMSI&lt;/span&gt;&lt;/a&gt; two times initially at startup to ensure the &lt;span class="caps"&gt;IMSI&lt;/span&gt; is that of at&amp;amp;t. The third and subsequent reads of the &lt;span class="caps"&gt;IMSI&lt;/span&gt; during the normal operation of the iPhone is not checked to ensure it is that of at&amp;amp;t.&lt;/p&gt;
&lt;p&gt;The two available unlocking solutions both exploit this to use &lt;span class="caps"&gt;SIM&lt;/span&gt; cards from providers other than at&amp;amp;t. The first method involves &lt;span class="caps"&gt;SIM&lt;/span&gt; card cloning, which is very much illegal in most countries. The method sees a the KI (the &amp;#8220;secret&amp;#8221; ciphering and authentication key embedded into the &lt;span class="caps"&gt;SIM&lt;/span&gt;) extracted from an old COMP128 V1 &lt;span class="caps"&gt;SIM&lt;/span&gt; card (these are rare to find distributed from 2002 onwards). The KI can only be extracted from these old &lt;span class="caps"&gt;SIM&lt;/span&gt; cards, and not the modern V2/V3 cards available today. The KI and &lt;span class="caps"&gt;IMSI&lt;/span&gt; from this old &lt;span class="caps"&gt;SIM&lt;/span&gt; card, along with the &lt;span class="caps"&gt;IMSI&lt;/span&gt; of the iPhone&amp;#8217;s at&amp;amp;at card are combined and written to a blank &lt;span class="caps"&gt;SIM&lt;/span&gt; card (SilverCard) using a &lt;span class="caps"&gt;SIM&lt;/span&gt; card writer. Some additional programming is done to the blank card&amp;#8217;s &lt;span class="caps"&gt;SIM&lt;/span&gt; to return the at&amp;amp;t &lt;span class="caps"&gt;IMSI&lt;/span&gt; the first two reads, and the V1 cards &lt;span class="caps"&gt;IMSI&lt;/span&gt; for any subsequent requests. This method works, but is frought with all sorts of legality issues (not to mention the fact that finding old V1 &lt;span class="caps"&gt;SIM&lt;/span&gt; cards is pretty difficult anyway) and so is less than ideal.&lt;/p&gt;
&lt;p&gt;A second unlocking solution is much more promising and is likely to attract a lot of attention over the next few weeks. It involves the use of a piece of hardware from &lt;a href="http://www.bladox.com/"&gt;Bladox&lt;/a&gt; called a Turbo &lt;span class="caps"&gt;SIM&lt;/span&gt;. This nifty thin little device sits between your original &lt;span class="caps"&gt;SIM&lt;/span&gt; card and the &lt;span class="caps"&gt;SIM&lt;/span&gt; reader in your iPhone. It&amp;#8217;s capable of running small &lt;span class="caps"&gt;SIM&lt;/span&gt; applications and can be used to intercept incoming &lt;span class="caps"&gt;IMSI&lt;/span&gt; requests (or any &lt;span class="caps"&gt;SIM&lt;/span&gt; requests for that matter), process them, and produce output. Use of such a device is probably completely legal, since the original &lt;span class="caps"&gt;SIM&lt;/span&gt; card is not cloned. It will also work perfectly with V2/V3 &lt;span class="caps"&gt;SIM&lt;/span&gt; cards. It&amp;#8217;s only purpose (in the case of unlocking the iPhone) is to get by the &amp;#8220;good guy, bad guy&amp;#8221; &lt;span class="caps"&gt;IMSI&lt;/span&gt; check the phone performs at boot to provide the iPhone with the at&amp;amp;t &lt;span class="caps"&gt;IMSI&lt;/span&gt; it requires at startup. Thereafter, the device relinquishes control back to the original &lt;span class="caps"&gt;SIM&lt;/span&gt; card for any further &lt;span class="caps"&gt;SIM&lt;/span&gt; requests, including network registration. I&amp;#8217;ve ordered one and by the time it arrives in 2 or so weeks there should be a great deal of hype surrounding the device. Two applications designed to run on the device for the purpose of fooling the iPhone have already been released, here&amp;#8217;s the source of the first one:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="cpp"&gt;&lt;span class="cm"&gt;/*&lt;/span&gt;
&lt;span class="cm"&gt; * iPhone baseband SIM lock 0wnage PoC&lt;/span&gt;
&lt;span class="cm"&gt; *&lt;/span&gt;
&lt;span class="cm"&gt; * History:&lt;/span&gt;
&lt;span class="cm"&gt; * 0.92 - User Interface, ICCID/IMSI are read from a card and&lt;/span&gt;
&lt;span class="cm"&gt;	  then used with another&lt;/span&gt;
&lt;span class="cm"&gt; * 0.91 - some fixes, PROC_8_CONFIG_INIT_BOOSTER for speedy init of ICCID file,&lt;/span&gt;
&lt;span class="cm"&gt; *	  needs bladox turbo kernel &amp;gt;=1.2.7&lt;/span&gt;
&lt;span class="cm"&gt; * 0.9 - original version&lt;/span&gt;
&lt;span class="cm"&gt; *&lt;/span&gt;
&lt;span class="cm"&gt; * Compile, load on your leet Bladox gear&lt;/span&gt;
&lt;span class="cm"&gt; * disable your subscription PIN and enjoy :p&lt;/span&gt;
&lt;span class="cm"&gt; *&lt;/span&gt;
&lt;span class="cm"&gt; * Special thanks to the baseband development team&lt;/span&gt;
&lt;span class="cm"&gt; * It wouldn&amp;#39;t have been so easy without you :)&lt;/span&gt;
&lt;span class="cm"&gt; *&lt;/span&gt;
&lt;span class="cm"&gt; * (c) 2007, collective iPhone development effort&lt;/span&gt;
&lt;span class="cm"&gt; *&lt;/span&gt;
&lt;span class="cm"&gt; * This program is free software; you can redistribute it and/or&lt;/span&gt;
&lt;span class="cm"&gt; * modify it under the terms of the GNU General Public License&lt;/span&gt;
&lt;span class="cm"&gt; * as published by the Free Software Foundation; either version 2&lt;/span&gt;
&lt;span class="cm"&gt; * of the License, or (at your option) any later version.&lt;/span&gt;
&lt;span class="cm"&gt; *&lt;/span&gt;
&lt;span class="cm"&gt; * This program is distributed in the hope that it will be useful,&lt;/span&gt;
&lt;span class="cm"&gt; * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;/span&gt;
&lt;span class="cm"&gt; * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;/span&gt;
&lt;span class="cm"&gt; * GNU General Public License for more details.&lt;/span&gt;
&lt;span class="cm"&gt; *&lt;/span&gt;
&lt;span class="cm"&gt; * You should have received a copy of the GNU General Public License&lt;/span&gt;
&lt;span class="cm"&gt; * along with this program; if not, write to the Free Software&lt;/span&gt;
&lt;span class="cm"&gt; * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.&lt;/span&gt;
&lt;span class="cm"&gt;*/&lt;/span&gt;

&lt;span class="cp"&gt;#include &amp;lt;config.h&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;#include &amp;lt;turbo/turbo.h&amp;gt;&lt;/span&gt;

&lt;span class="cp"&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;#include &amp;lt;string.h&amp;gt;&lt;/span&gt;

&lt;span class="cp"&gt;#define VERSION_A	0&lt;/span&gt;
&lt;span class="cp"&gt;#define VERSION_B	92&lt;/span&gt;

&lt;span class="cm"&gt;/* *INDENT-OFF* */&lt;/span&gt;

&lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="n"&gt;lc_char&lt;/span&gt; &lt;span class="n"&gt;PROGMEM&lt;/span&gt; &lt;span class="n"&gt;lc_Show&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;LC_EN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;Show&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;LC_END&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="n"&gt;lc_char&lt;/span&gt; &lt;span class="n"&gt;PROGMEM&lt;/span&gt; &lt;span class="n"&gt;lc_Set&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;LC_EN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;Set&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;LC_END&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="n"&gt;lc_char&lt;/span&gt; &lt;span class="n"&gt;PROGMEM&lt;/span&gt; &lt;span class="n"&gt;lc_WasSet&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;LC_EN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;Following was set: &amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;LC_END&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="n"&gt;lc_char&lt;/span&gt; &lt;span class="n"&gt;PROGMEM&lt;/span&gt; &lt;span class="n"&gt;lc_Version&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;LC_EN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;Version&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;LC_END&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="n"&gt;lc_char&lt;/span&gt; &lt;span class="n"&gt;PROGMEM&lt;/span&gt; &lt;span class="n"&gt;lc_AppleSaft&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;LC_EN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;Apple Saft&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;LC_END&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="n"&gt;lc_char&lt;/span&gt; &lt;span class="n"&gt;PROGMEM&lt;/span&gt; &lt;span class="n"&gt;lc_IMSI&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;LC_EN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;IMSI: &amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;LC_END&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="n"&gt;lc_char&lt;/span&gt; &lt;span class="n"&gt;PROGMEM&lt;/span&gt; &lt;span class="n"&gt;lc_ICCID&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;LC_EN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;ICCID: &amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;LC_END&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="cm"&gt;/* *INDENT-ON* */&lt;/span&gt;

&lt;span class="cp"&gt;#define EF_IMSI 0x6F07&lt;/span&gt;
&lt;span class="cp"&gt;#define EF_ICCID 0x2FE2&lt;/span&gt;

&lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="n"&gt;PROGMEM&lt;/span&gt; &lt;span class="n"&gt;ef_imsi_path&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="mh"&gt;0x3F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mh"&gt;0x00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mh"&gt;0x7F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mh"&gt;0x20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mh"&gt;0x6F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mh"&gt;0x07&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="n"&gt;PROGMEM&lt;/span&gt; &lt;span class="n"&gt;ef_iccid_path&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="mh"&gt;0x3F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mh"&gt;0x00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mh"&gt;0x2F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mh"&gt;0xE2&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="cp"&gt;#define IMSI_SIZE 9&lt;/span&gt;
&lt;span class="cp"&gt;#define IMSI_RESPONSE_SIZE 15&lt;/span&gt;

&lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;imsi&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;imsi_response&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;tmp_imsi&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;tmp_iccid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;typedef&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;_Pers_mem&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="n"&gt;imsi&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mh"&gt;0x09&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
  &lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="n"&gt;iccid&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mh"&gt;0x0a&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;Pers_mem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;Pers_mem&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;pers_mem&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="n"&gt;handle_sim_file&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;File_apdu_data&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;ef&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;EF_ICCID&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;ins&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;ME_CMD_READ_BINARY&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rb&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;pers_mem&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;on&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;dbsp&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;FAKE_ICCID&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="c1"&gt;//memcpy (fa-&amp;gt;data, _att_iccid, sizeof (_att_iccid));&lt;/span&gt;
      &lt;span class="n"&gt;memcpy&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;pers_mem&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;iccid&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="mh"&gt;0x0a&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;dbsp&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;REAL_ICCID&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="n"&gt;sim&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;ins&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;p1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;p2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;p3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;p3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mh"&gt;0x90&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;p3&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mh"&gt;0x00&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;ef&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;EF_IMSI&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;ins&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;ME_CMD_READ_BINARY&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;sim&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;ins&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;p1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;p2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;p3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
	&lt;span class="n"&gt;dbsp&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;REAL_IMSI_0&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
	&lt;span class="cm"&gt;/* learn and retransmit */&lt;/span&gt;
&lt;span class="c1"&gt;//        low_level_imsi_select ();&lt;/span&gt;
&lt;span class="c1"&gt;//        sim (0xB0, 0x00, 0x00, 0x09, imsi);   /* READ BINARY */&lt;/span&gt;
&lt;span class="c1"&gt;//        memcpy (fa-&amp;gt;data, imsi, IMSI_SIZE);&lt;/span&gt;
	&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;p3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mh"&gt;0x90&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
	&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;p3&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mh"&gt;0x00&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
	&lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
	&lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
	&lt;span class="cm"&gt;/* spoof */&lt;/span&gt;
	&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rb&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;pers_mem&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;on&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
	&lt;span class="p"&gt;{&lt;/span&gt;
	  &lt;span class="n"&gt;dbsp&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;FAKE_IMSI_1&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;//        memcpy (fa-&amp;gt;data, _att_imsi, sizeof (_att_imsi));&lt;/span&gt;
	  &lt;span class="n"&gt;memcpy&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;pers_mem&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;imsi&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="mh"&gt;0x09&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
	&lt;span class="p"&gt;}&lt;/span&gt;
	&lt;span class="k"&gt;else&lt;/span&gt;
	&lt;span class="p"&gt;{&lt;/span&gt;
	  &lt;span class="n"&gt;dbsp&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;REAL_IMSI_1&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
	&lt;span class="p"&gt;}&lt;/span&gt;
	&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;p3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mh"&gt;0x90&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
	&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;p3&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mh"&gt;0x00&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
	&lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
	&lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
	&lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
	&lt;span class="cm"&gt;/* no break intended here */&lt;/span&gt;
      &lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
	&lt;span class="n"&gt;dbsp&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;REAL_IMSI_2+&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
	&lt;span class="cm"&gt;/* play nice */&lt;/span&gt;
&lt;span class="c1"&gt;//        memcpy (fa-&amp;gt;data, imsi, IMSI_SIZE);&lt;/span&gt;
	&lt;span class="n"&gt;sim&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;ins&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;p1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;p2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;p3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
	&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;p3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mh"&gt;0x90&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
	&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;p3&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mh"&gt;0x00&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;else&lt;/span&gt;
    &lt;span class="n"&gt;sim&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;ins&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;p1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;p2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;p3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="n"&gt;get_files&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

  &lt;span class="n"&gt;memcpy&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ef_imsi_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="n"&gt;select&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="n"&gt;sim&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ME_CMD_READ_BINARY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mh"&gt;0x00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mh"&gt;0x00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mh"&gt;0x09&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tmp_imsi&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="n"&gt;select&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="n"&gt;memcpy&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ef_iccid_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="n"&gt;select&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="n"&gt;sim&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ME_CMD_READ_BINARY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mh"&gt;0x00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mh"&gt;0x00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mh"&gt;0x0a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tmp_iccid&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="n"&gt;select&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="n"&gt;saft_set&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;SCtx&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;action&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;APP_ENTER&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;buf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;buf_B&lt;/span&gt; &lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;get_files&lt;/span&gt; &lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="n"&gt;memcpy&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;pers_mem&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;imsi&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;tmp_imsi&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;memcpy&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;pers_mem&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;iccid&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;tmp_iccid&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mh"&gt;0x0a&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;wb&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;pers_mem&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;on&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sprints&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;locale&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lc_WasSet&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sprintc&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;\n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sprints&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;locale&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lc_IMSI&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mh"&gt;0x09&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sprintch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rb&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;pers_mem&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;imsi&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]));&lt;/span&gt;
      &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sprintc&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sprints&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;locale&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lc_ICCID&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mh"&gt;0x0a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sprintch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rb&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;pers_mem&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;iccid&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]));&lt;/span&gt;
      &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sprintc&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sprintc&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;\n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sprintc&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;\0&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;display_text&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;APP_END&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;APP_BACK&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;APP_BACK&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;APP_OK&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="n"&gt;saft_show&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;SCtx&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;action&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;APP_ENTER&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;buf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;buf_B&lt;/span&gt; &lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;get_files&lt;/span&gt; &lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sprints&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;locale&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lc_IMSI&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mh"&gt;0x09&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sprintch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tmp_imsi&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
      &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sprintc&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sprints&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;locale&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lc_ICCID&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mh"&gt;0x0a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sprintch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tmp_iccid&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
      &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sprintc&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sprintc&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;\n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sprintc&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;\0&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;display_text&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;APP_END&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;APP_BACK&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;APP_OK&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="n"&gt;saft_version&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;SCtx&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;action&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;APP_ENTER&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;buf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;buf_B&lt;/span&gt; &lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sprints&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;locale&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lc_AppleSaft&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sprintc&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sprinti&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;VERSION_A&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sprintc&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sprinti&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;VERSION_B&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sprintc&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;\n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sprintc&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;&amp;#39;\0&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;display_text&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;APP_END&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;APP_BACK&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;APP_OK&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;SNodeP&lt;/span&gt; &lt;span class="n"&gt;saft_n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;lc_AppleSaft&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;NULL&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="n"&gt;SNodeP&lt;/span&gt; &lt;span class="n"&gt;saft_set_n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;lc_Set&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;saft_set&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="n"&gt;SNodeP&lt;/span&gt; &lt;span class="n"&gt;saft_show_n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;lc_Show&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;saft_show&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="n"&gt;SNodeP&lt;/span&gt; &lt;span class="n"&gt;saft_version_n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;lc_Version&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;saft_version&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="cm"&gt;/* *INDENT-OFF* */&lt;/span&gt;

&lt;span class="n"&gt;SEdgeP&lt;/span&gt; &lt;span class="n"&gt;saft_edges_p&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;saft_n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;saft_show_n&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;saft_n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;saft_set_n&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;saft_n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;saft_version_n&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="nb"&gt;NULL&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="cm"&gt;/* *INDENT-ON* */&lt;/span&gt;

&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="n"&gt;action_menu&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Menu_selection_data&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;SCtx&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;spider_init&lt;/span&gt; &lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;eP&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;saft_edges_p&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;saft_n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;spider&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="n"&gt;turbo_handler&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u8&lt;/span&gt; &lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="nl"&gt;ACTION_APP_REGISTER:&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
	&lt;span class="n"&gt;Pers_mem&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;emalloc&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;sizeof&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Pers_mem&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

	&lt;span class="n"&gt;pers_mem&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
	&lt;span class="n"&gt;wb&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;on&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
	&lt;span class="n"&gt;reg_app_data&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

	&lt;span class="n"&gt;set_proc_8&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;PROC_8_CONFIG_INIT_BOOSTER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="nl"&gt;ACTION_APP_UNREGISTER:&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
	&lt;span class="n"&gt;Pers_mem&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;app_data&lt;/span&gt; &lt;span class="p"&gt;();&lt;/span&gt;

	&lt;span class="n"&gt;efree&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="nl"&gt;ACTION_APP_INIT:&lt;/span&gt;
      &lt;span class="n"&gt;dbsp&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;APP_INIT&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="n"&gt;pers_mem&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;app_data&lt;/span&gt; &lt;span class="p"&gt;();&lt;/span&gt;

      &lt;span class="n"&gt;tmp_imsi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;malloc&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0x09&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="n"&gt;tmp_iccid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;malloc&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0x0a&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

      &lt;span class="n"&gt;imsi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;malloc&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IMSI_SIZE&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="n"&gt;imsi_response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;malloc&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IMSI_RESPONSE_SIZE&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="n"&gt;reg_file&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ef_imsi_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="n"&gt;reg_file&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ef_iccid_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="nl"&gt;ACTION_FILE_APDU:&lt;/span&gt;
      &lt;span class="n"&gt;handle_sim_file&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="nl"&gt;ACTION_INSERT_MENU:&lt;/span&gt;
      &lt;span class="n"&gt;insert_menu&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;locale&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lc_AppleSaft&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
      &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="nl"&gt;ACTION_MENU_SELECTION:&lt;/span&gt;
      &lt;span class="n"&gt;stk_thread&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;action_menu&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
      &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;As you can see, it&amp;#8217;s pretty simple. Over the coming days we&amp;#8217;ll probably see a native iPhone application for writing applications such as the one above to the Turbo &lt;span class="caps"&gt;SIM&lt;/span&gt;. An updated application provided by the kind folks from Bladox is up at their forums &lt;a href="http://www.bladox.com/forum/viewtopic.php?t=542&amp;amp;postdays=0&amp;amp;postorder=asc&amp;amp;start=15"&gt;here&lt;/a&gt;. Happy hacking.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>iPhone JTAG Interface discovered</title>
   <link href="http://jasonmadigan.com/2007/08/02/iphone-jtag-interface-discovered" />
   <updated>2007-08-02T00:00:00+01:00</updated>
   <id>http://jasonmadigan.com/2007/08/02/iphone-jtag-interface-discovered</id>
   <content type="html">&lt;p&gt;George Hotz (geohot) over at #iphone.unlock on Undernet finally uncovered the iPhone Baseband&amp;#8217;s (S-Gold 2) &lt;a href="http://en.wikipedia.org/wiki/Joint_Test_Action_Group"&gt;&lt;span class="caps"&gt;JTAG&lt;/span&gt;&lt;/a&gt; interface, which means an unlocking solution (albeit hardware based for the moment) is within reach. Geohot initally thought the &lt;span class="caps"&gt;JTAG&lt;/span&gt; interface may have been been located in the dock, but his search proved fruitless. Accessing these traces is incredibly difficult because the board has many layers and blind via&amp;#8217;s, and in the end could only be done by removing the S-Gold 2 from the baseband board altogether, which meant wrecking the board.&lt;/p&gt;
&lt;p&gt;With this removed geohot found the &lt;span class="caps"&gt;TDI&lt;/span&gt; (Test Data In), &lt;span class="caps"&gt;TDO&lt;/span&gt; (Test Data Out), &lt;span class="caps"&gt;TCK&lt;/span&gt; (Test Clock), &lt;span class="caps"&gt;TMS&lt;/span&gt; (Test Mode Select) and &lt;span class="caps"&gt;TRST&lt;/span&gt; (Test ReSeT) connector pins quite easily. He now has to find a way of powering up the S-Gold 2 with these connectors attached to a &lt;span class="caps"&gt;JTAG&lt;/span&gt; interface, which is going to require a lot of precise soldering. It should result in a hardware (and eventually software) iPhone unlock. You can read more about his efforts &lt;a href="http://iphonejtag.blogspot.com/"&gt;here&lt;/a&gt;.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Even more iPhone first impressions (because I own this one)</title>
   <link href="http://jasonmadigan.com/2007/08/02/even-more-iphone-first-impressions-because-i-own-this-one" />
   <updated>2007-08-02T00:00:00+01:00</updated>
   <id>http://jasonmadigan.com/2007/08/02/even-more-iphone-first-impressions-because-i-own-this-one</id>
   <content type="html">&lt;p&gt;I had a nice surprise waiting for me when I arrived home yesterday. I was like a kid at Christmas opening the box for this thing. I hadn&amp;#8217;t been so excited about a gadget for a long time. As mentioned a few posts ago, I&amp;#8217;d gotten to play with one at work over the past few weeks but nothing compares to owning one and getting to play with one on your own time. The design, as with all things Apple, is elegant, simple and gorgeous. The screen is amazingly bright and it&amp;#8217;s resolution of 320&amp;#215;480 at 160PPI is incredible. In my spare time this evening I&amp;#8217;ve toyed a little with some development/design for an iPhone interface for Runt. I&amp;#8217;ll post some more about this over the next few days or whenever I get a chance. It means so much to have a real browser in a mobile phone.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve seen a lot of poor saps posting about how their plastic N95&amp;#8217;s are a better deal but these people are clearly delusional. The best one has to be &amp;#8220;No &lt;span class="caps"&gt;MMS&lt;/span&gt;? Oh I won&amp;#8217;t buy it so&amp;#8221;. Uh, you have an unlimited data plan and you&amp;#8217;ve got a fantastic handheld email capable device, is this really an issue? If we&amp;#8217;re talking pure design, there&amp;#8217;s just no comparison either. To paraphrase Douglas Adams, the N95 looks as if it had been not so much designed as congealed.I think the only minor niggle I have with the device so far is its mini-jack which makes a lot of headphones not fit. That and the fact that I found the headphones it ships with, much like the iPod&amp;#8217;s, are incredibly painful to wear for more than say, oh, 10 seconds. My ears seem pretty normal to me so I don&amp;#8217;t get it.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Quick &amp; Easy Wordpress Optimisation</title>
   <link href="http://jasonmadigan.com/2007/07/23/quick-and-easy-wordpress-optimisation" />
   <updated>2007-07-23T00:00:00+01:00</updated>
   <id>http://jasonmadigan.com/2007/07/23/quick-and-easy-wordpress-optimisation</id>
   <content type="html">&lt;p&gt;Here&amp;#8217;s two quick and easy steps you can take to increase your Wordpress sites speed:&lt;/p&gt;
&lt;h2&gt;Enable Wordpress&amp;#8217;s Object Caching&lt;/h2&gt;
&lt;p&gt;Add define(&amp;#8216;ENABLE_CACHE&amp;#8217;, true); to your wp-config.php to enable Wordpress&amp;#8217;s built in &lt;a href="http://codex.wordpress.org/Function_Reference/WP_Cache"&gt;object caching&lt;/a&gt; and Wordpress will begin caching all sorts of database queries resulting in an instantaneous performance boost.&lt;/p&gt;
&lt;h2&gt;Install WP-Cache 2&lt;/h2&gt;
&lt;p&gt;&lt;a href="http://mnm.uib.es/gallir/wp-cache-2/"&gt;WP-Cache&lt;/a&gt; is a plugin which serializes and caches posts to disk for quick retrieval. It&amp;#8217;s also smart enough to keep serialized data on the disk up to date so it won&amp;#8217;t serve stale content.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>iPhone - First Impressions</title>
   <link href="http://jasonmadigan.com/2007/07/11/iphone-first-impressions" />
   <updated>2007-07-11T00:00:00+01:00</updated>
   <id>http://jasonmadigan.com/2007/07/11/iphone-first-impressions</id>
   <content type="html">&lt;p&gt;At work today I finally got my hands on an iPhone. It was everything I&amp;#8217;d hoped for. Beautiful design, much smaller than I&amp;#8217;d imagined and pretty sturdy. I played around with viewing a movie, playing with the camera and generally poking about the parts of the phone which didn&amp;#8217;t require the &lt;span class="caps"&gt;GSM&lt;/span&gt; radio. I want one. I mean, I wanted one before but without having held and used one it&amp;#8217;s very easy to dismiss purchasing it by saying to yourself &amp;#8220;Oh, I&amp;#8217;ll wait, you know firsthand what first gen Apple hardware is like&amp;#8221; or &amp;#8220;But, but 3G!&amp;#8221;. I&amp;#8217;m very tempted to take the plunge and import one in the hope that the radio will get unlocked quite soon.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Oh Steve</title>
   <link href="http://jasonmadigan.com/2007/06/13/oh-steve" />
   <updated>2007-06-13T00:00:00+01:00</updated>
   <id>http://jasonmadigan.com/2007/06/13/oh-steve</id>
   <content type="html">&lt;p&gt;You cad, you.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;But but but you guys you don&amp;#8217;t understand! A poorly written application could crash AT&amp;amp;T&amp;#8217;s network!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I&amp;#8217;d sort of expected that Apple would end up giving developers access to a Widget-like &lt;span class="caps"&gt;API&lt;/span&gt; for the iPhone. It&amp;#8217;s disappointing that it turned out to be true but I guess it&amp;#8217;s sort of good news for dorky web developers like me. It&amp;#8217;s still a complete cop-out, though. Regardless of how neat &lt;span class="caps"&gt;AJAX&lt;/span&gt; Web 2.0 (jesus I really hate referring to things as Web 2.0) applications can be made to be to look and perform, it&amp;#8217;s still absolutely no substitute to having access to OS X&amp;#8217;s core cocoa APIs such as Core Image, Core Video, Core Audio and Core Animation (well, assuming the iPhone is running Leopard). Which reminds me, I really should get to leafing through that Objective-C book I bought a while ago.&lt;/p&gt;
&lt;p&gt;All of this raises one question though; why, Apple? Why alienate your third party developers in this way?&lt;/p&gt;
&lt;p&gt;The only theory I have so far as that part of the deal Apple cut with AT&amp;amp;T was that Apple could be the only developer of applications for the iPhone. We&amp;#8217;ll change our network for you if we have a single point of contact should one of your phone&amp;#8217;s applications decide to misbehave. This makes little sense, however, because lots of devices such as Blackberry&amp;#8217;s are capable of running native applications without any such hinderance. As far as I&amp;#8217;m aware, there haven&amp;#8217;t been any reported cases of any such devices causing any problems with cell networks. I don&amp;#8217;t buy that Apple made this decision all by themselves, however. They wouldn&amp;#8217;t alienate their developer community in such a way, surely.&lt;/p&gt;
&lt;p&gt;Which brings us back to AT&amp;amp;T imposing their will on Apple in some way. Of course Steve would never publicly admit to any such thing, which is probably why he was forced to announce some limited form of application development so as to be seen to be in control of the situation. The whole debacle has seen armchair industry pundits from across the world take a break from picking doritos from their neckbeards to immediately blog up the blogosphere with all sorts of nonsense regarding the impending demise of Apple &amp;#8212; something which I find pretty funny.&lt;/p&gt;
&lt;p&gt;The biggest thing announced at this year&amp;#8217;s &lt;span class="caps"&gt;WWDC&lt;/span&gt;, to my mind, is the new Finder.app. It looks great, and it seems to go a long way towards allaying some of my biggest pet peeves with it. I just pray they&amp;#8217;ve finally stopped it excreting all over itself whenever a network share gets dropped. Time Machine also looks a lot cooler and far more useful than I thought it would be, but there still seems to be no word as to whether it uses &lt;span class="caps"&gt;ZFS&lt;/span&gt; or not but I assume Apple wouldn&amp;#8217;t be retarded enough to completely forgo ZFS&amp;#8217;s snapshot mechanism. But then again I assumed Apple wouldn&amp;#8217;t be retarded enough to give third party iPhone application developers the finger.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Why you shouldn't place your trust in someone else's code</title>
   <link href="http://jasonmadigan.com/2007/06/03/why-you-shouldnt-place-your-trust-in-someone-elses-code" />
   <updated>2007-06-03T00:00:00+01:00</updated>
   <id>http://jasonmadigan.com/2007/06/03/why-you-shouldnt-place-your-trust-in-someone-elses-code</id>
   <content type="html">&lt;p&gt;About two years ago I used to regularly play World of Warcraft; something which I&amp;#8217;m not particularly proud of. While doing so I managed and maintained a small community site for our guild. Our guild was comprised of several members of the somethingawful forums and, as such, our humour tended to be a little more odd than most. If you&amp;#8217;ve laughed at something morally bankrupt on the internet, chances are it originated on the forums there. After a few months, we formed a chilled out raidgroup and started regularly raiding dungeons. This meant we&amp;#8217;d need some system for distributing loot amongst ourselves lest we find ourselves in a position where people&amp;#8217;s &lt;a href="http://en.wikipedia.org/wiki/Poopsocking"&gt;poopsockery&lt;/a&gt; go unrewarded. We settled on a system called &lt;span class="caps"&gt;DKP&lt;/span&gt;, or Dragon Kill Points. Basically when you attend raids you bid on loot, and your bid is divided amongst all those present such that people who attend more get more loot. To implement this, we settled with a popular &lt;span class="caps"&gt;PHP&lt;/span&gt; script called &lt;a href="http://www.eqdkp.com"&gt;&lt;span class="caps"&gt;EQDKP&lt;/span&gt;&lt;/a&gt; to manage our points.&lt;/p&gt;
&lt;p&gt;Anyway, I installed &lt;span class="caps"&gt;EQDKP&lt;/span&gt; and because I was busy at the time and because I&amp;#8217;m pretty lazy, I never really got a chance to read around the applications code. Pretty much everyone else is using this so I&amp;#8217;m sure it&amp;#8217;s reasonably secure, right?&lt;/p&gt;
&lt;p&gt;I quit playing World of Warcraft last August after realising that game was a complete sack of shit and spending so much time playing it was completely retarded. I continued to maintain the guild&amp;#8217;s website in the meantime before eventually passing it on to a fellow web developer guild-member a week ago. While rsync&amp;#8217;ing, out of boredom, I decided to peruse EQDKP&amp;#8217;s source. I started to become very nervous. This code had been running for almost a year on my box?&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="php"&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class="c1"&gt;// First things first - a small amount of security&lt;/span&gt;
&lt;span class="c1"&gt;// This script is *so* hackable as to not be funny&lt;/span&gt;
&lt;span class="c1"&gt;// The possible benefit (IMO) outweighs the possible security&lt;/span&gt;
&lt;span class="c1"&gt;// issue with referrer hacking tho// Check that the visitor&amp;#39;s referrer was a page within your own site.&lt;/span&gt;
&lt;span class="c1"&gt;// Copyright 2001 Tim Green&lt;/span&gt;
&lt;span class="c1"&gt;// http://www.dwfaq.com/snippets/snippet_details.asp?SnipID=51&lt;/span&gt;

&lt;span class="nv"&gt;$tg__ServerName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;explode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;.&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nb"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;SERVER_NAME&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="nv"&gt;$tg__server&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$tg__ServerName&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$tg__ServerName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;.&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;$tg__ServerName&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$tg__ServerName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="nv"&gt;$tg__Referred&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;HTTP_REFERER&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Get host name from URL&lt;/span&gt;
&lt;span class="nb"&gt;preg_match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/^(http://)?([^/]+)/i&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$tg__Referred&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$tg__RefHost&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nv"&gt;$tg__Host&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$tg__RefHost&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="nb"&gt;preg_match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/[^./]+.[^./]+$/&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$tg__Host&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$tg__RefHost&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$tg__RefHost&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="nv"&gt;$tg__server&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
	&lt;span class="c1"&gt;// Change the location to your desired page&lt;/span&gt;
	&lt;span class="nb"&gt;header&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Location: ./../../viewnews.php&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Now start the &amp;quot;stuff&amp;quot; &lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="x"&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;blockquote&gt;
&lt;p&gt;This script is &lt;strong&gt;so&lt;/strong&gt; hackable as to not be funny. The possible benefit (&lt;span class="caps"&gt;IMO&lt;/span&gt;) outweighs the possible security issue with referrer hacking tho.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I&amp;#8230; I.. Jesus Christ.&lt;/p&gt;
&lt;p&gt;So, to access EQDKP&amp;#8217;s database backup functionality within it&amp;#8217;s admin panel all we have to do is point a browser to:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;http://myguild.com/eqdkp/admin/backup&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;And spoof &lt;span class="caps"&gt;HTTP&lt;/span&gt; request referral to read:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;http://myguild.com/eqdkp/admin/&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;That&amp;#8217;s it, you&amp;#8217;ve now got full access to EQDKP&amp;#8217;s database, we&amp;#8217;re even presented with a nice interface to dump the database&amp;#8217;s contents.&lt;/p&gt;
&lt;p&gt;As if this isn&amp;#8217;t retarded enough, &lt;span class="caps"&gt;EQDKP&lt;/span&gt; doesn&amp;#8217;t salt its user&amp;#8217;s passwords prior to hashing them. With this in mind we can fire up whichever web version of RainbowCrack is currently not serving up 404&amp;#8217;s and we have the user&amp;#8217;s plaintext password. We could also dump the database and change the administrators password to one of our choosing by simply replacing the hash (since it&amp;#8217;s not salted). People being people, we tend to use the same password for pretty much everything. Our email, PayPal, banking details etc., all compromised by one shitty script.  Pretty scary, eh?&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Runt - SVG &amp; Rails</title>
   <link href="http://jasonmadigan.com/2007/05/28/runt-svg-and-rails" />
   <updated>2007-05-28T00:00:00+01:00</updated>
   <id>http://jasonmadigan.com/2007/05/28/runt-svg-and-rails</id>
   <content type="html">&lt;p&gt;While developing Runt over the past few months it became obvious mid-way through development that the integration of graphing was somewhat of an afterthought. That&amp;#8217;s okay though because we&amp;#8217;re agile, right?&lt;/p&gt;
&lt;p&gt;Graphing &lt;span class="caps"&gt;SNMP&lt;/span&gt; data in Rails applications (or any other application for that matter) is difficult for a number of reasons:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;What the hell do I graph?
	&lt;ul&gt;
		&lt;li&gt;&lt;span class="caps"&gt;SNMP&lt;/span&gt; data is so varied in scope that we need to narrow our scope in order to graph something useful. We don&amp;#8217;t want to graph &lt;strong&gt;sysName&lt;/strong&gt; against &lt;strong&gt;sysDescr&lt;/strong&gt; because that&amp;#8217;s retarded and completely useless.&lt;/li&gt;
		&lt;li&gt;Graphs obviously need need be composed of numerical data, so any &lt;span class="caps"&gt;SNMP&lt;/span&gt; data composed of strings is likely going to be useless.&lt;/li&gt;
	&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;Right, so what kind of data types should we be looking at (assuming we&amp;#8217;re working with protocol version 2c)?
	&lt;ul&gt;
		&lt;li&gt;Integer32/Integer (Enumerated)/Unsigned32/Gauge32/Counter32/TimeTicks/Opaque/Bits&lt;/li&gt;
	&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With these data types in mind, our scope is still way too vague for us to be able to graph any meaningful data. With a deadline looming, I made the decision to limit the scope of graphing in Runt to just bandwidth, something which most &lt;span class="caps"&gt;SNMP&lt;/span&gt; graphing applications out there focus on (&lt;a href="http://oss.oetiker.ch/mrtg/"&gt;&lt;span class="caps"&gt;MRTG&lt;/span&gt;&lt;/a&gt; for example). Having made my decision I was then faced with some interesting decisions regarding graphing. Initially I wanted graphing to be as sexy as that found in the &lt;a href="http://www.polarcloud.com/tomato/"&gt;Tomato&lt;/a&gt; firmware installed on my WRT54GL router.&lt;/p&gt;
&lt;p&gt;Tomato generates its graphs in between &lt;span class="caps"&gt;AJAX&lt;/span&gt; requests and renders them to the user using &lt;a href="http://en.wikipedia.org/wiki/Scalable_Vector_Graphics"&gt;&lt;span class="caps"&gt;SVG&lt;/span&gt;&lt;/a&gt;. Unfortunately, browser &lt;span class="caps"&gt;SVG&lt;/span&gt; support is patchy for Intel Mac users with Safari 2.0.4 (even though &lt;span class="caps"&gt;SVG&lt;/span&gt; support landed in WebKit landed &lt;a href="http://webkit.org/blog/?p=35"&gt;over two years ago&lt;/a&gt;). Adobe have offered a plugin for &lt;span class="caps"&gt;SVG&lt;/span&gt; support in Safari (which is going to be unsupported next year), but only for users running Safari on PowerPC Macs. As an Intel user you could of course run Safari under Rosetta to enable the plugin to function but jesus don&amp;#8217;t. Thankfully &lt;span class="caps"&gt;SVG&lt;/span&gt; support will finally find its way into Safari 3.0 in Leopard, but that&amp;#8217;s several months away. IE6/7 users enjoy &lt;span class="caps"&gt;SVG&lt;/span&gt; support through the same Adobe plugin, while Gecko based browser users see &lt;span class="caps"&gt;SVG&lt;/span&gt; built-in.&lt;/p&gt;
&lt;p&gt;With this in mind, and due to the fact I&amp;#8217;m a selfish jerk who uses Safari, I decided against using &lt;span class="caps"&gt;SVG&lt;/span&gt; in Runt, at least for the time being. My options for graphing in Rails boiled down to three contenders:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://nubyonrails.com/pages/gruff"&gt;Gruff&lt;/a&gt; &amp;#8211; pretty graphs that are rendered as PNGs. Rails plugin.&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://scruffy.rubyforge.org/"&gt;Scruffy&lt;/a&gt; &amp;#8211;  &amp;#8211; pretty graphs, internally rendered using &lt;span class="caps"&gt;SVG&lt;/span&gt; and it can spit out your graphs in pretty much any format imaginable. Unfortunately it hasn&amp;#8217;t been updated in over 9 months.&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://ziya.liquidrail.com/"&gt;ZiYa&lt;/a&gt; &amp;#8211; pretty Flash graphs. Flash, ugh.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I eventually rolled with Gruff since I found it the easiest to get to grips with and because it somehow &lt;strong&gt;felt&lt;/strong&gt; more Rails like than the others. I was seriously considering ZiYA for several weeks but considering how much I&amp;#8217;ve come to hate almost all implementations of Flash &amp;#8220;hay guys lets totally offload the rendering of this website to some proprietary plugin! This is a great idea, right guys! Guys?!&amp;#8221; I decided it was best to roll with something I could stomach myself using. Unfortunately, this meant that interactivity with the graph was going to be seriously limited as Gruff was just going to throw rendered PNGs at a user with a rather horrible rendering delay between &lt;span class="caps"&gt;AJAX&lt;/span&gt; requests. This is something that has bothered me ever since I chose to use Gruff, but what&amp;#8217;s done is done.&lt;/p&gt;
&lt;p&gt;The next iteration of Runt will see me revisit the idea of using &lt;span class="caps"&gt;SVG&lt;/span&gt; rendering because it&amp;#8217;s sexy as hell and because, for the time being at least, I&amp;#8217;ve begun using Firefox 2.0 regularly once more.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Out with the old</title>
   <link href="http://jasonmadigan.com/2007/05/21/out-with-the-old" />
   <updated>2007-05-21T00:00:00+01:00</updated>
   <id>http://jasonmadigan.com/2007/05/21/out-with-the-old</id>
   <content type="html">&lt;p&gt;In the midst of some downtime, I finally got around to doing something I&amp;#8217;d planned to do for 2 or 3 years; give &lt;a href="http://www.autosystems.ie/"&gt;autosystems.ie&lt;/a&gt; a complete rewrite/redesign. At the moment the homepage is a mess of static content and things don&amp;#8217;t get much better when we look at the shopping cart system. The shopping cart as it stands right now is a pretty hacked up version of &lt;a href="http://www.oscommerce.com/"&gt;OSCommerce&lt;/a&gt; which has been slowly disintegrating over the past year. No less than 4 times in the past year I&amp;#8217;ve had a call from my brother where it had broken unexpectedly, seemingly without any user interaction whatsoever.&lt;/p&gt;
&lt;p&gt;So I decided to set about developing a really simple shopping cart system which would be a snap to maintain and which my brother would find easy to use. I also needed to implement a really lightweight &lt;span class="caps"&gt;CMS&lt;/span&gt; so that he could change some page elements on the homepage informing people of new offers and the like. 4 hours later and I&amp;#8217;ve got a pretty nifty Ajax shopping cart system working. There&amp;#8217;s still quite a bit to do (payment functionality with PayPal/Authorize.net for one) but on the whole I&amp;#8217;m amazed at how quickly it came together. Well, maybe not that amazed, I have been using it to develop Runt over the past few months.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Runt - almost ready for release</title>
   <link href="http://jasonmadigan.com/2007/05/19/runt-almost-ready-for-release" />
   <updated>2007-05-19T00:00:00+01:00</updated>
   <id>http://jasonmadigan.com/2007/05/19/runt-almost-ready-for-release</id>
   <content type="html">&lt;p&gt;For the past few months at &lt;a href="http://www.wit.ie/"&gt;college&lt;/a&gt; I&amp;#8217;ve been developing a web-based Rails application called Runt; Ruby Network Tool. It&amp;#8217;s a small application which displays nicely formatted, up to the second &lt;span class="caps"&gt;SNMP&lt;/span&gt; data from pretty much any device attached to your network. If you&amp;#8217;re after specific data from specific devices, you simply load a custom &lt;span class="caps"&gt;MIB&lt;/span&gt; for that device and Runt can get data from it. It features a sort of tacked on ability to graph interface traffic for a given device also, but it really doesn&amp;#8217;t feel all that at home in the application itself at the moment for a variety of reasons. I&amp;#8217;d like to expand upon this a lot with later releases, but I find myself hindered with current browser &lt;span class="caps"&gt;SVG&lt;/span&gt; support (at the moment &lt;span class="caps"&gt;RUNT&lt;/span&gt; uses Gruff to generate static &lt;span class="caps"&gt;PNG&lt;/span&gt; graphs each pass).&lt;/p&gt;
&lt;p&gt;The response from the demonstrations I&amp;#8217;ve done over the past few months has been encouraging but the codebase remains a bit too clumsy for my liking to release it to the general public, at least not yet anyway. It had been my first foray into the world of both Ruby and Rails so there&amp;#8217;s a lot of cruft which needs reworking.&lt;/p&gt;
&lt;p&gt;The version which I&amp;#8217;ll release will be v0.1, and I have a lot of other functionality planned for v0.2. One of the biggest problems I encountered while developing the application was finding myself constantly hindered by the very nature of web-based applications &amp;#8211; they sort of need interaction before they&amp;#8217;ll do things. As a result, v0.2 will see a lot of functionality handled by a Ruby daemon (using &lt;a href="http://backgroundrb.rubyforge.org/"&gt;BackgrounDRb&lt;/a&gt;) such as graphing and some cool alerting functionality through &lt;span class="caps"&gt;SMS&lt;/span&gt; should certain user specified conditions arise like a device fails to respond to &lt;span class="caps"&gt;SNMP&lt;/span&gt; requests.&lt;/p&gt;
&lt;p&gt;One thing I will say about this learning experience is that I&amp;#8217;m quickly understanding why so many developers are using both Rails and Ruby for development, regardless of of their rather sluggish performance in comparison to say Django and Python. There&amp;#8217;s just something about blocks like&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="n"&gt;foo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;foo&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;collect&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;bar&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;bar&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;# =&amp;gt; [16, 32, 48, 64, 80]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;which make me consider how amazingly eloquent Ruby really is. I&amp;#8217;m having a blast with this stuff.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Bloggin' the Blogosphere (Web two point oh)</title>
   <link href="http://jasonmadigan.com/2007/05/19/bloggin-the-blogosphere-web-two-point-oh" />
   <updated>2007-05-19T00:00:00+01:00</updated>
   <id>http://jasonmadigan.com/2007/05/19/bloggin-the-blogosphere-web-two-point-oh</id>
   <content type="html">&lt;p&gt;I never thought I&amp;#8217;d actually have any use for a blog (and to be honest I&amp;#8217;d always found myself struggling to see why other people needed them too), but I guess what with working on new projects and having finally completed college I could do with some place to organise my ramblings, so here we are.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;d been meaning to put together an online portfolio with quite some time now, so I guess now is as good a time as any.&lt;/p&gt;</content>
 </entry>
 
 
</feed>

