New Look Google Analytics: The Dashboard

Google Analytics have been migrating their users to a new interface over the last few weeks. I like analytics (something to do with an unhealthy fetish for statistics I think) so I’ve been pretty impatient waiting for my mail to come through. Anyway its here and I’ve been migrated – woohoo!

I thought it would be cool to blog about some of the functionality that is available in analytics … until I sat down to do it and realised what a very long blog post that would be. So here’s the first installment.

The dashboard

The first thing you see when you view a site’s stats in analytics is the dahsboard, and its quite a change:

The strangest thing I find about this is the changed date range – I’m accustomed to seeing my site stats on a per-week basis rather than the four weeks that it now seems to like to show. Its cool though and gives a better overall picture of what is happening, especially for people like me that often only drop in and even then not necessarily weekly!

There are so many options from this screen that I’m literally going to mention a few and save the rest for another day, making this my new mini series of blog posts1. To start with lets take a look under that temptingly clickable date range:

You can use either of these interfaces to pick your date range, which is really nice. The timeline one has grabbable side controls, so you can slide or stretch that range as you like.

Also note the compare control on the right hand side of the box … I used this with a week’s date range selected, and it projects last weeks data onto this weeks (although both date ranges can be altered) – look!

Its a nice touch and each point on that graph is hoverable, showing the exact number that has been plotted. Its possible to display all sorts of metrics against time from this one screen, look at that “visit” button on the top right?

Hidden in there is a treasure trove of options just waiting for you to drop in and get new perspectives on your traffic trends:

This simple section of the new interface kept me entertained for quite a while (although as I said, I do like statistics so am easily entertained by this type of thing), its slick and its easy to use and the flash does add a lot. I’ve found its buggy under Linux, although that might be more to do with the flash implementation than anything else, however it is a bit disappointing. I managed to borrow the MacBook though and that was much more stable (and hence the screenshots are raken in safari!).

I do like the new interface and I’ll be writing more about some other aspects of it in the future, if there’s anything you have found particularly useful or would like to know more about, add a comment and let me know.

Gender and the Tech Community

I could post a whole page of links on this subject, I’m a woman in IT and its not easy. The women I know in the area will already have read all of them anyway, so there’s little value in that.

This one is for the guys. If you only read one of the why-don’t-women-join-tech-groups articles, read this one. Please?

http://www.devchix.com/2007/06/09/let

Mysql Mishap

Last week I learned a valuable lesson about backing up MySQL, it was this:

  • It is not enough to copy the files out of /var/lib/mysql or wherever if you want to backup your databases.

The thing with copying files is that if the mysql daemon is still running, there’s no guarantee that the physical files are up to date or even consistent. MySQL can do its own housekeeping whenever it would like to which means file write operations. It also keeps information in memory and will write it to disk at a later time to suit itself. The recommended backup method for MySQL is to use the mysqldump tool – more on that later.

The Scenario

Having had a server failure and discovered that file backups taken while the mysql server was running was all we had, I was unsure if we were going to get everything back. I did manage to recover the databases, by doing the following:

  1. Find a server with a similar version of mysql. Happily my “lost” server was 5.0.21 and our development box runs 5.0.24 so I wasn’t too worried about changes in file formats.
  2. Stop the mysqld on that box
  3. Copy the files into /var/lib/mysql (this is on ubuntu but I think its a pretty similar setup on other distros). I didn’t have any data on this machine to start with which made things simpler. MyISAM stores its data in directories called the name of the database.
  4. Check the file permissions – the files need to be owned by the user that mysql runs as. This caught me out the first time around.
  5. Bring up mysqld and hold your breath.

In the event we seem to have most things and to be honest that’s more than I dared hope. There are some corrupt tables but nobody can swear that they weren’t like that before so with a bit of luck we won’t make any nasty discoveries further down the line [1].

MySQL Backup Strategy

I’ve been doing some setup on the new servers and backing up what was salvaged from the old one. I’ve devised a simple loop which dumps and zips each database in turn, using a shell script. The code for the script is below:

#!/bin/sh
for i in `mysql -B -u root -e “show databases” | tail -n +2`; do
echo $i
mysqldump -u root $i | gzip -9 > mysql/$i.`date —iso-8601`.gz
done

Its nothing that isn’t used by sysadmins everywhere but its simple and it works for me so its here (for when I forget what I did!). This example writes a .gz file for each database into a folder called mysql in the same location as where you call the script from. You probably also need to add -p switches to both the mysql and the mysqldump calls unless you are running with no root password which is rarely a good idea.

I hope this is all helpful to someone; I know I learned some useful lessons this week!

1 I’d also like to point out that this was an internal server with little critical information on it and a backup routine that’s been running so long nobody can remember setting it up. Which isn’t great but its less bad that it might be.

Fun With Unix: MOTD

I’ve been having fun over the last few weeks, writing about the fun things that you can do with Unix (see earlier articles about cowsay, fortune, mesg and go fish). This is the last in the mini series unless anyone has any other good suggestions for things that should belong here, and its MOTD or “Message of the Day”.

When you log into a unix box (or linux box, I’m using the term fairly indiscriminately in this instance) you will get a standard greeting message, usually telling you what kind of a system it is and adding a bit of a disclaimer. They aren’t very interesting messages but they are easy to change. Look at the contents of /etc/motd and you will see the text that gets displayed to a user on log in.

Traditionally this file is used by sysadmins to let users know of any changes that have happened or perhaps to warn of scheduled down time. However its also pretty usual to find something a bit more light-hearted there. My particular favourite is to add some ascii art as a welcoming banner to the user … what’s yours?

Making your blog number one

I’ve come across lorelle’s blog challenges before but this one caught my eye. The challenge is to come us with a search phrase that you are the top hit for in google. Here’s mine:

cowsay house

I think that pretty much sums up this whole site in fact! Can you rise to the same challenge? Let me know what your number-one-in-google phrase is.

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.

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 :)