Feb 16

I found this little gem while watching a video on IronGeek, and I gotta say, it has gotten far too little coverage. Basically it will allow you to create a virtual CD drive and mount an ISO or other CD image as though it were in your physical optical drive. I now present to you the Virtual CD-ROM Control Panel for Windows XP. No more using Alcohol 120% or Daemon Tools! Why is it that everything Microsoft does right is ignored or lost in old documentation that no one reads? Sometimes they really do make some good stuff.

Feb 15

This is a rather simple way to create an image from a string. You can use this for whatever you want to, but my thought would be for posting e-mail addresses or maybe a CAPTCHA of some sort. You could do all sorts of stuff with this, like base64ing it or encrypting it with AES. All you need to do is upload this file in a new folder and name it index.php, then create an .htaccess file and you're done. You can now just link to it like this:

<img src="http://yoursite.com/folder/this is your string">

index.php:

<?php
$fontnum = 5; // 1-5
$max_str_length = 100; // maximum length of one line of text
header("Content-type: image/png"); // tell the browser this is an image
if(@$_SERVER['REQUEST_URI']){
	$str = urldecode(str_replace(dirname($_SERVER['PHP_SELF']) . "/", "", $_SERVER['REQUEST_URI'])); // get the string
}
$str = chunk_split($str, $max_str_length); // split up the text into chunks based on max length
$str = substr(str_replace("\r", "", $str),0, -1); // replace \r (fucks things up)
$lines = count(explode("\n", $str)); // find the number of lines
$height = imagefontheight($fontnum)*count(explode("\n", $str)); // determine height
$width = imagefontwidth($fontnum) * ($lines <= 1 ? strlen($str) : $max_str_length); // determine width
$i = imagecreatetruecolor($width, $height); // create the base image
$str = explode("\n", $str); // create the string
for($x=0;$x<$lines;$x++){
	imagestring($i,$fontnum,0,(imagefontheight($fontnum)*$x),$str[$x],imagecolorallocate($i, 255, 255, 255)); // add each line to the image
}
imagepng($i); // output the image
?>

.htaccess:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>

Example of your new script

Enjoy :)

Feb 11

I don't know a whole lot about encryption, but this is something I wrote for a project I was working on. I'd be interested to hear how it could be improved and/or its strengths and weaknesses. Obviously any encryption scheme that is this short presents a time problem, it being very quick as compared to other algorithms. However, my goal with this one was simplicity and some level of security.

function x($str, $key){
	$num = round(strlen($str)/strlen($key));
	$key_tmp = str_repeat($key, ($num >= 1 ? $num : 1));
	$encrypted = $str ^ $key_tmp;
	return $encrypted;
}
Feb 8

Can someone please explain to me why I should read this guy's post? This is precisely why I don't display my FeedBurner stats here - they're pathetic. But even mine are better than this guy's. Why is the web so filled with trash? :\

Feb 7

Recently, Anonymous has been at war with Scientology (in case you hadn't heard this from every Tom, Dick and Harry who thinks he is an "Internet Climate" expert), and one of the things they did was Google Bomb the words "dangerous cult" so that the first link would go to Scientology's website. Well, it looks like Google has finally removed it.

Thanks for playing.