My first Javascript program

Embarrassingly for a techie, my coding skills are somewhat lacking – despite various dabblings, my focus largely having been system administration without a firm basis in basic programming logic. :(

Clearly, if this is something I’m wanting taught in schools, I should make an effort to learn and understand about it myself however there are plenty of bits of code that I aspire to make small modifications to, yet lack the knowledge to do so.

Codecademy‘s high profile launch of CodeYear, provided the perfect, gentle opportunity, to quickly get to grips with some really basic concepts without feeling patronised or rushed or guilty of wasting someone’s time.

I’ve just completed the Codecademy week 1 courses, and my biggest success so far is putting together this simple Javascript FizzBuzz game program. Not a ground breaking achievement, but considering this is (apparently) a frequently used interview task, it certainly feels like something has been accomplished!


Javascript (execute in Firebug debugger)

// What number shall we play up to?
var number = 100

// for the numbers 1 through 20,
for (i=1; i<=number; i++) {

// if the number is divisble by 3 and 5, write "FizzBuzz"
if ( i % 3 === 0 && i % 5 === 0 ) {

// if the number is divisible by 3, write "Fizz"
else if ( i % 3 === 0 ) {

// if the number is divisible by 5, write "Buzz"
else if ( i % 5 === 0 ) {

// otherwise, write just the number
else {

How to write a really simple IRC bot

Noah Slater of semtard vapourware fame recently demonstrated to me how to write and extremely simple IRC bot in shell scripting.
The bot below is extremely simple, it simply identifies itself, joins a channel then sends a message to a channel.

If you are interested in using IRC bots, you may enjoy Phenny, which has a Debian package.

To use the code below to create your own bot, first you should copy the bot into a file called
then run:

chmod a+x

then run the bot with


If you wanted to run the bot in the background for an extended period of time, you might want to do something like:

nohup / 2> ~/mybotlog.txt &

For more information about learning shell scripting have a look on google

Based on Shellbot, by Sean B. Palmer

#!/bin/sh -e
# Based on Shellbot by Sean B. Palmer,
# Modified 2008, Noah Slater < >
# Modified 2008, Tim Dobson,

echo "NICK pingbot" > pingbot.input # what nick
echo "USER pingbot +iw pingbot :$0" >> pingbot.input
echo "JOIN" >> pingbot.input # what channel

tail -f pingbot.input | telnet 6667 | while true; do # what network
echo "PRIVMSG :tdobson is cool" >> pingbot.input # what to say.
sleep 30 # number of seconds to wait before saying it again