Archive for the ‘Code’ Category
Tuesday, February 17th, 2009
The brilliance of programming...
Last year I needed to tail a file in PHP. I whipped this out.
Today I needed to do it and came up with this:
$output = `tail -n 150 /var/log/messages`;
$tail_str = "<pre>$output</pre>";
Weee... don't know what the hell I was thinking last time.
Posted in Code | No Comments »
Saturday, February 7th, 2009
I had the need to convert a PDF to a JPG today. I searched around on Google and everything was pay to play. This is pure exploitation since this sort of conversion is a one liner for most Linux systems.
I wrote my own.
File:
Depending on your connection ...
Posted in Code | No Comments »
Tuesday, December 2nd, 2008
The PDF toolkit is command line app for manipulating PDFs. I use it to split faxes received in Hylafax into one file per page. I recently upgraded a server to x86 64 Fedora Core 9 and found that all of the precompiled versions of pdftk wouldn't work. I tried to ...
Posted in Code | 5 Comments »
Wednesday, November 12th, 2008
I've decided to learn flash. I don't know why, I don't know what I am planning on using it for, but I am going to do it.
Here is some example code I wrote up to play around with, it can read in XML outputted from a PHP script and display ...
Posted in Code | No Comments »
Monday, October 27th, 2008
This function will dynamically create a jpeg from the string you provide. It even handles multi-line strings.
function str_to_jpg($str, $file) {
$lines = explode("\n", $str);
$number_lines = count($lines);
$image = imagecreate(1000, ($number_lines * 16));
$background = imagecolorallocate($image, 0, 0, 0);
$text = imagecolorallocate($image, 255, 255, 255);
...
Posted in Code | No Comments »
Monday, October 13th, 2008
I acquired an Alpha LED sign in a '$1 it's broke' Ebay action. Using my undergrad EE skills, I replaced the fuse and had a working sign.
[singlepic=193,700,440,,]
(Also note some of my totally awesome collection of Internet Appliances)
Thing is, I have nothing to use it for. I was going to make ...
Posted in Code, Me, Random | No Comments »