Sorry About That…
I screwed up something and ended up erasing some of my good posts, but luckily Google had my back and I just put up the cached versions. Hopefully I have some new material for this ol' blog before long.
Love,
admin
I screwed up something and ended up erasing some of my good posts, but luckily Google had my back and I just put up the cached versions. Hopefully I have some new material for this ol' blog before long.
Love,
admin
This is for everyone who uses things like HAX[AT]LIFE.COM to post their email addresses, ostensibly so that spam spiders won't find their emails. Well, I probably don't have to say this but, since everyone uses essentially the same system, this method doesn't really work.
Just Google the following to see what I'm talking about:
*[at](hotmail|gmail|hushmail|yahoo).com
Next brilliant spam-prevention technique, plzkthx.
2 Comments »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.
32 Comments »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>

Enjoy 
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;
}
8 Comments »