Fun With Unix: Go Fish!

Following on from the other articles in the fun with unix miniseries, today its go-fish. This is a game, from the package bsdgames and its addictive :) There are a bunch of other games in the package too but this has been a personal favourite for some years. Basically its a game of happy families, but with an ordinary pack of cards and text-only.

I installed the package on my ubuntu system with the command:

sudo aptitude install bsdgames

Run the game by typing

go-fish

Firstly you will be prompted to say whether you want instructions, then the game starts. You get a list of the cards you have, and you have to start asking for cards to make up “books” of four. Here’s a transcript of the beginning of a game:

Would you like instructions (y or n)? n
I get to start.
I ask you for: 5.
You say "GO FISH!"
Your hand is: 4 7 9 J J J K
You ask me for: j
I say "GO FISH!"
You drew Q.
I ask you for: 6.
You say "GO FISH!"
Your hand is: 4 7 9 J J J Q K
You ask me for: 9
I have 2 9's.
You get another guess!
Your hand is: 4 7 9 9 9 J J J Q K

When you make a set of four cards, it appears at the end of the list:

Your hand is: A A 6 7 7 10 10 10 Q K + Book of 3

The game ends when the cards run out and the winner is the one with the most complete “books”. Have fun!

Steps to Configuring Users on Mantis

Mantis is a rather good open source bugtracker. Recently I’ve been using it across a small team working on a number of projects at once, and its going pretty well so far. It is especially useful when someone is testing something and someone else is bug-fixing. Today I’ve been looking at some changes to the user setup and thought I’d jot some notes here in case someone else finds it useful.

Altering who is allowed to do what

By clicking on the “Manage” and then “Manage Configuration” and then “Workflow Thresholds” links in Mantis, it is possible to alter which roles have access to which features. The roles available are:

  • viewer
  • reporter
  • updater
  • developer
  • manager
  • administrator

Unfortunately, these role names can’t be changed – What I need is one for IT people, one for management and designers, one for contract IT staff and one for project management people. I’ve ended up writing an accompanying document saying which people should have which level of access.

From this page you can turn on and off most functionality for the various levels of user. You can set who can resolve or delete issues, change statuses, assign issues and so on – and also which levels can see the notes or a list of who is monitoring the issue. This probably makes more sense in a large organisation, or where different people might be doing different roles for different projects. As we’re quite a small outfit then quite a lot of people have administrator access and almost all other users have at least the role “developer”.

Changing what triggers email notifications

Mantis sends out WAY too much email for our liking – so under “Manage” and then “Manage Configuration”, look for the “Email Notifications” tab. Here you can alter the settings and if you have the defaults set, you’ll see that nearly everyone has them ticked to start with! Its a neat interface with options for people reporting bugs, people with bugs assigned to them, and people monitoring bugs too. There is also functionality to include people who have added notes to the bug or people of a certain threshhold who have been assigned to that project, but I’m not using those right now.

How the status flows

Also at this level of configuration is a screen called “Workflow Transitions”, which allows you to set default status for new issues, and then dictate which statuses can follow on from which other statuses and what the default next status is for each. I’ve seen this before in other applications and its very useful to give a hint to the user as to what should be happening next in the project process. I thoroughly recommend that if you are setting up mantis, or even doing some housekeeping on an existing installation, you spend some time thinking about how this screen could be set up to make things faster for users.

Am I making sense?

I hope this is useful to someone – if nothing else it will be an excellent aide memoire for me next time I want to fiddle with the settings! Let me know if this was helpful or if there’s anything I’ve missed.

Sssh … Thoughts of Moving

I’m whispering. It loses something when you whisper in a blog post but just imagine that I’m whispering.

I’m whispering because I’m going to write about the house and I’m sure that speaking too loudly will jinx the whole process! Nothing is certain in my mind until I’m holding the keys to our new home, and we’re not there yet. (Here’s the usual insertion about reading previous house posts if you haven’t been keeping up, I gave up linking to direct posts a while ago so that’s a link to the category listing of the whole saga).

The idea of moving to a new place is a little daunting. The flat we live in now is pretty compact and most of our belongings have been in boxes at my parents’ home for almost 18 months now. It will be great to have more room, our own furniture, all our books, and space to make noise and mess and entertain friends. Certainly there are a lot of advantages and reasons to look forward.

The house is much bigger than the flat and that in itself is quite strange, we’ve been under one another’s feet for so long now that it will be almost isolating to have the nearest person half a house away. And the house is going to take a lot of attending to – it needs work doing but just keeping it clean will be a challenge (and looking at the state of the flat, unlikely1). We’ve been blissfully happy in the flat, joining clubs, making new friends in Leeds and generally running about getting into everything. I am looking forward to the house but a change is always a risk.

However, I’m a forward-facing person and buying our first home is quite a landmark in our lives. Also I’m still homesick for my mother’s home and I’ve lived away from that home and in rented accommodation for almost 8 years now, a home of our own will be great. On the whole I’m happy that its happening!

And, very definitely in a whisper, we may be doing some shifting of things next weekend. So if anyone would like to lend a hand in Birmingham on Saturday or Leeds on Sunday, we’d be grateful. Let me know quite quietly though, won’t you??

1 Is it good practice to add a note inside brackets? Its like brackets inside brackets or something! What I was going to say was that I can’t be all that bad because I was recently thanked for my housekeeping tips which would seem noteworthy.

Hopeful House

I haven’t updated the house saga for a while but its been ticking along in the background. There have been the usual series of alarm and excursions – one misunderstanding about whether planning permission was needed for the basement (happily it wasn’t, as there isn’t any!) and some excitement about indemnities and covenants.

However the searches are in and didn’t reveal anything too scary and now people are asking us to pay for things it looks as if things may be moving … and perhaps so will we :)

Fun with unix: Fortune

The old ones are the best, so they say, and this is definitely the case with fortune. At the command line, type “fortune” and see what you get. Mine read

“Next Friday will not be your lucky day. As a matter of fact, you don’t
have a lucky day this year.”

This and other random nuggets of information, quotes or entire randomness will be output by this program. You can combine this with cowsay to great effect, for example:


fortune | cowsay

________________________________________ / Q: Why is Christmas just like a day at \ | the office? A: You do all of the work | | and the fat guy in the suit | \ gets all the credit. / ———————————————————— \ __ \ (oo)\_______ (__)\ )\/\ ||——w | || ||

Paste that line into your .bashrc or equivalent and ensure a little chuckle, or maybe complete bewilderment, every time you log in!

Posting with images in Joomla!

The other day I was helping someone post to a website that I set up using Joomla! , and thought that others might find this tutorial helpful.

Start with the “Media Manager” button on the front page. This is so you can add all the images. Directories can be added here to manage images – I found that adding images to subdirectories inside the “stories” folder made them available to add to articles.

To add the images, use the “choose” button next to the “file upload” box. Choose your image and then click on the “upload” picture above (not an obvious place for a button, I know!). Your picture will appear in the grid below. Upload all the images you like.

Now you can publish them to the site. Click on “home” in the top left and then “Add New Content”.

Start by unticking the “published” box on the right hand side of the screen, this means you can work on it as much as you like before it appears on the site, and it is safe to use the “Save” button at the top without it being visible online yet.

Not far to go now – just dropping those images into a story. Click on the images tab on the right hand half of the screen, and use the subfolders drop down box to find your folder. These will be listed in the “gallery” box. Add these images to the “Content Images” box by selecting them in the gallery box and clicking the arrows. The order in which the images are listed in the content images box is the order in which the images will appear on the page … either add them in order or just add them all and use the up/down buttons to get them straight.

Now give the article a name and put it into a section. Write what you want to in the “intro box”, and when you are ready to add the next picture, click on the “insert picture” tab. This is less confusing than it sounds, use the “preview” button at the top to keep track of what is actually happening.

When you are finished, choose the “Publishing tab” in the right half of the screen and tick the “published” and “front page” boxes. If you want to save it at any point, or it checking before it goes live, don’t tick these boxes. Either way, make sure you use the “Save” button at the top.

Hope that helps someone.

Fun with Unix: Cowsay

Another in the “Fun with Unix” series (see the one other post so far on mesg), today’s episode covers a little trick that goes alongside messages.

Here it is:

 _______
< hello >
 -------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

The code to output the above is:

echo "hello" | cowsay

You can tell cowsay to use a different picture, how about this one:

echo “hello” | cowsay -f elephant _______ < hello > ———- \ /\ ___ /\ \ // \/ \/ \\ (( O O )) \\ / \ // \/ | | \/ | | | | | | | | | o | | | | | |m| |m|

Or even:

echo “hello” | cowsay -f daemon _______
< hello > ———- \ , , \ /( )` \ \ \___ / | /- _ `-/ ‘ (/\/ \ \ /\ / / | ` \ O O ) / | `-^—’`< ‘ (_.) _ ) / `.___/` / `——-’ /
<——. __ / __ \
<——|====O)))==) \) /====
<——’ `—’ `.__,’ \ | | \ / ______( (_ / \______ ,’ ,——-’ | \ `—{__________) \/

My files are in /usr/share/cowsay/cows so have a look what you have.

Of course you can use these in conjunction with write that I mentioned last time, by using something like:

echo "hello there" | cowsay -f hellokitty | write kevin

Enjoy :)

Damn Small Linux for a Damn Small Laptop

Tied up with the various issues we’ve had recently with houses, I’ve got a new project. Its to turn my (mother’s) very old laptop into a dumb terminal we can have in the basement in the new house. The kitchen is in the basement and I’m keen not to bring any more hardware into that environment that we need to, just because kitchens are full of liquids and grease.

I’ve got a Toshiba Satellite 210CS, complete with its original “Optimized for Windows 95” sticker. It celebrated its twelfth birthday this year so its not doing too badly! Its had a couple of upgrades from its original configuration – it has a 1GB hard drive, a PCMCIA wirless card that will talk to our 802.11b router, and a memory expansion to take it to 24MB of RAM. The processor is a Pentium 120Hz and judging by the fact that it thinks its June 2nd 2005, its CMOS battery is flat.

On Sunday night (its a bank holiday here so we’ve had Monday off as well) we installed Damn Small Linux (DSL) onto it and hoped for the best. The most impressive thing about this is always trying to boot anything new. This machine predates real PCMCIA standards and predates USB; it has a CD drive but can’t boot from it and often won’t read written CDs. It does have wired network on PCMCIA but can’t boot from that either. And it has a floppy drive … somewhere. So we managed to find the floppy drive, and another machine with a floppy drive in it (we were quite surprised to realise the server has one), and even unearthed a floppy disk in the house. Which is more impressive than it sounds as all our stuff is in storage!

DSL went on like a dream but wrongly guessed the size of the screen on the laptop so on the first attempt when I thought it had stopped and I pressed return a few times to shift everything up the screen a bit, I discovered I had answered “no” to the question “would you like a boot loader?”! So we did that again and now its working fine.

Even more impressively, the DSL installation is happily driving the PCMCIA wireless card, out-of-the-box. Last time we re-installed this machine (we think 3 or 4 years ago) we gave up with getting a binary distro working and Kevin compiled some special Gentoo for it. I was impressed how painless this was, so a big thanks to the DSL people, I must send them some fanmail. Or money, maybe.

The plan is just to use the command line to ssh up to the main in-the-house server and use that for checking mail. We can use lynx and command-line chat equivalents if we get desperate too :)

1 If you were hoping for an update, we’ve commissioned the searches but must complete by the end of May to avoid losing the mortgage. Watch this space.

Awards Night Excitement

Last night was the netball awards night, I took the present for my coach and prepared for a night out with the girls. What I wasn’t prepared for was actually winning something! I’m Shipley Netball Club’s “Most Promising Newcomer”, which is a fantastic honour and I’m very very excited to have won!

The award is a glass with a wooden stand … as I was out for a few drinks afterwards its in the care of Janet at the moment so I shall post photographs when I reclaim it!

Posted in Uncategorized | 1 Reply

Stopwatch Cosy

Its the end of the netball season and I’ve been trying to think of a gift for my coach who has been fantastic this season. With my usual comic timing, I decided yesterday that a new stopwatch with a countdown feature would be a good present for a sports coach.

Its not very personal, though, is it? So I’ve made it a cosy:

And since I’m an engineer, I’ve also photographed the alternative setup which allows the cosy to be stored buttoned onto the string while the stopwatch is in use.

Happy end-of-season, Lynda, thanks for everything!