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

<channel>
	<title>/dev/iron</title>
	<atom:link href="http://iron.randombase.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://iron.randombase.com</link>
	<description></description>
	<pubDate>Thu, 04 Sep 2008 20:27:20 +0000</pubDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
			<item>
		<title>And now for something completely different&#8230;</title>
		<link>http://iron.randombase.com/2008/09/04/and-now-for-something-completely-different/</link>
		<comments>http://iron.randombase.com/2008/09/04/and-now-for-something-completely-different/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 20:27:20 +0000</pubDate>
		<dc:creator>Iron</dc:creator>
		
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://iron.randombase.com/?p=109</guid>
		<description><![CDATA[I'm finally in the right direction at school, I'm now having about ten hours of informatics weekly, including five hours of programming and database management and three hours aimed at operating systems (including Linux) and the technical parts of a computer. It's fun that I'm finally learning some useful things instead of the economics crap [...]]]></description>
			<content:encoded><![CDATA[<p>I'm finally in the right direction at school, I'm now having about ten hours of informatics weekly, including five hours of programming and database management and three hours aimed at operating systems (including Linux) and the technical parts of a computer. It's fun that I'm finally learning some useful things instead of the economics crap I used to follow.</p>
]]></content:encoded>
			<wfw:commentRss>http://iron.randombase.com/2008/09/04/and-now-for-something-completely-different/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Google Chrome?</title>
		<link>http://iron.randombase.com/2008/09/01/google-chrome/</link>
		<comments>http://iron.randombase.com/2008/09/01/google-chrome/#comments</comments>
		<pubDate>Mon, 01 Sep 2008 20:44:28 +0000</pubDate>
		<dc:creator>Iron</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://iron.randombase.com/?p=108</guid>
		<description><![CDATA[I'm a Google junkie and so are you, the masses always go crazy for new big releases of the big search engine and this time I think I'll join them.
This time, Google announced a new project named Google Chrome and it is a new open-source browser, with a lot of innovations and some typical search [...]]]></description>
			<content:encoded><![CDATA[<p>I'm a Google junkie and so are you, the masses always go crazy for new big releases of the big search engine and this time I think I'll join them.</p>
<p>This time, Google announced a new project named Google Chrome and it is a new open-source browser, with a lot of innovations and some typical search engine related functions. You can read more about it <a href="http://blogoscoped.com/archive/2008-09-01-n47.html">here</a>.</p>
<p><strong>edit:</strong> Chrome is released, get it <a href="http://www.google.com/chrome" target="_blank">here</a>. It is so damn fast but I miss the huge database of Firefox plugins...</p>
]]></content:encoded>
			<wfw:commentRss>http://iron.randombase.com/2008/09/01/google-chrome/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP vs Perl (final)</title>
		<link>http://iron.randombase.com/2008/08/27/php-vs-perl-final/</link>
		<comments>http://iron.randombase.com/2008/08/27/php-vs-perl-final/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 21:01:50 +0000</pubDate>
		<dc:creator>Iron</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Perl]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[c]]></category>

		<guid isPermaLink="false">http://iron.randombase.com/?p=107</guid>
		<description><![CDATA[In the first post I discussed the sick amount of functions in PHP compared to Perl, in the second one the reason why writing Perl applications goes faster and now in this third and final post, I'll discuss external connections.
Connecting to an other server is useful for a number of reasons, think about content scraping [...]]]></description>
			<content:encoded><![CDATA[<p>In the first post I discussed the <a href="http://iron.randombase.com/2008/06/27/php-vs-perl/">sick amount of functions in PHP compared to Perl</a>, in the second one the reason <a href="http://iron.randombase.com/2008/07/15/php-vs-perl-part-ii/">why writing Perl applications goes faster</a> and now in this third and final post, I'll discuss external connections.</p>
<p>Connecting to an other server is useful for a number of reasons, think about content scraping or posting messages to a website or forum. Both PHP and Perl have great support for this, but this time I think PHP wins the prize for being the most useful. This is a very strange thing to say because exploits etc are mainly written in Perl.</p>
<p>When you're connecting to a website in Perl, you can use <a href="http://search.cpan.org/~gaas/libwww-perl-5.805/lib/LWP/UserAgent.pm">LWP::Useragent</a>, in PHP it's easier and you can just use file_get_contents("http://www.randombase.com"). These are only suitable for HTTP servers so not that useful.</p>
<p>As soon as you're trying something more advanced (<a href="http://www.randombase.com/random/tutorial/irc-bot-in-perl">IRC bot</a>?) you need more powerful tools.  In PHP, the way to go is <a href="http://be.php.net/fsockopen">fsockopen()</a>, this is an awesome function that is very easy to work with, it can work with virtually any protocol and gives you endless possibilities. The same goes for Perl's <a href="http://perldoc.perl.org/IO/Socket.html">IO::Socket</a>. This extension is maybe more powerful than PHP's, but for some reason I think it's unnecessary complex, there is too much information to be defined before you can actually use it.</p>
<p>So, my final judgement of this PHP vs Perl series would be Perl if you're writing something intended for personal usage or when you need to write a quick hack. I also think Perl is just candy for people who are good with advanced structures, because good and efficient Perl code is almost unreadable in the end. PHP is easier to pick up because of the enormous documentation (Perl's documentation is shattered on the web), and still the unbeaten king for developing websites.</p>
]]></content:encoded>
			<wfw:commentRss>http://iron.randombase.com/2008/08/27/php-vs-perl-final/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Streaming things (example)</title>
		<link>http://iron.randombase.com/2008/08/23/streaming-things-example/</link>
		<comments>http://iron.randombase.com/2008/08/23/streaming-things-example/#comments</comments>
		<pubDate>Sat, 23 Aug 2008 21:12:54 +0000</pubDate>
		<dc:creator>Iron</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://iron.randombase.com/?p=106</guid>
		<description><![CDATA[Took a while but here is my example for the post streaming things:
http://iron.randombase.com/monitor.php
This application shows the serverload, both graphically and in numbers. This example uses a random number generator instead of showing the actual serverload, so don't worry, our server isn't that unstable. I can give you the source code on request, just send me [...]]]></description>
			<content:encoded><![CDATA[<p>Took a while but here is my example for the post <a href="http://iron.randombase.com/2008/08/17/streaming-things/">streaming things</a>:</p>
<p><a href="http://iron.randombase.com/monitor.php">http://iron.randombase.com/monitor.php</a></p>
<p>This application shows the serverload, both graphically and in numbers. This example uses a random number generator instead of showing the actual serverload, so don't worry, our server isn't that unstable. I can give you the source code on request, just send me an e-mail!</p>
]]></content:encoded>
			<wfw:commentRss>http://iron.randombase.com/2008/08/23/streaming-things-example/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Streaming things</title>
		<link>http://iron.randombase.com/2008/08/17/streaming-things/</link>
		<comments>http://iron.randombase.com/2008/08/17/streaming-things/#comments</comments>
		<pubDate>Sun, 17 Aug 2008 22:38:02 +0000</pubDate>
		<dc:creator>Iron</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://iron.randombase.com/?p=105</guid>
		<description><![CDATA[Now I'm truly slacking off. It's been nine full days since my last blog post, but same reason as always, nothing interesting is happening and one project is sucking up all my time.
I was working on a dumb game but realised it was dirt so I quit working on it, mainly because of the forced [...]]]></description>
			<content:encoded><![CDATA[<p>Now I'm truly slacking off. It's been nine full days since my last blog post, but same reason as always, nothing interesting is happening and one project is sucking up all my time.</p>
<p>I was working on a dumb game but realised it was dirt so I quit working on it, mainly because of the forced lag you get through AJAX and PHP. Little did I know at the time I wrote it because apparently there are ways to keep the connection open, even in PHP and AJAX, instead of resending the headers each time. This would reduce lag greatly, and get normal latency. I'm only going to discuss/explain one of two methods I read about because I didn't quite get the other one.</p>
<p>The method is, very simply put: you keep your PHP script running and use Javascript to dynamically update the things on the page. Using usleep() to define the amount of lag you want, and of course deciding what amount of server load you're willing to give to your script. I'm not giving any example, it's late already and it's not hard.</p>
<p>Using Javascript's function getElementById() you can easily manipulate things on the homepage, and use<a href="http://iron.randombase.com/2008/08/08/flush-already/"> flush() </a>to get the output constantly sent to the browser.</p>
]]></content:encoded>
			<wfw:commentRss>http://iron.randombase.com/2008/08/17/streaming-things/feed/</wfw:commentRss>
		</item>
		<item>
		<title>flush() already</title>
		<link>http://iron.randombase.com/2008/08/08/flush-already/</link>
		<comments>http://iron.randombase.com/2008/08/08/flush-already/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 18:41:23 +0000</pubDate>
		<dc:creator>Iron</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[flush]]></category>

		<category><![CDATA[hint]]></category>

		<guid isPermaLink="false">http://iron.randombase.com/?p=102</guid>
		<description><![CDATA[A function that has been on my ignore-list for quite some time, but not anymore. PHP's function flush() makes sure the output you have generated gets sent to the browser. Now, why is this useful? To make it obvious your script is still running to the end-user for example.
Imagine you have one of those lame [...]]]></description>
			<content:encoded><![CDATA[<p>A function that has been on my ignore-list for quite some time, but not anymore. PHP's function flush() makes sure the output you have generated gets sent to the browser. Now, why is this useful? To make it obvious your script is still running to the end-user for example.</p>
<p>Imagine you have one of those lame "value my site" scripts, that connects to the Google PageRank server, Alexa, Yahoo Backlinks and what not. 99% of all scripts simply connect to the servers in one turn, making the script look frozen for atleast a couple of seconds. Statistics show all users leave if your script is running more than 9.81 seconds (OK, I made that up).</p>
<p>To fix the frozen state, add a flush() line between every connection, example:</p>
<blockquote><p>&lt;?php</p>
<p>connectToGoogle();</p>
<p>flush();</p>
<p>connectToAlexa();</p>
<p>?&gt;</p></blockquote>
<p>The moment the script is finished with connectToGoogle(), it will show the output it has already and continue to Alexa. Not clear enough? Here is my little example:</p>
<p><a href="http://iron.randombase.com/flush.php">http://iron.randombase.com/flush.php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://iron.randombase.com/2008/08/08/flush-already/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Distributed hash cracking through Javascript</title>
		<link>http://iron.randombase.com/2008/08/02/distributed-hash-cracking-through-javascript/</link>
		<comments>http://iron.randombase.com/2008/08/02/distributed-hash-cracking-through-javascript/#comments</comments>
		<pubDate>Sat, 02 Aug 2008 11:19:37 +0000</pubDate>
		<dc:creator>Iron</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://iron.randombase.com/?p=101</guid>
		<description><![CDATA[Mad ideas always score, and this one is almost finished! The basic idea of this project is to use the CPU of our visitors for cracking passwords, encrypted in md5 or SHA1 or something like that.
The code I have so far is quite simple, it works like this:
Step 1: generate a MySQL table filled with [...]]]></description>
			<content:encoded><![CDATA[<p>Mad ideas always score, and this one is almost finished! The basic idea of this project is to use the CPU of our visitors for cracking passwords, encrypted in md5 or SHA1 or something like that.</p>
<p>The code I have so far is quite simple, it works like this:</p>
<p><strong>Step 1</strong>: generate a MySQL table filled with the so called "ranges" or "blocks", a block is a part of the amount of hashes you want to generate for cracking your hash. For example, the blocksize I'm currently using is 50. So if I want to generate a million hashes, I'd create 20,000 blocks.</p>
<p><strong>Step 2</strong>: create a server file for the AJAX function in the Javascript cracker. The server file is written in PHP and returns a random, uncompleted range from the database.</p>
<p><strong>Step 3</strong>: the moment a user visits a page, the AJAX function retrieves a random block from the server and starts cracking it (small blocksize so the cracking only takes a few miliseconds). If the block is finished, it tells the server. If the hash is cracked, it also tells the server. The server checks this (no invalid input by evil users, kthxbye) and if this is correct, removes all remaining blocks.</p>
<p>The main issue here is that you need a huge website to get really good speeds. RandomBase receives around 3 hits / second, which would mean only 150 hashes / second.</p>
]]></content:encoded>
			<wfw:commentRss>http://iron.randombase.com/2008/08/02/distributed-hash-cracking-through-javascript/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Sending mails from php&#8217;s mail() to Hotmail</title>
		<link>http://iron.randombase.com/2008/07/25/sending-mails-from-phps-mail-to-hotmail/</link>
		<comments>http://iron.randombase.com/2008/07/25/sending-mails-from-phps-mail-to-hotmail/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 20:16:51 +0000</pubDate>
		<dc:creator>Iron</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://iron.randombase.com/?p=100</guid>
		<description><![CDATA[This is a known issue, and there is a known solution, but it's hard to find when you really need it.
When you're sending an e-mail from php mail() to a Hotmail account, most of the times it will a) never arrive or b) get marked as spam. There is a fix though: you need to [...]]]></description>
			<content:encoded><![CDATA[<p>This is a known issue, and there is a known solution, but it's hard to find when you really need it.</p>
<p>When you're sending an e-mail from php mail() to a Hotmail account, most of the times it will a) never arrive or b) get marked as spam. There is a fix though: you need to send some extra headers with the request, make it look like it was sent from a real mail client.</p>
<blockquote><p>&lt;?php</p>
<p>$to = "I Ron &lt;iron@hotmail.com&gt;";<br />
$subject = "It arrived on Hotmail?";<br />
$message = "Yes it did! :o";<br />
$headers = "From: RandomBase &lt;iron@randombase.com&gt;\n";<br />
$headers .= "MIME-Version: 1.0\n";<br />
$headers .= "Content-type: text/html; charset=iso-8859-1\n";<br />
$headers .= "Reply-To: RandomBase &lt;iron@randombase.com&gt;\n";<br />
$headers .= "X-Priority: 1\n";<br />
$headers .= "X-MSMail-Priority: High\n";<br />
$headers .= "X-Mailer: RandomBaseMailer";<br />
mail ($to, $subject, $message, $headers)</p>
<p>?&gt;</p></blockquote>
<p>It's that simple. It would be even more simple if people stopped using this piece of AJAX based spyware that filters everything but spam messages.</p>
]]></content:encoded>
			<wfw:commentRss>http://iron.randombase.com/2008/07/25/sending-mails-from-phps-mail-to-hotmail/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Crap, junk and a longtail keyword finder</title>
		<link>http://iron.randombase.com/2008/07/20/crap-junk-and-a-longtail-keyword-finder/</link>
		<comments>http://iron.randombase.com/2008/07/20/crap-junk-and-a-longtail-keyword-finder/#comments</comments>
		<pubDate>Sun, 20 Jul 2008 14:25:07 +0000</pubDate>
		<dc:creator>Iron</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://iron.randombase.com/?p=99</guid>
		<description><![CDATA[Hello my few readers, been a while since I last updated my blog so I felt like posting something so I didn't disappoint any of you.
I've been mainly busy with this Dutch Battlefield Heroes forum and playing the game (in beta), the addiction continues. But I've did a little coding too and I'll share the [...]]]></description>
			<content:encoded><![CDATA[<p>Hello my few readers, been a while since I last updated my blog so I felt like posting something so I didn't disappoint any of you.</p>
<p>I've been mainly busy with this <a href="http://www.bfhforum.net">Dutch Battlefield Heroes forum</a> and playing the game (in beta), the addiction continues. But I've did a little coding too and I'll share the idea with you guys, not the code since it's not functional like I want it.</p>
<p>The very basic concept, and also the only thing it does now, is to start off with one keyword (say "php") and end up with a longer string with few results (say "php tutorial about creating games with mysql and javascript and all other things"). The point of finding these is of course to find less competitive niches that should convert well for marketers. The code uses a part of Google search.</p>
<p>The idea was fun, but it didn't work out very well, I'll put some more time in it later. Here are some examples:</p>
<blockquote><p><strong>Start: </strong>php</p>
<p>27200000 =&gt; php split<br />
3920 =&gt; php split REG_EMPTY</p>
<p><strong>Start:</strong> work</p>
<p>1030000 =&gt; worksource<br />
173000 =&gt; worksource WA<br />
165000 =&gt; worksource wage subsidy</p>
<p><strong>Start</strong>: health</p>
<p>23900000 =&gt; health card<br />
748000 =&gt; health cards ontario</p></blockquote>
<p>I'm still trying to tweak it, I guess I should be breaking down the keywords and try to reorder them etc to reach the point of a niche with &lt; 10000 results.</p>
]]></content:encoded>
			<wfw:commentRss>http://iron.randombase.com/2008/07/20/crap-junk-and-a-longtail-keyword-finder/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP vs Perl part II</title>
		<link>http://iron.randombase.com/2008/07/15/php-vs-perl-part-ii/</link>
		<comments>http://iron.randombase.com/2008/07/15/php-vs-perl-part-ii/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 21:30:45 +0000</pubDate>
		<dc:creator>Iron</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Perl]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://iron.randombase.com/?p=97</guid>
		<description><![CDATA[Perl has these tiny little functions that make me use it more for small, personal one-time use things. PHP has support for some of them but often it feels just wrong and not supposed to be there. My favourite example is unless() (should I even add those ()?). Perl has the most awesome function ever:
print [...]]]></description>
			<content:encoded><![CDATA[<p>Perl has these tiny little functions that make me use it more for small, personal one-time use things. PHP has support for some of them but often it feels just wrong and not supposed to be there. My favourite example is unless() (should I even add those ()?). Perl has the most awesome function ever:</p>
<blockquote><p>print 'Hello world.' unless $world eq 'Destroyed';</p></blockquote>
<p>That all, in one line. PHP has (together with Javascript) a good but too long and confusing option for, the shorter version of if(), I use it all the time. It would look like this in PHP:</p>
<blockquote><p>print ($world == 'Destroyed') ? '' : 'Hello world';</p></blockquote>
<p>Ok, that's a pretty sweet function but it requires me to type too much special characters.</p>
<p>The second function I would like to talk about is ... well it has no name, it's just something you can do. In short, it is this:</p>
<blockquote><p>($arrayOptionOne,$arrayOptionTwo) = @array;</p></blockquote>
<p>That is the Perl version, PHP has this one too but they really had to add a specific named function for it:</p>
<blockquote><p>list($arrayOptionOne,$arrayOptionTwo) = $array;</p></blockquote>
<p>And then one of the functions I use all the time for things that involve editing files:</p>
<blockquote><p>open(FileHandle,"&lt;fileName");</p>
<p>print join("",&lt;FileHandle&gt;");</p></blockquote>
<p>That's it! That's just it, we have read a complete file in two lines of code. The PHP version is horrifying here:</p>
<blockquote><p>$fileHandle = fopen('fileName', 'r');</p>
<p>$data = fread($fileHandle, filesize('fileName'));</p>
<p>fclose($fileHandle);<br />
print $data;</p></blockquote>
<p>Now I hear some people say: what's wrong with file_get_contents() then? Nothing, except it doesn't allow you to change the mode parameters (you know: read, write, append, ..) which is quite useful.</p>
<p>After all, anything that I need to write quickly for a task is written in Perl, but in the end PHP is the most powerful language for websites so don't get all mad on me for not mentioning that before.</p>
]]></content:encoded>
			<wfw:commentRss>http://iron.randombase.com/2008/07/15/php-vs-perl-part-ii/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
