aimee's personal journey

Main menu

Category linux

Post navigation

I needed to find a good quality image of a Wyvern, the symbol of Wessex, ancient kingdom of the West Saxons. The best i could find was the image on the Wessex Flag, below, but it is poor quality and can’t be scaled up. So i had to learn a bit about path tracing and scalable vector graphics.

Today i scanned several of my university lecture notes into PDF format. The ScanSnap document scanner makes this a very fast and easy process, and it includes text recognition. This feels good: i can save physical space by throwing away my notes, but still have them usefully available to me, in searchable format! yay!

Now that i’ve scanned these, i want to be sure that i don’t lose them. I’ve never been much of a person for backups, to be honest. My idea of a backup is something i do just before i upgrade Linux! But i’ve started to think i’d like to get into at least semi-regular backing up.

With that in mind, i came across this article: What’s Your Backup Strategy? by Jeff Atwood. The proposed solution works on Linux! Funny, i always assumed rsync was a ruby library: turns out it’s a straightforward command line tool.

That was enough to get me a first backup onto an external hard drive. Now it’s just a case of running that periodically to keep it up to date.

I’m not particularly interested in having a cron job because my computer isn’t always on, and the external drive isn’t always plugged in. So i just made myself a simple executable file to sit on the desktop and remind me to click it and synchronise the backup every so often.

I am quite sure that nobody cares about this except for me, unless they happen to have a similar scanner to mine. I’ve had to do this process about 5 times now on different installs. I can guarantee that it works for Fedora, Debian, Ubuntu and Mint. I thought i’d share it because i’ll probably need it again and someone else might find it helpful.

First you need xsane to be able to scan things at all.

sudo apt-get install xsane

Plug in your scanner by USB. Attempt to scan by typing scanimage. It won’t work, but you need to see the error message.

scanimage
[gt68xx] Couldn't open firmware file (`/usr/share/sane/gt68xx/PS1Dfw.usb'): No such file or directory
scanimage: open of device gt68xx:libusb:004:002 failed: Invalid argument

See that PS1Dfw.usb? You need to get that file from http://meier-geinitz.de/sane/gt68xx-backend/ but be aware that your computer might ask for a different file such as ps1fw.usb or ps1fw.usb. Whichever it is, find it on the page and click it to download.

Assuming it’s gone into your Downloads folder, move it to the right place.

sudo mv ~/Downloads/PS1Dfw.usb /usr/share/sane/gt68xx

Now try the scanimage command again. With any luck your scanner will burst into life and a whole load of crazy gobbledegook will splurge into your terminal window. This is the picture your scanner is seeing, trying to be displayed as text! Don’t be afraid to Ctrl-C to stop it once you see it working. Or you can just wait for it to finish.

You can also do this to ensure that your scanner is configured correctly:

Quite often i find myself wanting to resize a whole directory of images. Rather than opening them all in the gimp, i do it through the command line. I seem to do this often enough that it’s worth recording here, for my own reference as well as for anybody else who would find it useful.

One thing to note: it always resizes along the top edge, which may not be the longest edge. If you have a portrait file which is 1536×2048 it comes out at 1024×1365 (not 768×1024 as you might have expected).

The resize option can take a percentage, so if you know all your images are the same size then you could just send a 50% to reduce to half size.

I’m now getting rather excited about Scottish Ruby Conference! Not least because i’ve never been to Scotland before! I’ll be travelling up with Chris, James, Steve (tooky), Tris and Enrique. We’ve hired a car and we’ll take it in turns to drive. I’m looking forward to beautiful views on the way and plenty of geeky chat no doubt! ;)

At SRC i will very likely talk to anyone who will listen about the delights of Linux Mint on my MacBook. I dual-booted it recently and i love using Mint for my everyday operating system. Sure, Mac OSX is nice, but i just feel right at home with Linux. Being a crafter is all about the tools you use, isn’t it? :) I’m planning a blog post soon explaining how to install it and configure it for a MacBook, complete with pictures.

This last week i’ve been enjoying watching A Very Potter Musical on youtube. It’s a most hilarious Harry Potter parody with fantastic acting and delightfully catchy songs!

The star of the show has to be Lauren Lopez who plays Draco Malfoy and spends most of the time rolling around seductively on the floor/bench/harry/hermione! Lauren’s sense of comic timing is incredible, and the voice and facial expressions are just adorable!

Voldemort and Quirrel are beautifully played with some very touching moments together. Snape is hilarious, like all the characters, much exaggerated!

I think the best songs are near the end. “Not Alone” (Act 2 Scene 5) is a beautifully composed piece of music, and “Voldemort Is Goin’ Down” (Act 2 Scene 8) is magnificently performed by the cast.

I’ve enjoyed it so much that i’m making myself a dvd to take to show friends and family. I love it that the whole thing is freely available. By the fans, for the fans, and yep, the fans are loving it!

I also love how linux gives me free tools to be able to create a dvd. This morning i did not know how to do it, but using todisc and tovid i’ve been able to combine all the scenes into a sequence, with a menu. I used mplayer to extract the audio of one song, and audacity to split out the song that i wanted to use as an introduction when the menu is shown. I used kino to look at the frames one by one and export a frame to use as the background for the menu. I used the gimp to darken the image and reduce the contrast.

The menu for my dvd is hopefully going to look something like this:

I’ll update again if it works! Currently it is encoding each of the scenes into dvd format, which seems to take a very long time … and creates files 5 times bigger than the originals!

Update: it worked!! From youtube to my television!!

Thank you to StarKidPotter, youtube, keepvid.com and to free open source software and the ubuntu community! Now i can take A Very Potter Musical with me to show anyone who has a dvd player! :D

I admit it: i’m a Google addict! I’ve previously said that Google products are like chocolate bars: i always have to try the new ones! I used to be cautious, not wanting Google to follow me all over the internet, so i always logged out quickly. But recently i’ve thrown caution to the wind! I have fully immersed myself into Google Mail, Chat, Calendar, Docs, Maps and Reader. We use Google apps at work for all our communication needs. I’m considering getting an Android phone and writing apps for it. I basically love Google!

Chrome OS will be a super-speedy operating system (based on the Linux kernel) that will do one thing and do it really well: the web! With a great lightweight browser, the push towards HTML 5, Google Wave, and Google Gears for offline access, everything is pointing to the gap between desktop applications and web apps narrowing, and web apps taking over.

Haha, i just realised, they’re finally going to have to write Chrome (the browser) for Linux! Awesome! It’s been 9 months i’ve been waiting for that!

Update – things have moved on since i last checked – you can now download a development version of Chrome as a deb file for Debian and Ubuntu. The install was quick and easy, and it seems to be working pretty well, apart from keyboard shortcuts.

I recently installed Ubuntu Jaunty Jackalope and hadn’t yet got around to putting Rails on to it.

Installing Ruby and Gems and Rails and getting them all to work nicely together can be a pain, so i’m happy to say i managed to go from nothing to Rails installed and working in 14 minutes this time! Thanks very much to Installing Ruby on Rails on Debian/Ubuntu for most of the tips. Here’s how it panned out for me:

A couple of times recently i’ve found myself doing <ESC>:wq in the internet instead of pressing the submit button. I don’t use Vim very much at the moment – really only to make Git commits – but i’ve had enough of a taste that i feel it’s something i want to learn properly.

For a few months i’ve been searching for a text editor that i can use both on the Mac at work, and Linux on my netbook and PC at home. TextMate is a wonderful thing, but there is no decent Linux equivalent. A colleague and i started writing OpenMate – an open source cross platform equivalent to TextMate … but it’s hard! I enjoy gedit but failed to get gedit installed at work. I’ve tried NetBeans and jEdit but didn’t like them much, and they feel too big and clunky for a netbook.

After a little bit of reading about Vim i have become very excited. More excited that i’ve ever felt about a text editor before! I’ve realised that my conception of Vim has been wrong. I used to press i straight away to get into Insert mode, and stay there until i wanted to perform a command, in which case i’d press <ESC> followed by the command. Now i realise that a better way to use it is to be in ‘Normal’ mode most of the time, press i to enter Insert mode very briefly, and press <ESC> as soon as i’ve finished inserting.

This afternoon i discovered vimtutor and have been really enjoying it! You can run it on any Unix/Linux based system; just type vimtutor at the command line. It takes you through every command, at your own pace. It gives you samples of text to correct, using the commands you have just learnt. It’s actually quite fun and demonstrates the power of Vim very effectively!

At the moment i’m still muttering everything as i go, like “delete … 3 … words” as i very slowly type d3w and i’m exclaiming in delight at almost everything i learn – like – “Wow! That’s so clever!” I’m sure soon enough i’ll be able to use it effectively without making a lot of noise about it!

It is interesting learning it for Dvorak, but not too difficult. The up and down keys are in my left hand, and the left and right keys are in my right hand. They all actually fit rather neatly under my hands and feel intuitive even though they are not all in a line together. To be honest, i think i probably prefer it to the way it works under Qwerty.

Most of my life is spent coding Ruby on Rails, but occasionally i venture into the world of PHP. When i do, i sometimes need to configure Apache because, unlike Rails, it does not happen automagically! To save myself always looking things up on the Internet, here is a little summary of the things i have learnt.

Don’t do this!

When i very first started using Linux, i discovered that you could put files into /var/www and access them through http://localhost. This is a very bad idea because you don’t have permissions to the /var directory (for good reason!) so i used to end up chmodding everything. Also, keeping anything outside your home directory is bad news because you’re liable to forget to back it up before you do an upgrade! WHOOPS!

A perfectly good solution

The next thing i learnt was symlinking, or creating shortcuts. So you can set up a shortcut from the /var/www directory to an appropriate place in your home directory. For example:

More advanced: VirtualHosts

Later on i started experimenting with Apache’s RewriteRule and RewriteBase for nice ‘pretty’ URLs. You’ll soon find out that the symlink method is no longer suitable because you’re not using relative URLs anymore. It’s time to learn about VirtualHosts, so that i can access my local files with a URL like http://mac2.aimee.

Apache2 keeps a list of available configurations under /etc/apache2/sites-available. I have one called aimee.conf because i am egotistical like that!

It really just needs to know where to find the source files. The log and directory index are not especially important. It’s probably fairly obvious why i added them. There are plenty of other options you could use if you wanted to, but this is about all i use.

Next we need to enable the configuration. It’s as simple as symlinking the file from the sites-available directory. You only need to do this once per .conf file (and i only use one for simplicity).