Introducing… the Code Bucket

March 20th, 2011 — 9:36am

The ‘code bucket’ area of the site is where I will deposit various source code files that are too small to host somewhere like GitHub, or as a full free software project. I’ll post source code that I think may be useful, interesting or fun to play around with.

All this code is released under a free software license so that you can do what you like with it. Tear it to bits, learn from it, learn how not to do things from it, shove it in your own projects. It’s up to you.

I have put two Python scripts in there to kick things off – one that applies a blur algorithm to an image and one that converts an image to grey scale colours.

Have fun!

Comment » | Code Bucket, Free Software, Fun Stuff

Pithy ASCII Penguins

January 3rd, 2011 — 8:59pm

Cowsay is a great little terminal program I discovered recently. It displays whatever input it is given in a speech bubble above an animal, all displayed in glorious ASCII-Vision(tm).

After playing with cowsay I realised that as I already had a program called fortune (which displays various jokes and pithy quotes in Bash) run automatically whenever I opened a Bash terminal and thought that it would be cool to pipe the output of fortune into cowsay so that an ASCII animal was delivering the fortune, rather than the plain old Bash terminal. Please don’t judge me. It’s probably a cry for help or something.

If you’re interested, this is how I managed it on my Ubuntu 10.10 installation. Other distros are available.

Firstly make sure you have fortune installed. Open up a Terminal (Main Menu->Accessories->Terminal) and type:

sudo apt-get install fortune

Next, enter the following into your terminal to install cowsay:

sudo apt-get install cowsay

Now you are ready to test both programs out. The following command pipes the output of fortune into cowsay (using the pipe operator ‘|’):

fortune | cowsay -n -f tux.cow

Finally, to ensure your new ASCII pet greets you every time you open a terminal, you’ll need to edit your ‘bashrc’ file. I edited mine by entering the following into the terminal:

gedit .bashrc

This will open your bashrc file in Gedit (other text editors are available!). Add the piped cowsay command from above to your bashrc file so that it looks something like the following:

My .bashrc file after editing

Once you have added the command, save the file then close your terminal and you’re done.

Open a new terminal and you should see something like this:

The finished bash terminal

2 comments » | Fun Stuff, Shell Scripting, Ubuntu

Hello world!

November 6th, 2010 — 2:49pm

“Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!”

Thus begins the standard WordPress blog post entitled ‘Hello World’ that is created by default when you install the software on your web server.

I installed and configured WordPress a few weeks back now and, while waiting for a visit from my muse, I left the ‘Hello World’ blog post up. What has surprised me is the number of spam comments I have received with no promotion of the site at all. Where do these people find out about my blog?

Anyway… with that background story in mind I thought it would be fun to edit the ‘Hello World’ post and allow all of the spam comments, just this once, so we can see how fantastically generic and utterly irrelevant they are in the context of a stock ‘Hello World’ post. I am removing any comments that have suspicious looking links, just to keep you lovely people safe. I have deleted three so far.

I will keep approving the spam comments as they roll in. I am intrigued to see how many I get in total.

Enjoy!

81 comments » | Random Stuff

Back to top