Pretty PHP Source!

Posted on March 28th, 2006 in PHP by Russ

This is totally cool. PHP comes with a “source handler,” so by adding one line to your htaccess file, you get some pretty colors. Now, if I remember correctly, the colors are configurable via the php.ini file.

Here’s the line…
AddType application/x-httpd-php-source .phps

And here’s the result…
AutoThumb

Thumbnail Creation

Posted on March 28th, 2006 in PHP by Russ

I was asked for help with my brother’s website, and had to coach him in the fine points of using thumbnails; basically, his main header had a 200K image, shrunk down using the image source attributes for height and width. So I’ve created the Automatic Thumbnail Generator; feel free to Use It.

ipcalc

Posted on March 22nd, 2006 in Uncategorized by Russ

I have a new tool in my arsenal.

I had to configure a network recently- and we were given the CIDR notation of x.x.x.x/26, which is smaller than a normal class-C subnet. It’s been a while since I’ve manually had to figure out subnet masks, gateways and network addresses but I gave it a go. Then I asked someone else for clarification. I had done it right– she confirmed my work with

“$>ipcalc x.x.x.x/26″

Which is interesting- on Fedora Core 4 , this gives a “help” screen and you have to use -bmn flags, and you get back:

$ ipcalc -bnm 192.168.1.0/26
NETMASK=255.255.255.192
BROADCAST=192.168.1.63
NETWORK=192.168.1.0

while on Debian, you get back something completely different:
~$ ipcalc 192.168.0.1/26
Address: 192.168.0.1 11000000.10101000.00000000.00 000001
Netmask: 255.255.255.192 = 26 11111111.11111111.11111111.11 000000
Wildcard: 0.0.0.63 00000000.00000000.00000000.00 111111
=>
Network: 192.168.0.0/26 11000000.10101000.00000000.00 000000
HostMin: 192.168.0.1 11000000.10101000.00000000.00 000001
HostMax: 192.168.0.62 11000000.10101000.00000000.00 111110
Broadcast: 192.168.0.63 11000000.10101000.00000000.00 111111
Hosts/Net: 62 Class C, Private Internet

Strange, huh? But at any rate, either screen gives me what I wanted.

Untreated Sewage in the Water

Posted on March 4th, 2006 in Uncategorized by Russ

Living in Portland, we have terrific water. The Bull Run brings us clean water every day; and we drink bottled water to get it extra-clean.

Email is a lot like water; It’s ubiquitous. You can’t turn around without being faced with email. But it’s polluted too; we usually call it “spam” and say that it’s a price of having email at our fingertips. While every second email flows through the Internet, spinning with the tides, it’s also filled with commercials for v14gra and for new home m0rtg4g3s … It’s also filled with more nefarious crap like the Soder worm and other virii that read your inbox on your home computer and contribute to the pollution by spamming everyone on your contact list.

I believe that if your provide email service, you have an obligation to filter the inbound email as best as you can so that your own users don’t get an overflow of debris and trash, and also to filter the outbound email to make sure that your users aren’t contributing to this sludge in the ‘net. But more and more I seem to be in the minority.