« January 2008 | Main | March 2008 »

February 2008 Archives

February 26, 2008

Testing an SSH Connection With PHP Through Bash

This one had been bothering me since yesterday afternoon. Apparently "php -r 'code_here'" is the way to go for calling PHP functions from a command line, rather than doing "echo 'code_here' | php". So, we now have a Bash function that calls PHP to test an SSH connection (I got tired of looking for a good way to do it entirely within Bash):

# Call as "check_ssh_root_access SERVER_NAME"
# $RES will be "HELLOWORLD" if the connection is good, "GOODBYEWORLD" otherwise
RES=`php -r "error_reporting(0);
    \\$ssh_connect = ssh2_connect('$1');
    if (ssh2_auth_pubkey_file(\\$ssh_connect, 'root', '/root/.ssh/id_dsa.pub', '/root/.ssh/id_dsa'))
    {
        echo 'HELLOWORLD';
    }
    else
    {
        echo 'GOODBYEWORLD';
    }"`

Noting this in as many places as possible so I remember it next time.

Alas, Poor HD DVD

Apparently my previous predictions were way off. It's been a week now since Toshiba officially announced their withdrawal from their long-running format war with Blu-ray disc, and it still makes me sad. I'm not quite sure how movie studios, retailers, and finally Toshiba decided that having two formats was hurting market penetration of high-def media. If anything, it's being held back by the vast majority of people who don't own HDTV's or do but are perfectly happy with upscaled standard DVD's.

Head on over here for a quick summary of events leading up to HD DVD's demise. And, if you want to invest relatively-small amounts of money in a dead (but just as visually impressive as Blu-ray) format, the HD DVD drive for the Xbox 360 has been dropped to $50 now, and still comes with a in-box copy of King Kong as well as five free movies via mail-in rebate. Hopefully there'll be some sweet closeout deals on movies soon.

About February 2008

This page contains all entries posted to NuclearDonkey.net in February 2008. They are listed from oldest to newest.

January 2008 is the previous archive.

March 2008 is the next archive.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.34