Archive for December, 2007

Looking Great for 2008

December 31, 2007

Just wanted to wish everybody Happy Holidays and Happy New Year 2008 :)

Obligatory clichéd picture

In case you haven’t noticed, I have also completely revamped my web design site with a beautiful new theme. Let me know if you like it!

Command-line iSight Capture

December 22, 2007

Here is a small utility that I find useful for grabbing a look at what is going on near my Mac when I’m not around. Download ZIP.

Basically, you execute it with a command like this:

$ isightGrab-arch > snapshot.png

I can access it securely via the lightweight SSH protocol when I’m not around, which makes this a useful little utility. The code is open-source and is part of the larger “iPhone Remote” project.

The source code can be found at their SVN repository. The only differences are that I compiled this for both X86 and PPC architectures, and I removed the mimetype header transforming it from a CGI to a CLI program.

Have fun! :)

Calculating Sever Uptime in PHP

December 22, 2007

This little bit of simple PHP code lets you determine the uptime of a machine in a human-readable format. Of course, you can pull the code apart and do other things with it. First I will start by just giving you the actual code, and then I will explain how it works.

<?php
function getUptime() {
// Calculate server uptime
$uptime = exec("cat /proc/uptime");
$uptime = split(" ", $uptime);
$uptime = $uptime[0];
$secs = intval($uptime % 60);
$mins = intval($uptime / 60 % 60);
$hours = intval($uptime / 3600 % 24);
$days = intval($uptime / 86400);
return($days . " days " . $hours . " hours " . $mins . " minutes " . $secs . " seconds");
}
echo("Server Uptime: " . getUptime()); // display the uptime
?>

The magic sauce that makes this all work is Linux kernel’s interface to get the system uptime: /proc/uptime. The first value it returns is the number of seconds the system has been up, so we split that out and store it in $uptime. The next thing we do is create integers for the days, hours, minutes, and seconds of uptime using a little bit of creative arithmetic. The final process is just a concatenation of the values into a human readable string, and then output it to the page.

phpBB3 – It's Finally Here!

December 13, 2007

phpBB - Creating Communities Acyd Burn, the development team leader for the open-source bulletin board software phpBB has proudly announce that “today we begin a new chapter in the history of phpBB. After five years, over 200,000 lines of new and altered code, and many a long night phpBB Group is very proud to announce the release of phpBB3 ‘Olympus’.”

I’ve been waiting for this announcement for quite some time, and any know what I mean if you’ve ever looked at the development timeline for phpBB3! ;) Sadly, I gave up on phpBB a long time ago after reading their “phpBB is dead… long live phpBB” announcement.

phpBB used to be the de facto standard for web-based BBS, but the security issues plaguing their 2.0.x line and the continual delays of 2.1, which was later renamed to 3.0, and then dragged on with a long string of betas and RCs before today’s “golden” release really caused them to lag behind the times. The phpBB team has some serious competition now, and hopefully this has made them a lot more serious about their application.

Although I no longer have the old phpBB2 board that used to be the forte of this site (not to mention one of first experiences with PHP hacking), I still have hope for the project and I’m cheering them on from the sidelines.

Good luck and congratulations, phpBB Team!