Jun 17

about:mozilla

Long have I admired the sacred writings from the Book of Mozilla

Type about:mozilla into your Firefox 3 address bar and you get this awesome passage:

Book of Mozilla

Mammon slept. And the beast reborn spread over the earth and its numbers grew legion. And they proclaimed the times and sacrificed crops unto the fire, with the cunning of foxes. And they built a new world in their own image as promised by the sacred words, and spoke of the beast with their children. Mammon awoke, and lo! it was naught but a follower.

 

from The Book of Mozilla, 11:9
(10th Edition)

 

If you haven’t caught this religion yet. Keep reading.

Jun 17

Minutes into Download Day and Whoa!

We’re just minutes into the Final Release of Firefox 3, dubbed “Download Day“, and already it appears that the Mozilla servers are quite thrashed. If they can keep the servers alive, I believe they probably will set a record. Despite all this excitement about breaking a record, these numbers really have a lot less to do with the number of people using Firefox, and a lot more to do with the enthusiasm of the people using Firefox as a great product/idea/movement/way. More than all the bandying about on downloads, I think they should really be talking about their alternate distribution methods. Bittorrent and other peer-to-peer methods, as well as package managed applications such as apt-get install firefox-3.0 on debian systems. Then it wouldn’t be so hard to actually get a copy using traditional methods, on “Download Day”

By the way Firefox 3 IS everything it’s cracked up to be. the new awesome bar incorporates; bookmarks, tags, recent / popular pages into an easy-to-use autocomplete that will really change the way you use the address bar. I’m anxious to see what new extensions will start to appear to take advantage of the tagging system for bookmarks which is still in its infancy. Well if you can find a copy, install FF3 do it today, the time is now.

May 16

PHP: Formatting dates

Formatting dates can be tricky for the beginning PHP programmer, here’s a few simple examples that will get you started. I’ll go over how to convert from database date formats to traditional date formats and back again, as well as how to test a date using regular expression matching…

Apr 9

On Trees and Other Leafy Things

Sometimes the best way to view things is in a tree shape, and your website is no exception.

tree

For a nice tree view showing file sizes and links to the actual files, edit your crontab:

crontab -e

Add this line into cron:

0 * * * * /usr/bin/tree -C -s -D -H http://www.yourdomain.com
/address/of/your/web/root/ > /somewhere/tree.html

This will run every hour updating your tree.html with a new detailed site map.

Mar 14

Socket To Me, One More Time

Sorry, I couldn’t resist. I’ve been testing receiving data through the socket server I talked about in my last post. If you are testing without a steady stream of incoming data, you may need to generate your own UDP packets to send to your socket server. Here’s a simple script to open the socket on the other end. Keep in mind there is no back and forth communication with the User Datagram Protocol (UDP).

Create the socket, see the PHP documentation on which settings to use, these are for a UDP connection.

#!/usr/bin/php -q
<?php
/* create a socket in the AF_INET family,
using SOCK_DGRAM for udp connections */
$mysock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);

Specify your host and port, and put together a packet string to send:

Mar 14

Socket To Me

Sockets are the building blocks of networking connections between computers. Today I want to go though how to create a UDP listener (or socket server) in PHP. I recently had to do this to receive GPS data from some black boxes, and had a hard time finding examples of this type of UDP socket server. First of we need to specify who/where this socket will be created for; the host and port.

Pick a port that is higher than 1024, those below that are reserved.

#!/usr/bin/php -q
<?php
$address = "0"; //glom onto all addresses
$rport = "1228"; //receiving port

You should make $address = “127.0.0.1″ if you only want to allow connections on the localhost…