Colourful Tabs in Screen

A while ago I posted about screen, and included my .screenrc file. I got some teasing for this, since the tabs show up pink. In fact this .screenrc file is one I stole from somewhere a few years ago and didn’t really think much about the colours. Since then I’ve fiddled with the colours and now use different colours on different servers, which is a nice little addition.

Its really easy to do – using the .screenrc from my previous post – just replace all the M and m characters in the last line with the colour you’d like. I started off with something like this:

Y is for Yellow

replacing m with y and M with Y I get:

Green and Cyan

I’ve also used g/G and c/C codes for other servers, which looks something like this:

Titles

I seem to be keen on subtitles in blog posts, but I’ve not labelled many of my screen tabs in these examples (I have no idea why, I usually do). The yellow example has one where one of the tabs is named and this is really helpful once you get past about three tabs and start losing which one was tailing the apache logs! To label a tab in screen, go to that tab and then ctrl+a, shift+a and you are typing in the box. Enjoy :)

Stale NFS File Handle

We had some fun and games with our house server recently, when one of its disks died horribly*. I’ve only just got around to sorting out the backups again now, which use an external USB hard drive and rsnapshot. I started by reading my earlier rsnapshot post and also the one about the gotcha with mounting external drives. And yes, I do use this blog instead of a working human memory, much easier to find things.

When I mounted the drive, I saw I had one of the older daily.* directories with question marks for its name, date, permissions and so on when I ran ls. When I tried to do anything with the directory, I got the error stale NFS file handle, which was interesting since we don’t use NFS. After some looking around, I got the recommendation to run fsck.

Before running fsck, the drive must be unmounted.

Then, since mine was sdb1 I ran:

fsck -y /dev/sdb1

The -y switch asks fsck to try to fix every problem it encounters (this was quite a life saver, there were thousands of them before I stopped holding my finger down on the “y” key!) – it comes with warnings that experts may do better to fix manually, but really that’s not me.

The disk is now fine and the backups run fine, I guess it was just the old disk on its way out copying nonsense onto the external drive during backups.

* The stupid thing then blew up its power supply and took the UPS with it a week later, but that’s the way the cookie crumbles.

Relocating a WordPress Installation

WordPress is a fine basic website tool, and I’ve used it for a few different odds and ends. One thing it does have that suprises me every time is that it uses a setting for its web address. So as part of the install, it sets this setting and then everything works. Or rather it does, so long as the web address of the application doesn’t change.

Well I’m working on something that I’m developnig locally, checking in to a subversion repository, and then deploying to another server (and other people will be doing the same when they collaborate with me). WordPress isn’t really designed for that, or for the situation where you have a copy of the database, and the code and need to restore it to a different place for any reason. The admin login form is accessible – but then submits to the old location before you can get in to change the settings.

Anyway it turns out to be really straight forward. The URL is in the database and a one-line query mends the problem. I’m putting it here for the next time I need it :)

update wp_options set option_value = 'http://new.path.to/blog" where option_name = 'siteurl';

I found some complicated instructions for moving a blog too – but this will also work for that scenario. This was wordpress 2.7 (their new and shiny version!), I’m not certain which other versions this would apply to but add a comment if you can expand on this please!

Girl Geek Dinner Next Week

I’m getting quite excited now about the next Leeds Girl Geek Dinner which is next Wednesday (3rd December 2008). Got some cool speakers by the look of it – I know Monica (and she is fab) and from Katie’s bio we are in for a treat. Also I have been promised there is more food this time (hot and christmassy food …. yum) so count me in.

I often get asked why we don’t allow men at these events – well of course we do. Men can attend but only when they are invited by one of the attending girl geeks (maximum one man each please, ladies!) – meaning we can have men who are likely to contribute to the event but not be invaded if we don’t want to be. If you’re a guy and looking to go, find a girl geek and ask nicely :)

I’ll definitely be at this event – I look forward to seeing some others. I had a great time last time – so go and buy a ticket (cheap night out at £15!) and I’ll see you there!

Speaking at “Beauty and the Geek”

I’m giving a talk next week in a Beauty Salon. Yes, really :) There is an event entitled “Beauty and the Geek” at Heaven Spa in Didsbury – details on their blog – and the event is on 26th November. It sounds like a fun mix of beauty techniques (mouse-finger massage, anyone?) plus a talk by yours truly … although I need to a) figure out how to give a talk with no projector and b) live up to my reputation as “influential blogger” – if you’re going, then let me know and I’ll see you there!

Leeds Girl Geek Dinner – December 3rd

Announcing the second girlgeek dinner in Leeds! The event will be Wednesday 3rd December, at The Loft Leeds and tickets are available now, priced at £15. Monica Tailor from Kilo75 will be speaking at the event, and it will have quite a Christmassy feel.

The rules of the girl geek dinners is that any geeky girls can go – and not just tapping-into-a-black-screen-in-a-darkened-room geek girls, there is no minimum requirement! Guys are also welcome but they must be there as the invited guest of one of the geeks. I’m open to persuasion if anyone would like to attend as my guest – and for the girls, I’ll see you there :)

Opera’s Address Bar AutoCompletion

I recently upgraded the copy of Opera on one of my machines, only to find a few things about it which had changed from previous versions were driving me mad!! Immediately noticeable was that the address bar autocompletion seemed to have gone completely nuts. It was autocompleting all sorts of addresses that bore no resemblance to what I was typing, and it was giving me deep-link choices first, so I couldn’t autocomplete to just the domain I wanted, for example.

It turns out that this new behaviour is, in fact, a feature – Opera remembers the content of all the pages you’ve been to as well as just their URLs, and then it tries to give you the most relevant matches in your address bar. Well that doesn’t work for me. Address bars are for typing addresses and search engines are for searching content in my world, maybe I’ll find this useful one day but that day isn’t right now. The good news is, its easy to turn off.

Just go to Preferences -> Advanced -> History and then uncheck the box “Remember Content on Visited Pages”. Now when I start typing, I just get the URLs that look like my actual words, and with the shortest matches first. I’m safe to upgrade the other machines now!

Screen for Linux

I use a lot of apps from the command-line, partly because command-line stuff is the same on every system, and partly because I struggle to use a mouse for RSI reasons. Unsurprisingly, the best keyboard-navigable apps are ones that only use the keyboard in the first place! One app that I can’t live without is screen which allows me to have one ssh connection with multiple windows in it. What’s even better is that I can detach and reattach it – so if I’ve got a complicated set of screens open on a server, or even if I’m just using IRC over a dodgy connection, I can run it in screen and go back and re-attach when I need to.

I use a custom .screenrc file, which adds numbered labels so show which screens I have open, so I see something like this at the bottom of my screen (click on it to make it normal size, the thumbnail is somehow tiny):

My .screenrc file looks like this:

termcapinfo xterm 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'
termcapinfo xterm ti@:te@
shelltitle '$ |bash'

termcapinfo rxvt 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'
termcapinfo rxvt ti@:te@

hardstatus on
hardstatus alwayslastline
hardstatus string "%{wk}%H%{Bk}|%{Mk}%?%-Lw%?%{km}[%n*%f %t]%?(%u)%?%{mk}%?%+Lw%? %=%{Bk}"

Don’t ask me what any of it does, I got it from someone else and just copy it around machines all the time! The tabs create themselves when you create a new screen (ctrl + a, c) and then you can edit the labels with ctrl + a, A. What else can you do with .screenrc? I must confess I’ve never really looked

How to Submit a Conference Talk

Speaking at conferences is a great way to share ideas and meet people – but actually getting the opportunity to do is a little more tricky and usually involves proposing a talk. In the last year I’ve attended IPC in Germany and PHP London, spoken at DPC in Amsterdam, submitted talks to and attended ZendCon, and helped select the sessions for phpnw – so I’ve seen it from all angles.

The first thing to say about submitting talks, is that there are no pre-requisites. You don’t need to be published, well-known, or have letters after your name (in the PHP community, the latter is probably more hindrance than help). If you want to go to a conference, and there is a topic you’d like to share some thoughts on, then write them down and submit! A lot of conferences have a Call for Papers – usually this will be an online form where you put in your personal details and the details of the talk you’d like to give. If it sounds simple, that’s because it really is …

Proposing your talk

It can be tricky to know what to write in the boxes and how to sell your talk to the conference organisers. The call for papers should give information about the themes of the conference, the expected audience, and the kind of content they are looking for – so pay attention to this. Usually you’ll be expected to submit an “abstract”, this is a description of your talk that will be put on the schedule if you are accepted. A good way to get started with these is to read the abstracts from current conferences – these are the ones that got through the selection process and will give you a good idea of what you should say here. Its usual to also be asked to supply a biography, either when you submit your talk or when the talk gets announced as part of the conference schedule.

If there is room for additional information, then give it – and give the organisers as many opportunities as possible to feel like you would be a positive and safe addition to their event. I’ve seen a few variations on these but for the phpnw call for papers, we added a box which we didn’t publish the contents of and where speakers could tell us why we should have them and/or their talk. This was illuminating, responses varied from “because this topic is so cool!” to “not sure really, thought it might be interesting though” and the unforgettable “meow” (that last one was from an entry that didn’t get accepted – it was hard to tell if the speaker was taking the whole thing seriously or not).

My advice is to start planning your submission in plenty of time – take a look at the information that you will need to supply and make sure you have it all (and do write in the optional boxes). Its also a really good idea to bounce your idea off some other people, who can help proofread and point out any obvious problems with your submission – for example the time I tried to submit a talk to a PHP conference without the word “PHP” anywhere in my proposal …

Getting your Talk Accepted

I have yet to successfully submit a talk via a Call for Papers and be accepted to speak at a conference – so I have no idea how to get talks accepted. If anyone else can add advice on this topic, that would be great :)

rsnapshot flag for usb drive

rsnapshot is a great tool that I use for all my backup stuff, its really easy and seems pretty robust (or rather, I haven’t broken it yet!). When I set it up most recently, I discovered that it has a very useful flag, no_create_root. The problem I often have is that since I back up to removable media, if the disk isn’t mounted, rsnapshot will back up to the local drive instead, in the mount point – and then I’ll promptly run out of space. Stopping rsnapshot from creating directories means no writing rubbish into your mount point, and this setting is designed specifically for this issue with removable media.

This setting does have a gotcha, however. It does the check for whether the directory exists before it calls the script named in cmd_preexec – so if you were hoping to mount your drive in the pre-exec script, you can’t! I was very confused why my rsnapshot configuration didn’t work to start with. My workaround is to run a separate mount script before calling rsnapshot in a cron job, not ideal but it does work for me.