Wireless technology dates back 300 years…

March 12th, 2007

After having dug to a depth of 10 meters last year, Scottish scientists found traces of copper wire dating back 100 years and came to the conclusion that their ancestors already had a telephone network more than 100 years ago.

Not to be outdone by the Scots, in the weeks that followed, British scientists dug to a depth of 20 meters, and shortly after headlines in the UK newspapers read: “British archaeologists have found traces of 200-year-old copper wire and have concluded that their ancestors already had an advanced high-tech communications network 100 years earlier than the Scots.”

One week later, “The Advertiser”, a Lafayette, Louisiana, newspaper, reported the following: “After digging as deep as 30 meters in cane fields near New Iberia, Gaston Boudreaux, a self-taught archeologist, reported that he found absolutely nothing. Gaston has therefore concluded that 300 years ago Cajuns were
already using wireless.”

-Muhahaa. :)

Python to grab zip codes.

January 19th, 2007

I had a need for a list of zip codes and some other relavant information and a need to tinker with Python… So here is a small script that will go to a few zip code sites and save the codes and other info to individual text files for later parsing. I must say this was relatively quick and easy compared to what I would have had to write in C++ to do the same thing.

*NOTE: Don’t use this code to plague the sites, they normally shut you down around 130 hits any way. Although, I programmed a way around that, but due to those interested in DoS attacks, I will not post that here. If you have a need for the zip codes, I can make my zipcode database available to you.

import urllib2

zip=10000
while zip < 99999:
#address = “http://www.zip-codes.com/zip-code/” + str(zip) + “/zip-code-” + str(zip) + “.asp”
address = “http://zipinfo.com/cgi-local/zipsrch.exe?cnty=cnty&ac=ac&tz=tz&ll=ll&msa=msa&zip=” + str(zip) + “&Go=Go”;
website = urllib2.urlopen(address)
website_html = website.read()

print “Processing zipcode: ” + str(zip)

filename=”data/” + str(zip) + “.html”
myfile = open(filename,’w')
myfile.write(website_html)
myfile.close()
zip = zip + 1;

Western Digital 1 TeraBtye (1TB) Pro Edition II MyBook

December 21st, 2006

For Christmas, my lovely wife bought me a Western Digital 1 TeraBtye (1TB) Pro Edition II MyBook (external hard drive). It is a dual-drive storage system with RAID and System Recovery Software. This one drive can hold more than all of the computers we own (~640GB), combined.

Here is the poop sheet:

http://www.westerndigital.com/en/products/Products.asp?DriveID=270

Important: The My Book Pro Edition II hard drive ships with a HFS+ (Journaled) format. This Macintosh native format is not compatible with Windows based computers therefore the drive will need to be repartitioned and reformatted before usage in a Windows based computer.

Ever format a hard drive? Try formatting a TB… it has been a long time, and the format has only progressed to 7% complete.

What it can hold:
Up to 284,000 digital photos
Up to 250,000 songs (MP3)
Up to 24,000 songs (uncompressed CD quality)
Up to 76 hours of Digital Video (DV)
Up to 400 hours of DVD quality video
Up to 120 hours of HD video

Note: One gigabyte (GB) = one billion bytes. One terabyte (TB) = one trillion bytes.

If you are interested in external hard drives, check out these links:
http://www.wdmybook.com/en/
http://www.wdmybook.com/en/compare/
http://www.westerndigital.com/en/products/index.asp?Cat=5&Language=en

Code Archive Status

November 17th, 2006

For about a year now, I have been wanting to make a source code archive in order to facilitate code reuse, etc.

After taking an inventory of all of the code that I was going to put in an archive, I came up with 166,838 source code files… totaling 4.7GB. These figures are for code that I wrote between 1992 and 2006, and the numbers do not include special projects or five languages that I started with in the late 80s early 90s. So the actual figures could be closer to 500,000 and 5GB.

I have decided that all of this code will not make it to my code archive. In fact most of it will end up deleted or as code snippets from which a library will be built, for each language.

I have laid the ground work for the code archive, which will function much like my existing knowledge base. All I have left to do is sift through the mounds of source code… and being that I’m not one for data entry, this could take a very long time. :)

-Jason

Importing old Wordpress blog content into a new instance of Wordpress

August 3rd, 2006

I finally managed to do what was said to be the �impossible�. I imported all of our own blog content into a new instance of Wordpress, automatically.

ShellA is the terminal where the old wordpress instance resides, ShellB is the terminal where the new wordpress instance resides.

shellA> mysqldump -u USERNAME -p DBNAME TABLENAME > FILE.OUT

shellA> scp FILE.OUT USERID@NEWHOST.COM

shellB> mysql -u USERNAME -p DBNAME < FILE.OUT

In the event the posts table name has deviated from the standard wp_posts naming convention, do this:

mysql> use NEWDBNAME;

mysql> drop table wp_posts;

mysql> create table wp_posts as (select * from OLDTABLENAME);

JP_FishString: Modification to the Blowfish Cipher

June 7th, 2006

I started looking into the Blowfish encryption/decryption algorithm for a few projects that I have started working on. I quickly realized that the algorithm, as-is, had a painful way of handling strings for standard text:salt pairs. So I created a shared library to extend the Blowfish algorithm that contains wrapper functions to allow strings to be passed into the base Blowfish_encipher and Blowfish_decipher functions. For a few laughs� I named it FishString. Since it is used for some secure applications I am working on, I am not able to release the source; however, I will submit the *.o file and the binary created during testing (which can be used as a command line based encryption / decryption tool). Available by request only.

Perl script to generate MD5 hashes

May 16th, 2006

#!/usr/bin/env perl

# This perl script generates MD5 Checksums
# Jason Powers
# 16 MAY 2006

use 5.8.6;
use strict;
use IO::File;
use Getopt::Long;
use Digest::MD5;

my $myFile = $ARGV[0];
my $md5 = Digest::MD5->new;
my $check = 1;

open(FILE, $myFile) or die �Couldn�t open $myFile for md5 checksum generation.�;
binmode(FILE);
my $sum = $md5->addfile(*FILE)->hexdigest;
close FILE;

print “\n—————————- \n”;
print “MD5 Checksum of $myFile:\n”;
print “$sum\n”;
print “\n—————————- \n”;