No Blogroll

I’ve had a few requests recently to exchange links or to add people to my blogroll, its a way of giving a bit of kudos to people that you admire and whose work you read. The thing is, I don’t have a blogroll, and if I did I fear it would cause more problem than it solves. As a minimum, I’d need to consider:

  • where to put it on the site, its already quite cluttered
  • who should go on it
  • how to maintain it to reflect my reading habits as they evolve – maybe a direct link to my feed reader?
  • how do I prune it if it gets too big? Its like deleting friends from your phone but much much more public!

Its not that I don’t want to share some link love around either – there are many blogs I read that I’d like to own up to loving. Including (but not limited to) GirlsCantWhat, PHPWomen, Lig, Sara, Davey, Matthew, Jon, Ubuntu Tutorials, DevZone, Simon, DevChix and of course XKCD and Dilbert.

Is it a problem if I don’t have a blogroll? I quite like my site the way it is, I enjoy reading other people’s sites too and I share my appreciation usually through commenting. I’m not sure I should add something like this when I clearly don’t have the enthusiasm for it, what do you think?

Textpattern to Serendipity Migration Scripts

Not terribly riveting reading but this is the story of my migration from textpattern (version 4.0.4) to serendipity (version 1.1.3). This includes some PHP scripts I used to fix some problems on import – they’re not the best or the most robust in the world but they worked for me and I wanted to pop them here in case they work for someone else. Feedback on the code isn’t necessary because I won’t be using it again ;)

A running start

Firstly let me say that serendipity has a fabulous import feature which brought in 90% of my content about 30 seconds after I saw the button labelled “Import Data”. This is a real hurdle-remover for new users and definitely clinched the deal for me. Having done this I found that:

  • I had weird entity encodings everywhere
  • my images hadn’t arrived
  • everything seemed much more spaced out than it had been on the old blog

Images

The images hadn’t been transferred and I also realised that the custom tags that textpattern uses, such as:



hadn’t been handled by the import script, so I kind of had two problems to solve. I started by transferring all the images across and renaming them to something more helpful.

This is going to be a really long article, but do read on if its helpful – I’m posting the rest as extended content so the disinterested need not scroll past it! Continue reading

Mysql show processlist

A very quick entry today, life seems to be so busy at the moment but I have to write this down before I forget. Today I had a weird situation where mysql was consuming a lot of resources but didn’t seem to be actually getting anywhere, as if something was “stuck” inside it. Using the processlist I was able to diagnose the problem. From the command line just run:

show processlist;

If you’re a phpMyAdmin user, then there’s a link for “processes” on the front page of your installation. Give it a try when things seem to be taking longer than they should!

A Very Narrow Howto of Podcasting

I recently featured in an episode of Zend’s PHP Abstract. A few people have asked how I went about preparing and recording the piece so here’s a quick overview.

Choosing a Topic

This actually wasn’t hard because I wanted to pick something that I have particular knowledge of. As a part-trained Oracle DBA with experience of Oracle and PHP, these two topics seemed like an obvious choice.

Preparing the ‘Cast

I was quite determined not to read aloud from a script, so I put together some bullet points and practised doing the talk from those quite a lot. Playing back these attempts helped me to see what worked and what didn’t – those points got added, removed and re-ordered quite a few times. Even after a lot of practise, I was still pausing too much between points. I ended up transcribing my unscripted version and then re-recording it, which worked well as I had my own natural language but no pauses!

Sound and Software

I was concerned that I would need additional equipment, such as a better microphone. However my partner has a macbook and the built-in microphone on that proved to be up to the job. I used Garageband from Apple’s ilife to record the track (and also to edit out the clicking I got from pressing the mouse to start/stop recording!). This saves files in .m4a format, but this can be converted to .mp3 using itunes.

Simple Rsnapshot Setup

Rsnapshot is a perl-based backup script manager. It is a journalised backup system – meaning that it copies all your files across to the backup media once – and then the only data it transfers after that is the changes. The backups appear on disk as complete copies – but where two generations are exactly the same file, they’re actually symlinked to the same data.

Backup Strategies

Rnsapshot has hooks for scripts that run before and after the actual snapshotting. I use the “before” script to:

The after script just unmounts the drive. To add these extra scripts you just uncomment the lines containing the cmd_preexec and cmd_postexec paths and point them to your scripts.

Getting Started

Well I could write a lot about this but to be honest I doubt I’d do better than the excellent rsnapshot howto so I suggest you read that for how to do it. Basically, enter the path you’d like to back up to, the interval you’d like to use, and then a bit further down the page which directories you want backing up (the default is /home, /etc and /usr/local) – then run the command! The howto even includes instructionsn on setting up cron to call the command regularly.

Rsnapshot Conclusion

Rsnapshot was a good tool to stumble upon as a learner sysadmin (which I am) and its very easy to use. I love the fact that it isn’t rocket science, but its a really nice, usable version of a collection of scripts which are duplicated by system administrators the world over. The file structure of the backups is the same as the content that is backed up and retrieving any generation is as simple as copying a file over. I’m sure there are other solutions out there, but I’m a convert and use it on all the local servers I administer (Ubuntu boxes, it works a treat).

Top top Tips

That is to say, some top tips for the command-line program top. Top is a program to show you the top processes consuming resources on the system. You can then press other keys and the program will respond. For example:

q to quit

z to get a colour output

x to highlight which field the results are sorted by

< and > to change which field it is sorted by

c to tooggle between the program name and the full command that was run

I don’t use every program often enough to just remember the keyboard shortcuts so its nice to keep a virtual crib sheet :)

Reliably Avoid Subversion Collision – Commit First!

Subversion is a source control system – an excellent accompaniment to software development especially in a team setting. When working with a number of people, it is likely that at one time or another there will be collisions – for example at the moment a project I am working on has a team making some amendments requested by the client for a website. Subversion is handling it all well but the main template files and stylesheets are colliding often as everyone is making changes.

Commit First!

The collision will only occur if you check in a change and someone else has already changed that line in a file. To avoid getting a collision in your working copy, the best thing to do is to commit your change before the other person does.

This approach of commit early, commit often will help you to develop more smoothly without the interruptions of a collision and without struggling with lots and lots of merged files when you’ve left it too long between commits. Additionally you’ll have more checkpoints in your own development history so if you need to go back a few steps, the repository will be able to help you whereas if you didn’t check in, it won’t!

That’s my tip for the day – on a day in a place where many people are bug fixing a single project!

Setting up MySQL to listen to external ports

I had some difficulty setting up mysql to listen to external ports on a server – the development web server uses databases on another box. The important setting was in /etc/mysql/my.cnf where I removed the line:


bind-address = 127.0.0.1

You should then be able to connect a client from another server to this mysql server.

As a warning – bear in mind that it is usually good practice to set up user permissions to only be valid when accessing from localhost if that is the intention – check your mysql table if you can log into the server but then start getting permission problems for other users.

Hope this helps someone!

Twitter, meet Facebook. Facebook, Twitter

Having recently embraced the social networking revolution, or not, I have recently been getting exasperated by how out-of-date my status gets when I can’t be bothered to update it. And how annoying that there are statuses on both Facebook and Twitter which are both out of date.

I stumbled across the instructions at http://www.jeffsandquist.com/HowToPublishYourFacebookStatusToTwitter.aspx and used these so that when I update facebook, the same status appears as a tweet1 on twitter!

If you use both applications then I’d recommend giving this a try. It uses twitterfeed as a go-between to get your RSS feed of statuses out of Facebook and in to Twitter. If you give it a try, let me know how you get on?

1 I am assured that “a tweet” is the singlar label for an entry on twitter. And furthermore that a person posting these entries can be said to be “tweeting”. So now you know!

Women Together

Most people know that I’m active in the phpwomen community, women in technology is something that I really believe in but won’t start ranting about right now (or I’ll not get round to what I was going to say!).

Today I’m getting to grips with irssi which is a command-line IRC client. I was struggling with some quite dry documentation when I came across this tutorial from Ubuntu Women which has really helped me to get sorted out.

Yay for the women :)