Friday, June 26th, 2009
I’m almost always browseing the interwebs looking for something… Wethere that be sprites for a new game or some cool js scripts. So I thought I’d share a couple of my current most used sites with the loving people.
gegereka.com : This is one of the best file searching places available, but at the same time the most annoying. they make you use these codes that you have to get every day to download, Although its like captcha but not everytime. If you’re looking for a specific file, its most likely on here.
rubular.com : One of the best, if not the best regex testing tools out there. Its free, live previews, and fully functional. This has saved my ass on more then one occasion.
creators.xna.com : If anyone is making games with XNA and doesn’t know what this website is, then they are probably a dumbass. This website tells you everything you need to know to use the XNA framework. Im actually working on a game myself…. using the Farseer Physics Engine.
Tags: browse, captcha, cool, download, farseer, Favorite Scripts, file, framework, host, interweb, interwebs, Javascript, popular, site, Sites, sprites, top, Website, xna
Posted in Other, Sites | No Comments »
Tuesday, March 17th, 2009
Here is a little gem I found one day. Don’t know what the hell I was looking for but I ended up finding this. What it does is simple: Lets say you named this php script “megavideo.php”, If you wanted to get the file, all you would have to do is go to the url you uploaded to and do this “megavideo.php?file=VIDEOID”. The videoid is the id of the video you want. Example: “http://www.megavideo.com/?v=5GB9TD59” <- the bolded part is the video id.
<?php
function mv_decrypt($str_hex, $key1, $key2){
$str_bin = "";
// 1. Convert hexadecimal string to binary string
for($i = 0; $i < 128; $i++){
$str_bin .= floor(hexdec($str_hex[floor($i/4)])/pow(2,(3-($i%4))))%2;
}
// 2. Generate switch and XOR keys
$key = Array();
for ($i = 0; $i < 384; $i++){
$key1 = ($key1 * 11 + 77213) % 81371;
$key2 = ($key2 * 17 + 92717) % 192811;
$key[$i] = ($key1 + $key2) % 128;
}
// 3. Switch bits positions
for ($i = 256; $i >= 0; $i--){
$temp = $str_bin[$key[$i]];
$str_bin[$key[$i]] = $str_bin[$i%128];
$str_bin[$i%128] = $temp;
}
// 4. XOR entire binary string
for ($i = 0; $i < 128; $i++){
$str_bin[$i] = $str_bin[$i] ^ $key[$i+256] & 1;
}
// 5. Convert binary string back to hexadecimal
$str_hex = "";
for($i = 0; $i < 32; $i++){
$str_hex .= dechex(bindec(substr($str_bin, $i*4, 4)));
}
// 6. Return counted string
return $str_hex;
}
// Is set the "file" variable?
if(isset($_GET["file"])){
// Does player send video position?
$pos = (isset($_GET["pos"]) ? intval($_GET["pos"]) : "");
//Obtain Megavideo ID from link
$megavideo_id = $_GET["file"];
// Obtain Megavideo XML playlist file
if ($content = @file_get_contents("http://www.megavideo.com/xml/videolink.php?v=".$megavideo_id)){
// Parameters which I want to obtain from XML;
$parameters = Array("un", "k1", "k2", "s", "size");
$success = true;
// Obtain parameters from XML one by one
for($i=0; $i<Count($parameters); $i++){
$success = $success && preg_match('/ ' . $parameters[$i] . '="([^"]+)"/', $content, $match);
$$parameters[$i] = $match[1];
}
if($success){
// Count "dkey" from obtained parameters
$dkey=mv_decrypt($un,$k1,$k2);
// set URL address of video file
$video_url = "http://www".$s.".megavideo.com/files/".$dkey."/".$pos;
// Send headers to browser
header("Content-Type: video/flv");
header("Content-Disposition: attachment; filename=video.flv;" );
header("Content-Length: ".$size);
// Read video file from Megavideo server
readfile($video_url);
}
}
}
?>
Source: Longtail Forum
Tags: address, Array, attachment, bin, bindec, browser, Content, Convert, day, dechex, decrypt, Disposition, dkey, Don, Example, file, filename, floor, Flv, Forum, function, gem, Generate, header, hex, hexadecimal, hexdec, href, intval, isset, lang, Length, Lets, link, Longtail, match, megavideo, Obtain, Parameters, part, playlist, pre, Read, readfile, return, script, server, size, Source, str, string, substr, success, Switch, target, temp, Type, url, VIDEOID, XML, XOR
Posted in PHP | No Comments »