<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/1.5.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
	<title>/dev/random</title>
	<link>http://www.codymays.net</link>
	<description>The CPUID of my brain...</description>
	<pubDate>Fri, 28 Dec 2007 01:41:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=1.5.2</generator>
	<language>en</language>

		<item>
		<title>Activate your iPhone without AT&#038;T with tools.zip</title>
		<link>http://www.codymays.net/content/2007/07/04/activate-your-iphone-without-att-with-toolszip/</link>
		<comments>http://www.codymays.net/content/2007/07/04/activate-your-iphone-without-att-with-toolszip/#comments</comments>
		<pubDate>Wed, 04 Jul 2007 21:09:32 +0000</pubDate>
		<dc:creator>Cody Mays</dc:creator>
		
	<category>Uncategorized</category>
	<category>Geekery</category>
	<category>C/C++</category>
	<category>Programming</category>
	<category>Tips and Tricks</category>
	<category>Geek Humor</category>
	<category>Personal</category>
	<category>Daily Grindage</category>
	<category>Experiences</category>
	<category>Apple</category>
	<category>iPhone</category>
		<guid>http://www.codymays.net/content/2007/07/04/activate-your-iphone-without-att-with-toolszip/</guid>
		<description><![CDATA[	After hanging around the osx86 crew last night on IRC, I found out that they had finally cracked the activation service and made a proof of concept tool that would activate the iPhone with a plist file. The developers refused to release the actual tokens that needed to  be embedded inside the plist file [...]]]></description>
			<content:encoded><![CDATA[	<p>After hanging around the osx86 crew last night on IRC, I found out that they had finally cracked the activation service and made a proof of concept tool that would activate the iPhone with a plist file. The developers refused to release the actual tokens that needed to  be embedded inside the plist file for activation though, for good reason, as they are <a href="http://www.nanocrew.net/">DVD Jon&#8217;s</a>.</p>
	<p>Now, they did tell me one thing. The keys are embedded in the .NET binary in JLJ&#8217;s iPhone activation server. So I began working and this led to where I&#8217;m at now, a how-to. This post will <strong>not</strong> provide the tokens, nor will I provide them until JLJ says I can. This article will walk you through the process of obtaining them so you can activate your iPhone on a mac though, as suggested by the developers of the tool.zip we will be using.<br />
<strong>As of now, you can just download <a hrefhttp://iphone.fiveforty.net/wiki/index.php/IPhoneActivatorTool">the newly released iPhoneActivatorTool</a> to activate your phone. This is a newer version of tool.zip that includes the plist file required.</strong></p>
	<p><strong>Step 1:</strong><br />
Download the following files:</p>
	<ul>
	<li><a href="http://www.nanocrew.net/wp-content/PhoneActSrv-v1.0.zip">JLJ&#8217;s PhoneActSrv</a> - <a href="http://sonicfiber.com/iphone/PhoneActSrv-v1.0.zip">Mirror</a></li>
	<li><a href="http://lpahome.com/iPhone/tool.zip">tool.zip</a>  - <a href="http://www.codymays.net/files/iphonetool.zip">mirror</a></li>
	<li><a href="http://www.codymays.net/files/iPhone_decrypt.zip">My iPhone Decrypt App</a></li>
	<li><a href="http://www.aisto.com/roeder/dotnet/Download.aspx?File=Reflector">Lutz Roeder&#8217;s Reflector .NET disassembler</a></li>
	</ul>
	<p><strong>Step 2:</strong><br />
This step is where you&#8217;ll actually prepare the data you need to get. You will need windows with .NET framework 2.0+. JLJ&#8217;s PhoneActSrv&#8217;s binary has the keys stored within it, encrypted using AES. In order to get the keys, we need to disassemble the binary. To do this, you need to open up Reflector and go to File->Open then locate and open the PhoneActSrv.exe file.</p>
	<p>Once it&#8217;s loaded, you will see the entry in the tree view. Right click on PhoneActSrv and click Export. Make sure you save this somewhere that you will remember, you will spend a lot of time looking at the disassembly. You also need access to it over the mac.</p>
	<p><strong>Step 3:</strong><br />
Now, open the directory you saved the disassembly files to. You should see the following files:</p>
	<ul>
	<li>a.cs</li>
	<li>b.cs</li>
	<li>AssemblyInfo.cs</li>
	<li>d.cs</li>
	<li>DotfuscatorAttribute.cs</li>
	<li>e.cs</li>
	<li>e.resources</li>
	<li>f.resources</li>
	<li>Global.cs</li>
	<li>PhoneActSrv.csproj</li>
	</ul>
	<p>If you see these files, you did step 2 correct. If not, go back and do it again. This is where you may need some coding experience, as I can&#8217;t just hand these keys out. I provide you with enough hints that I feel you can find the keys. Unzip my iPhone Decrypt application and open up iphone_decrypt.c and read the comments. For each variable needed, I provide you with a hint on how to find it. All the values needed are located in the d.cs file.</p>
	<p>Once you find them, plug the values into their appropriate arrays in iphone_decrypt.c. Once you have what you think are the values, open up a terminal, go to the directory iphone_decrypt.c is located in and run the following in console.</p>
	<blockquote><p>
$ ./build.sh<br />
$ chmod +x iphone_decrypt<br />
$ ./iphone_decrypt
</p></blockquote>
	<p>If all goes well, you should see something like the following on the terminal:</p>
	<pre>
kalashnikov:~/Desktop/iPhone-RE/AES decrypt cody$ ./build.sh
kalashnikov:~/Desktop/iPhone-RE/AES decrypt cody$ ./iphone_decrypt
Welcome to the iPhone JLJ key decryptor. Find the data in his app and set the variables in the code to this one.
Setting AES key...done
---1076
Attempting to decrypt the key...done
Key is &lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
&lt;Document xmlns="http://www.apple.com/itms/" disableHistory="true" disableNavigation="true"&gt;
&amp;nbsp;
&lt;Protocol&gt;
    &lt;plist version="1.0"&gt;
        &lt;dict&gt;
	
          &lt;key&gt;iphone-activation&lt;/key&gt;
          &lt;dict&gt;
            &lt;key&gt;unbrick&lt;/key&gt;
            &lt;true/&gt;
            &lt;key&gt;activation-record&lt;/key&gt;
            &lt;dict&gt;
              &lt;key&gt;AccountToken&lt;/key&gt;&lt;data&gt;*snip*&lt;/data&gt;
              &lt;key&gt;AccountTokenSignature&lt;/key&gt;&lt;data&gt;*snip*/data&gt;
            &lt;/dict&gt;
          &lt;/dict&gt;
	
        &lt;/dict&gt;
    &lt;/plist&gt;
&lt;/Protocol&gt;
&amp;nbsp;
&lt;/Document&gt;??V?n9???lsQ?
Freeing up memory...done
</pre>
	<p>If you do, move onto step 4, if not, keep trying.</p>
	<p><strong>Step 4:</strong><br />
Unzip tool.zip and open up the blank.plist file in something like textmate. It&#8217;s just an XML file. blank.plist contains the following:</p>
	<pre>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
	&lt;key&gt;ActivationRecord&lt;/key&gt;
	&lt;dict&gt;
		&lt;key&gt;AccountToken&lt;/key&gt;
		&lt;data&gt;
		&lt;/data&gt;
		&lt;key&gt;AccountTokenCertificate&lt;/key&gt;
		&lt;data&gt;
		&lt;/data&gt;
		&lt;key&gt;AccountTokenSignature&lt;/key&gt;
		&lt;data&gt;
		&lt;/data&gt;
		&lt;key&gt;DeviceCertificate&lt;/key&gt;
		&lt;data&gt;
		&lt;/data&gt;
		&lt;key&gt;FairPlayKeyData&lt;/key&gt;
		&lt;data&gt;
		&lt;/data&gt;
	&lt;/dict&gt;
	&lt;key&gt;Request&lt;/key&gt;
	&lt;string&gt;Activate&lt;/string&gt;
	
&lt;/dict&gt;
&lt;/plist&gt;
</pre>
	<p>Copy the <key>AccountToken</key> and <key>AccountTokenCertificate</key> lines and their data lines from the console output of iphone_decrypt. Paste them into the plist file so that it looks like the following:</p>
	<pre>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
	&lt;key&gt;ActivationRecord&lt;/key&gt;
	&lt;dict&gt;
		&lt;key&gt;AccountToken&lt;/key&gt;&lt;data&gt;*snip*&lt;/data&gt;
	              &lt;key&gt;AccountTokenSignature&lt;/key&gt;&lt;data&gt;*snip*&lt;/data&gt;
	&lt;/dict&gt;
	&lt;key&gt;Request&lt;/key&gt;
	&lt;string&gt;Activate&lt;/string&gt;
	
&lt;/dict&gt;
&lt;/plist&gt;
</pre>
	<p>Save this file as activate.plist in the same directory as blank.plist</p>
	<p><strong>Step 5:</strong><br />
Activate your iPhone by running the following command in the terminal after changing to the directory that blank.plist is located in.</p>
	<pre>
$ ./tool --activate activate.plist
</pre>
	<p>You should see the following output on the console:</p>
	<blockquote><p>
kalashnikov:~/Desktop/tool Folder cody$ ./tool &#8211;activate test.plist<br />
iPhoneActivatorTool 1.0<br />
2007-07-04 15:10:43.887 tool[10443] Found iPhone Device: 1<br />
2007-07-04 15:10:43.887 tool[10443] Connecting&#8230;<br />
2007-07-04 15:10:43.892 tool[10443] Checking Pairing&#8230;<br />
2007-07-04 15:10:43.905 tool[10443] Starting device session&#8230;<br />
2007-07-04 15:10:43.990 tool[10443] ActivationState: Unactivated<br />
2007-07-04 15:10:43.990 tool[10443] Deactivating your iPhone&#8230;<br />
2007-07-04 15:10:44.002 tool[10443] New ActivationState: Unactivated<br />
2007-07-04 15:10:44.003 tool[10443] Activating your iPhone&#8230;<br />
2007-07-04 15:10:44.163 tool[10443] New ActivationState: MismatchedICCID<br />
2007-07-04 15:10:44.163 tool[10443] Your iPhone was successfully activated.
</p></blockquote>
	<p>You will probably see a popup about your iPhone having an incorrect SIM card. Just slide the unlock slider at the bottom to the right and you should be ready to go.<br />
<img src="http://static.zooomr.com/images/2628376_c134810573.jpg?r=360" alt="iphone">
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.codymays.net/content/2007/07/04/activate-your-iphone-without-att-with-toolszip/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>NetBSD 3.0 Release Now runs on the bebox</title>
		<link>http://www.codymays.net/content/2006/10/09/netbsd-30-release-now-runs-on-the-bebox/</link>
		<comments>http://www.codymays.net/content/2006/10/09/netbsd-30-release-now-runs-on-the-bebox/#comments</comments>
		<pubDate>Mon, 09 Oct 2006 23:29:47 +0000</pubDate>
		<dc:creator>Cody Mays</dc:creator>
		
	<category>Geekery</category>
	<category>C/C++</category>
	<category>Programming</category>
	<category>FreeBSD</category>
	<category>Operating System Development</category>
	<category>Tips and Tricks</category>
	<category>Personal</category>
	<category>Daily Grindage</category>
	<category>Experiences</category>
	<category>NetBSD</category>
		<guid>http://www.codymays.net/content/2006/10/09/netbsd-30-release-now-runs-on-the-bebox/</guid>
		<description><![CDATA[	As some of you know, and some of you don&#8217;t, last weekend was the 2nd NetBSD bugathon. Over 300 bugs have been reported as fixed and over 97 people joined the IRC channel to help out and talk about their ideas, I was one of them.  I spent a lot of yesterday, in between [...]]]></description>
			<content:encoded><![CDATA[	<p>As some of you know, and some of you don&#8217;t, last weekend was the 2nd NetBSD bugathon. Over 300 bugs have been reported as fixed and over 97 people joined the IRC channel to help out and talk about their ideas, I was one of them.  I spent a lot of yesterday, in between homework assignments, chatting to a few of the developers about getting NetBSD/BeBox running again, and I succeeded.</p>
	<p>Currently, the only thing you have to do to get NetBSD 3.0 Release to compile is edit the list file that has two entries for pte.h, one marking it obsolete and one marking it not. Remove the line marking it non-obsolete and compile as the handbook says with build.sh.</p>
	<p>The good news to come from this is that one of the developers instructed to get the port updated was there. He doesn&#8217;t have a bebox, so he didn&#8217;t want to do it blindly. He asked me to assist him with getting it up-to-date. So not only was yesterday the first day that NetBSD 3.0 has run on the bebox, as far as I know, but it also marks my slow journey back into an open source project. (I&#8217;m not going to get near as involved this time.)</p>
	<p>Here are some pics to drool over, click for larger versions:</p>
	<div style="width:500px;text-align:right;"><a href="http://beta.zooomr.com/photos/codymays/258388/" title="Zooomr Photo Sharing :: Photo Sharing"><img src="http://static.zooomr.com/images/258388_7896db3b50.jpg" width="500" height="376" alt="NetBSD 3.0 on bebox" border="0" style="border:1px solid #000;" /></a><span style="float:left;">NetBSD 3.0 on bebox</span> Hosted on <strong>Zooom<span style="color:#9EAE15;">r</span></strong></div>
	<div style="width:500px;text-align:right;"><a href="http://beta.zooomr.com/photos/codymays/258387/" title="Zooomr Photo Sharing :: Photo Sharing"><img src="http://static.zooomr.com/images/258387_7261c2e99f.jpg" width="500" height="376" alt="NetBSD 3.0 on bebox" border="0" style="border:1px solid #000;" /></a><span style="float:left;">NetBSD 3.0 on bebox</span> Hosted on <strong>Zooom<span style="color:#9EAE15;">r</span></strong></div>
]]></content:encoded>
			<wfw:commentRSS>http://www.codymays.net/content/2006/10/09/netbsd-30-release-now-runs-on-the-bebox/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>PowahPC</title>
		<link>http://www.codymays.net/content/2006/08/09/powahpc/</link>
		<comments>http://www.codymays.net/content/2006/08/09/powahpc/#comments</comments>
		<pubDate>Wed, 09 Aug 2006 05:16:29 +0000</pubDate>
		<dc:creator>Cody Mays</dc:creator>
		
	<category>Geekery</category>
	<category>C/C++</category>
	<category>Programming</category>
	<category>Web Development</category>
	<category>Operating System Development</category>
	<category>Personal</category>
	<category>Daily Grindage</category>
	<category>Experiences</category>
	<category>Reading</category>
	<category>Web 2.0</category>
		<guid>http://www.codymays.net/content/2006/08/09/powahpc/</guid>
		<description><![CDATA[	Well, i spent the last hour and a half reading up on PowerPC assembly code. It&#8217;s definitely interesting coming from an 80&#215;86 background. (Even though I knew very little x86 assembly) I will say one thing right now, I can imagine it being pretty odd pulling all nighters with ppc asm, since there is no [...]]]></description>
			<content:encoded><![CDATA[	<p>Well, i spent the last hour and a half reading up on PowerPC assembly code. It&#8217;s definitely interesting coming from an 80&#215;86 background. (Even though I knew very little x86 assembly) I will say one thing right now, I can imagine it being pretty odd pulling all nighters with ppc asm, since there is no way to distinguish the type or register you are modifying. They are identified by just a digit, 1-32.</p>
	<p>I definitely find the architecture to be cool though. One of the really nice things about it, is the insane backwards compatibility with 32bit ppc apps on ppc64 machines. The binaries usually work just great. Unlike going to longmode, where you have to actually try in the kernel so you have 32bit support.</p>
	<p>For those of you who don&#8217;t know, I&#8217;m planning on porting <a href="http://www.illusionos.org">my OS</a> to my BeBox as soon as I have enough knowledge of the architecture. Hopefully, I can manage to get another OS going in the process too, maybe updating the netbsd port of porting haiku?</p>
	<p>I would also like to say that the <a href="http://www.threadbound.com">ThreadBound</a> teaser page has done better than I thought it would in one day. We&#8217;ve already got quite a few email address sign up for the updates. Keep them coming. :)</p>
	<p>If I don&#8217;t update for a while, I&#8217;m rushing to get my summer assignment finished. I have a huge precal packet to do and a report on Fahrenheit 451 and I haven&#8217;t started to read it yet&#8230;
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.codymays.net/content/2006/08/09/powahpc/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>Current Ideas</title>
		<link>http://www.codymays.net/content/2006/05/20/current-ideas/</link>
		<comments>http://www.codymays.net/content/2006/05/20/current-ideas/#comments</comments>
		<pubDate>Sun, 21 May 2006 04:21:16 +0000</pubDate>
		<dc:creator>Cody Mays</dc:creator>
		
	<category>Geekery</category>
	<category>Site News</category>
	<category>PHP</category>
	<category>C/C++</category>
	<category>Programming</category>
	<category>Web Development</category>
	<category>FreeBSD</category>
	<category>Personal</category>
	<category>Daily Grindage</category>
	<category>Experiences</category>
	<category>Web 2.0</category>
		<guid>http://www.codymays.net/content/2006/05/20/current-ideas/</guid>
		<description><![CDATA[	So today I did some more research for my new site. I into memcached and XMPP. You have to admit, for as much as the LiveJournal site is put down in the technology area on the web, they have some really cool technologies that were developed behind the scenes, memcached being one of them. Many [...]]]></description>
			<content:encoded><![CDATA[	<p>So today I did some more research for my new site. I into <a href="http://www.danga.com/memcached/">memcached</a> and <a href="http://www.xmpp.org/">XMPP</a>. You have to admit, for as much as the LiveJournal site is put down in the technology area on the web, they have some really cool technologies that were developed behind the scenes, memcached being one of them. Many people don&#8217;t even realise this, but memcached alone is used by many really large sites, such as sourceforge.net and slashdot.org. I will be using it in my new site as well, if things go as planned. (I haven&#8217;t messed with it on BSD yet)</p>
	<p>XMPP is the really nice XML based protocol that <a href="http://www.jabber.org/">Jabber</a> uses. Not only does it allow secure remote logins, but it can be used from all over the place. To top that off, the actual XMPP or Jabberd doesn&#8217;t have to be open to the public pool, how Gtalk was when it first came out. </p>
	<p>I REALLY like this protocal and I&#8217;m trying to find a nice implementation to play with. If I don&#8217;t find one, I will probably strip the JayantHTTPD code base and start reading the RFC for the protocol. Hopefully, I can get a server up and mod it to do authentication from a local database.</p>
	<p>Either way, I&#8217;ll be playing with it from the web. My new site needs global accounts that can be accessed from around the internet, similar to <a href="http://openid.net/">OpenID</a>. If I can keep this method fast and simple to work with, I&#8217;ll be extremely happy.</p>
	<p>Oh, and in other news, I have a work-in-progress mockup of the new design for this slum. See it <a href="http://crxgames.com/cody/blog">here.</a> Let me know what you think!
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.codymays.net/content/2006/05/20/current-ideas/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>Jayant Serves!</title>
		<link>http://www.codymays.net/content/2006/03/18/jayant-serves/</link>
		<comments>http://www.codymays.net/content/2006/03/18/jayant-serves/#comments</comments>
		<pubDate>Sat, 18 Mar 2006 05:47:29 +0000</pubDate>
		<dc:creator>Cody Mays</dc:creator>
		
	<category>Geekery</category>
	<category>C/C++</category>
	<category>Programming</category>
	<category>Personal</category>
	<category>Daily Grindage</category>
	<category>Experiences</category>
		<guid>http://www.codymays.net/content/2006/03/18/jayant-serves/</guid>
		<description><![CDATA[	I got the bug worked out of Jayant today. It can now serve 10,000 concurrent requests in a measly 3.7 seconds according to apachebench. :) The bug was that recv was returning 0 due to it receiving no data. I never checked for zero, but only negative one, so the thread would sit in an [...]]]></description>
			<content:encoded><![CDATA[	<p>I got the bug worked out of Jayant today. It can now serve 10,000 concurrent requests in a measly 3.7 seconds according to apachebench. :) The bug was that recv was returning 0 due to it receiving no data. I never checked for zero, but only negative one, so the thread would sit in an infinite loop. </p>
	<p>A release should be coming soon, I started the subversion repository today and setup the cia.navi.cx hookscripts. </p>
	<p>You may have noticed this site was down today for about two hours. I upgraded my server&#8217;s php installation and all the modules with it, so hopefully we get some performance benefits, but I doubt it. At least we know there are less bugs in the setup. :)</p>
	<p>More tomorrow, for now bed.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.codymays.net/content/2006/03/18/jayant-serves/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>pthreads - the love hate relationship</title>
		<link>http://www.codymays.net/content/2006/03/12/pthreads-the-love-hate-relationship/</link>
		<comments>http://www.codymays.net/content/2006/03/12/pthreads-the-love-hate-relationship/#comments</comments>
		<pubDate>Mon, 13 Mar 2006 04:03:30 +0000</pubDate>
		<dc:creator>Cody Mays</dc:creator>
		
	<category>Geekery</category>
	<category>C/C++</category>
	<category>Programming</category>
	<category>Personal</category>
	<category>Daily Grindage</category>
	<category>Experiences</category>
		<guid>http://www.codymays.net/content/2006/03/12/pthreads-the-love-hate-relationship/</guid>
		<description><![CDATA[	Since Friday afternoon, I have been working on JayantHTTPD trying to get it to serve up pages threaded style, using a worker thread model. It took research on Friday night and all day Saturday to get it going, but I have succeeded. 
	The first main issue I had was figuring out how to dynamically allocate [...]]]></description>
			<content:encoded><![CDATA[	<p>Since Friday afternoon, I have been working on JayantHTTPD trying to get it to serve up pages threaded style, using a worker thread model. It took research on Friday night and all day Saturday to get it going, but I have succeeded. </p>
	<p>The first main issue I had was figuring out how to dynamically allocate an array for the number of threads set in the configuration file. Since I&#8217;m used to C++, we never malloc&#8217;d our arrays, we used things like std::vector. The solution to this issue was amazingly simplistic. Just a threadinfo_t* workers = (threadinfo_t*)malloc((sizeof(thread_info_t)*server->maxthreads)); :)</p>
	<p>The next bug I found coming from the old crappy threading system was that it closed stdin, stdout, and stderr&#8230; I have no clue how I didn&#8217;t see this, nor why I&#8217;m even mentioning this embarrassing, n00by mistake, but I am.</p>
	<p>Then once I had all of this handled, I had the file descriptors getting completely owned. I&#8217;m still not 100% sure what was up with them, but for instance, changing the following:</p>
	<pre><!--BEGIN enscript--><!--END enscript--></pre>
	<p>to</p>
	<pre><!--BEGIN enscript--><!--END enscript--></pre>
	<p>Fixed one issue. The first code snippet will always return fd 1. No idea why, which caused some interesting actions when the thread went to send the page. ;) After this was fixed, I had to go through and convert some library calls to be thread safe, but this sadly still didn&#8217;t fix the handling of the requests.</p>
	<p>As of this very moment, I&#8217;m still working on the actual handling of the requests. Right now it sends a 200 OK then dies before another if statement. Example:</p>
	<pre><!--BEGIN enscript--><!--END enscript--></pre>
	<p>So this is how I spent my weekend. You can see my active social life gleeming through, eh?
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.codymays.net/content/2006/03/12/pthreads-the-love-hate-relationship/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>Jayant lives again!</title>
		<link>http://www.codymays.net/content/2006/03/06/jayant-lives-again/</link>
		<comments>http://www.codymays.net/content/2006/03/06/jayant-lives-again/#comments</comments>
		<pubDate>Tue, 07 Mar 2006 03:34:58 +0000</pubDate>
		<dc:creator>Cody Mays</dc:creator>
		
	<category>Geekery</category>
	<category>C/C++</category>
	<category>Programming</category>
	<category>FreeBSD</category>
	<category>Linux</category>
	<category>Personal</category>
	<category>Daily Grindage</category>
		<guid>http://www.codymays.net/content/2006/03/06/jayant-lives-again/</guid>
		<description><![CDATA[	I must say I&#8217;m proud of the progress with Jayant. It can now serve basic html pages and handle 404&#8217;s. Each connection is processed via a pthread as I said the in the previous post. I fixed two buffer overflows in it today as well. 
	Tomorrow I&#8217;m going to try to get a mime type [...]]]></description>
			<content:encoded><![CDATA[	<p>I must say I&#8217;m proud of the progress with Jayant. It can now serve basic html pages and handle 404&#8217;s. Each connection is processed via a pthread as I said the in the previous post. I fixed two buffer overflows in it today as well. </p>
	<p>Tomorrow I&#8217;m going to try to get a mime type system up. I want to the /etc/mime.types file if possible, this means I&#8217;m going to need a custom parser for it. I&#8217;m debating whether to write one, or go the easy route and find a public domain one. I guess it just depends on how much time school gives me.</p>
	<p>As of today, Jayant also runs on two platforms with no modifications, FreeBSD and linux. So I can only assume it will run on any other unix. I&#8217;ll be trying BeOS within the next few days, as well as a native SkyOS compile.</p>
	<blockquote><p>
cody@devnulled:/home/cody/jayant>./jhttpd<br />
Server Port: 8181<br />
Server Log Dir: /home/cody/jayant<br />
Server Signature: JayantHTTP (FreeBSD) 1.0.0<br />
Adding callback for fd 3<br />
Realloc&#8217;ing fd_tasks<br />
No callback for 1<br />
No callback for 2<br />
Listening on port 8181 fd 3
</p></blockquote>
	<blockquote><p>
cody@laptop:~/jayant$ ./jhttpd<br />
Server Port: 8181<br />
Server Log Dir: /home/cody/jayant<br />
Server Signature: JayantHTTP (Linux) 1.0.0<br />
Adding callback for fd 3<br />
Realloc&#8217;ing fd_tasks<br />
No callback for 1<br />
No callback for 2<br />
Listening on port 8182 fd 3
</p></blockquote>
	<p>Here is a little bite to chew on, the first page served by it:<br />
<a href="http://www.codymays.net/images/jayant/jhttpd.png"><img src="/images/jayant/jhttpd_small.png" alt="jhttpd" /></a><br />
Click for larger image
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.codymays.net/content/2006/03/06/jayant-lives-again/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>printf(&#8221;ERROR: Invalid mm on OS %s\n&#8221;, __ILLUSIONOS__);</title>
		<link>http://www.codymays.net/content/2006/03/05/printferror-invalid-mm-on-os-sn-__illusionos__/</link>
		<comments>http://www.codymays.net/content/2006/03/05/printferror-invalid-mm-on-os-sn-__illusionos__/#comments</comments>
		<pubDate>Sun, 05 Mar 2006 07:12:24 +0000</pubDate>
		<dc:creator>Cody Mays</dc:creator>
		
	<category>Geekery</category>
	<category>C/C++</category>
	<category>Programming</category>
	<category>Operating System Development</category>
	<category>Personal</category>
	<category>Daily Grindage</category>
	<category>Experiences</category>
		<guid>http://www.codymays.net/content/2006/03/05/printferror-invalid-mm-on-os-sn-__illusionos__/</guid>
		<description><![CDATA[	Today I found out that I&#8217;m still going to have to do work to IllusionOS&#8217;s memory manager to get multitasking up because the current one won&#8217;t take into account of each process&#8217; address space. I&#8217;m not sure what to do here, completely rewrite the thing or adapted it. I may try to adapt it to [...]]]></description>
			<content:encoded><![CDATA[	<p>Today I found out that I&#8217;m still going to have to do work to IllusionOS&#8217;s memory manager to get multitasking up because the current one won&#8217;t take into account of each process&#8217; address space. I&#8217;m not sure what to do here, completely rewrite the thing or adapted it. I may try to adapt it to the current system, but either way it won&#8217;t be easy for me. If there is one think I suck at, it&#8217;s writing a memory manager. This made me very depressed for some reason.</p>
	<p>A few round of Counter-Strike:Source later and I was fairly undepressed, but felt like I needed to accomplish something. So I started working on JayantHTTPD again. I finally got the rewrite listening for connections now via my custom libserver.so. I finally decided how I&#8217;m going to handle the connections after reading up on pthreads. They really aren&#8217;t too complicated, and as long as I don&#8217;t need Windows support, work on basically every OS. Right now libserver creates a thread with a callback specified to that file descriptor, but you may also have a custom connection handler for you application. So basically the server will hand out connections via a thread instead of forking.</p>
	<p>Support me! Buy <a href="http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&#038;item=5875464206">this</a>. I&#8217;ll be using the money from these to rebuild my SGI 1100. :)<br />
P.S. If you were wondering what pthreads page I was reading, check <a href="http://www.llnl.gov/computing/tutorials/pthreads/">this</a> out.</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.codymays.net/content/2006/03/05/printferror-invalid-mm-on-os-sn-__illusionos__/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>Interesting day</title>
		<link>http://www.codymays.net/content/2006/02/20/interesting-day/</link>
		<comments>http://www.codymays.net/content/2006/02/20/interesting-day/#comments</comments>
		<pubDate>Tue, 21 Feb 2006 03:39:33 +0000</pubDate>
		<dc:creator>Cody Mays</dc:creator>
		
	<category>Geekery</category>
	<category>PHP</category>
	<category>C/C++</category>
	<category>Programming</category>
	<category>Operating System Development</category>
	<category>Personal</category>
	<category>Daily Grindage</category>
	<category>Experiences</category>
		<guid>http://www.codymays.net/content/2006/02/20/interesting-day/</guid>
		<description><![CDATA[	Today I ventured over to the University of Cincinnati to meet with Dr. Hal Carter, the computer science department head. My mom set up an appointment for me so that he could tell me more about the programs that UC runs for computer science and computer engineering.
	He was rather amazed at what I already knew [...]]]></description>
			<content:encoded><![CDATA[	<p>Today I ventured over to the University of Cincinnati to meet with Dr. Hal Carter, the computer science department head. My mom set up an appointment for me so that he could tell me more about the programs that UC runs for computer science and computer engineering.</p>
	<p>He was rather amazed at what I already knew for being only 15. After talking a little about what he has taught, he was amazed to see that I&#8217;ve done work on Sourceforge, know C/C++, and have my own OS. He seemed kind of baffled how I taught myself all of these things. This makes me wonder about all the other programmers that are my age and have more skill than me. Maybe we could all benefit from a meeting like this?</p>
	<p>After talking about the classes for a while, he then showed me around the campus. They had some pretty interesting things around. In one of the extra rooms (an old utility closet?) the graduate students have a room dedicated to themselves. In it were a few SGI octanes, couple parallel computer setups, and a custom designed gaming console they have been working on for a few years. If that isn&#8217;t cool enough for you, just having a keycard identification system won&#8217;t work. You need a custom one! These students wired the door up to a computer and hung a keyboard on the outside so they could just enter the keycode&#8230;</p>
	<p>Next I went around to a few labs where kids were building circuits and designing them in CAD for their computer engineering classes. They sure have some super, heavy-duty breadboards in those labs&#8230; I found it quite interesting that they had so many SGI and SUN machines. They have several labs that are 100% SUN workstations&#8230;</p>
	<p>Then we walked into a room with something that <em>really</em> grabbed my attention. Their server room was amazing. There were three, count&#8217;em, three beowulf clusters. One had 32 SMP machine nodes. The other two were 64 SMP nodes.  One of the 64nodes was *brand* spanking new. To top off this multi-hundred thousand dollar setup. There was probably 5 Sun servers (don&#8217;t remember what type) laying around the room.</p>
	<p>Didn&#8217;t see too much that drew my attention after this. Got to see the level 10 clean room and a few other pieces of equipment used in creating microchips.</p>
	<p>After that I went back to my mom&#8217;s office and he said that he was amazed at what I knew once again. This is what seems kind of cool, he said that he could learn a lot from what I already know. Good or bad?</p>
	<p>On the way home my mom decided I was going to go through the Chemical Materials department as well. Waste of time. I am <em>ABSOLUTELY</em> not interested in this stuff. w00t! I can see crystalline structures in a microscope and do things to them! They are needed no doubt, but that is not the field for me&#8230;</p>
	<p>Today I also got some coding time in on osdever.net. The forums have come a long way over the past few months. It&#8217;s pathetic it&#8217;s take this long, but I have more important things to do I guess. Editing of posts should be done in maybe 30 minutes. After that it&#8217;s just moderator controls and the forums are done. I&#8217;ll probably do a code audit for security holes and optimizations after that is complete.</p>
	<p>From there on it&#8217;s just finishing up the tutorials system, adding all the existing tutorials into the database, and tweaking the templates. :) Admin control modules can come later I guess, they won&#8217;t take that long to write.</p>
	<p>In other news, multitasking is a PITA.</p>
	<p>I&#8217;m also going to try something new here, weekly PHP tips. I&#8217;m not sure if I&#8217;ll focus on a designated area or just anything handy, but here is Week #1&#8217;s.<br />
<strong>PHP Tip #1 - Week 1</strong></p>
	<blockquote><p>This week I&#8217;m going to start with an essential security basic. Do not trust any data the user submitted to your site or that the user can edit. This includes query strings and forms usually. Make sure you do the appropiate cleaning of $_POST data. </p>
	<p>I usually cast any number values to integers when I clean my $_POST vars. This means that any string that isn&#8217;t a number is set to 0. When I&#8217;m cleaning user data that needs to be entered into a database, I relyon mysql_real_escape_string to do the dirty work for me. I hope this little tip helps a few of you. =D
</p></blockquote>
]]></content:encoded>
			<wfw:commentRSS>http://www.codymays.net/content/2006/02/20/interesting-day/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>woah!</title>
		<link>http://www.codymays.net/content/2006/01/31/woah/</link>
		<comments>http://www.codymays.net/content/2006/01/31/woah/#comments</comments>
		<pubDate>Tue, 31 Jan 2006 12:13:47 +0000</pubDate>
		<dc:creator>Cody Mays</dc:creator>
		
	<category>Geekery</category>
	<category>PHP</category>
	<category>C/C++</category>
	<category>Programming</category>
	<category>Web Development</category>
	<category>FreeBSD</category>
	<category>Personal</category>
	<category>Daily Grindage</category>
	<category>Experiences</category>
		<guid>http://www.codymays.net/content/2006/01/31/woah/</guid>
		<description><![CDATA[	Well this site has gotten quite a few visit since my discovery of the music protection hole on purevolume.com. (~800 visits).
	Well, I&#8217;ve been doing a lot of work on the new web site for osdever.net and I must say it&#8217;s coming alone quite well. Check out the demo and leave me a message on the [...]]]></description>
			<content:encoded><![CDATA[	<p>Well this site has gotten quite a few visit since my discovery of the music protection hole on purevolume.com. (~800 visits).</p>
	<p>Well, I&#8217;ve been doing a lot of work on the new web site for osdever.net and I must say it&#8217;s coming alone quite well. <a href="http://codymays.net/~cody/test">Check out the demo</a> and leave me a message on the forums while you&#8217;re still there.</p>
	<p> I still have a few things left to do  on the forums. I&#8217;m having problems integrating GeSHi syntax highlighter and the bbcode system because when you go to <a href="http://php.net/nl2br">nl2br()</a> the post&#8217;s message, you&#8217;ll get double spaced code from GeSHI. This is because GeSHI specifically adds the \n&#8217;s to the code it generates so the source looks alright. So I have a hack in there to make it work right now, but that keeps us from adding \n into the code, as it becomes just &#8220;n.&#8221;</p>
	<p>I have also begun working on JayantHTTP as of yesterday. It seems pretty portable right now, so hopefully I can get it on *nix and windows. Granted i&#8217;ts no all that far, but hopefully we&#8217;ll be sending out pages within the next few days. </p>
	<p>I am also currently moving to FreeBSD as my main OS on my laptop, so this may not get updated for a while because if you&#8217;ve seen some of my other posts, it takes quite a few hours to get a desktop enviroment setup on it.</p>
	<p>Bye for now.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.codymays.net/content/2006/01/31/woah/feed/</wfw:commentRSS>
	</item>
	</channel>
</rss>
