Archive for the ‘Code’ Category

PHP: Add text in a filled rectangular box to the bottom of a goddamn image

Sunday, July 6th, 2008

Holy shit, why did this take so long to figure out. $input_filename = 'somefile.jpg'; $output_file = 'someotherfile.jpg'; $new = ImageCreateFromjpeg($input_filename); $width = imagesx($new); $height = imagesy($new); $black = imagecolorallocate($new, 0, 0, 0); $white = imagecolorallocate($new, 255, 255, 255); $font = 4; $leftTextPos = ($width - imagefontwidth($font)*strlen($name))/2; imagefilledrectangle($new, 0, ($height-20) , $width, $height, $black); imagestring($new, $font, $leftTextPos, $height-18, $name, $white); imagejpeg($new, $output_filename);

Open Port, Port Forwarding Test Tool

Tuesday, July 1st, 2008

I work with a lot of NAT routers. Every brand imaginable, D-link, Linksys, odd jobs that ISPs supply, you name it. Sometimes it can be a pain to get them to forward ports properly, it can be even more of a pain to test if it is working. I wrote ...

Quick and Dirty File Tail in PHP

Wednesday, June 18th, 2008

Very, very insecure. $base_dir = "/var/log/sxr"; $file = (isset($_GET['file']) ? $_GET['file'] : 0); $to_tail = 25; $full_path = $base_dir . '/' . $file; $lines = file($full_path); $count = count($lines); if($count < $to_tail) { $to_tail = $count; } $start = $count - $to_tail; print = "Last $to_tail lines of $file"; while($start < $count) { print $lines[$start] . ''; $start++; }

Javascript/jQuery check all check boxes function.

Monday, June 16th, 2008

You would think a check all function would be pretty easy in jQuery, and it is if all of the checkboxes have the same name. If they don't things get tricky. In this example, I have an anchor named chk_all that the user can click to check all. All of my ...

Aprils Fools Part 2

Sunday, March 30th, 2008

#!/bin/bash #/bin/ls April Fools replacement LS="/bin/.ls $*" #generate random int 0

April Fools

Saturday, March 29th, 2008

#include int main(int argc, char** argv) { while(1) { sleep(1); system("eject"); sleep(1); system("eject -t"); } }



thevedic.net

Part of the thevedic.net.
[Contact Me] - [Mud Emporium] - [Ozark, AR] - [See my Port?]

This site is in no way represents the opinions or positions of any company or organization including those who employ the creators of this web site. We're not responsible for the content, posts, responses by other users or ideas of any sites that are linked to on this page. This site is recommended for ages 18 and up.

VEDIC VEKO IS PROSPEROUS

Arkie Imports | Dean Vaughan | Dean Vaughan | K. Dean Vaughan | Kenneth Vaughan | Pig Trail 23 | Pig Trail Pics | See My Port Forward Info | See My Port Forward Info


I'm not affiliated with the following in anyway.
Arkansas MMA - Inferno Mixed Martial Arts - Inferno Martial Arts Club - Inferno Martial Arts Club - Official Inferno Fight Gear - Inferno Fight Equipment - Inferno Combat Gear - IFC Online - Inferno Fight Gear - Inferno MMA - Inferno Fight Gear