Wednesday 21 November 2012

New skin for my website

In an effort to not look like I've learnt nothing in the last four years, I've reskinned my website. I don't kid myself that anyone actually wants to know this information, but by writing a post about it, in years to come I can find out when I released this particular version by looking at my blog. That's keeping some kind of digital timeline - the digital archivists would be proud.

Wednesday 7 November 2012

Legend of the Five Rings name generator

I GM a Legend of the Five Rings game and I find coming up with names for the NPCs something of a trial at times. I found some decent lists of names, but what I really wanted was a tool to generate me 20 or so random names to just use.

Much like this one.

This goes with my roll and keep statistics toy from a while ago - built so I could learn roughly what adding an unkept dice would do to the skill checks of an NPC.

If you're interested, you can find the code for the name generator and the dice roller on github.

Tuesday 23 October 2012

Quantal Quetzal - second impressions

Printing has broken. Sigh.

This is actually a cups issue, not an Ubuntu one - Ubuntu has simply included the latest version of cups in its repositories. Sadly, cups 1.6 removes the network discovery feature so if you're using it, your printer list post-upgrade will look rather barren.

There are an assortment of bugs opened about this issue. Here's hoping someone forks or patches the project.

Monday 22 October 2012

Quantal Quetzal - upgrade and first impressions

The new version of Ubuntu is out. In a fit of enthusiasm I upgraded my work machine this morning. Turns out that although the new version is out, it hasn't been out long enough for the packages to all make their way across - consequently I'm without my ldap browser of choice, luma. Sigh. Hopefully this will resolve itself in the not too distant future.

Mostly a simple upgrade otherwise. Just a couple of things broken:
  • autofs now needs to restart on network up instead of reload else it doesn't mount properly
  • needed a new method for moving the window close buttons
  • some glitches with the window manager (which seem to have gone away on their own)
  • slower boot times
  • keyboard shortcuts reset (thanks...)
  • shopping in lens (remove with "sudo apt-get remove unity-lens-shopping" although you'll need to restart your window manager)
Fairly painless all in. I just don't recommend doing it for a week or two. The lack of a decent ldap browser wont bother most people but the Unity config tools we've all come to depend upon have also yet to make the jump and their absence will be more annoying.

New things? Well, there is the incredibly annoying shopping integration in the Unity lens which presented me with something that looked suspiciously like porn for the 30 seconds it survived before I killed it. Upgrades? I'm sure there are some of those too.

Friday 28 September 2012

iOS6 - first impressions

The lure of up to date websocket support was too great, so I jumped to iOS6 pretty much immediately. Upgrade was mostly painless. Aside from the maps, the only real problem I experienced was with a broken gmail account. Seems this is a common problem simply fixed by removing the account from the phone, resetting it and putting the account back. Worked for me - I'm getting emails again. Yay.

Also, as I'm sure everyone is aware, the youtube app has gone away. There is one in the app store to replace it if needs be. There is apparently a google maps app on the way too.

I've not had the horrible experience with the new maps it seems everyone else in the whole world has had. I like the inclusion of places of interest on the main map screen. I dislike the loss of street view. So far, my searches haven't placed me in Spain, on the moon. I can't claim to be a heavy map user though.

Otherwise, iOS6 is pleasant. There are numerous minor UI tweaks - including moving the Bluetooth switch to the top level of the Settings menu and an expandable blob when refreshing emails which is apparently the best thing evaaa. It seems a little faster than iOS 5 but that might be my imagination.

The biggest change I've noticed is the redesign of the app store and music player. Both are pleasing changes to my eye - the icons are clearer and bolder and the target areas are better defined. I like the new "show all music from this album" feature (is it new? or did I miss it before?) which will no doubt inspire me to spend more money on music.

Oh and there is Passport. Great.

Summing up? Bit meh. Looks nice. Maps are (apparently) a problem. Time to go play with the new websockets.

Friday 17 August 2012

Play 1.2.5 and OpenID

Continuing my drive to write simple examples for features of Play 1, here is an app authenticated by openID:

https://github.com/tomnatt/play-openid-example

It's prepped to use the Google openID system, but that is easily changed in the interface. As with the websockets example, this exists because the existing examples floating around the web are for an older version of Play and don't quite work. In this case, the official docs seem rather sparse too.

Anyway, I found it useful. It's possible someone else will too.

Gotcha on this one - Google doesn't have a personalised URL for using openID. The one in the code is the same for everyone, and is returned with an id parameter so the app can identify the user in question.

Friday 6 July 2012

Nautilus since Ubuntu 12.04

For the record, a collection of things I've had to learn about nautilus since Ubuntu 12.04:
  • alt + up / down (or alt + left / right) navigate the breadcrumb trail from the keyboard
  • ctrl + l switches the breadcrumb trail for a more traditional address box and gives focus
  • F9 disables / restores the left panel
  • apt-get install nautilus-open-terminal provides an "open terminal" option in the right click menu
Not very exciting, but at least I'll remember it next time I have to install a system now...

Friday 1 June 2012

Websockets and the Play Framework

You'll find lots of posts about why websockets are interesting - many of them from people demonstrating them using the Play Framework. I am not going to go over any that ground but I am going to mention some example code I pulled together to demonstrate websockets in Play:

https://github.com/tomnatt/play-websocket-example

Most of the older posts are from at least 6 months ago. While the theory is right, the code examples will no longer work because the websockets specification (and hence the browser and framework implementation) has changed. In fact, I have not seen a Play 1.2.5 example yet. So here is one, mostly cobbled together from other people's older code. Shoulders of giants and all that.

Anyway, for this example you will need Play 1.2.5rc3 or above and Chrome 19+ or Firefox 12+. I haven't tested it in Java 5 but I wouldn't be surprised if Java 6 is also a requirement.

The example is the pretty basic: browser sends an event over the websocket, controller at the server end echoes it back to browser and everyone else also looking at the example page. The bit to watch out for is the handling of the event queue. The message originator has the event echoed straight back. For everyone else, the message is added to an event queue which triggers the echo via a different mechanism.

The code is over-commented so hopefully other folk can benefit from my stepping through it all.

Configure the window close buttons in Ubuntu 12.04

One thing I really don't like about Ubuntu if the insistence in putting the close window button in the top left. I don't know if this is a Linux thing, but I'm sure older versions defaulted to close in the top right.

Anyway, you can easily change it.

* install gconf-editor
* navigate to /apps/metacity/general/
* find button_layout and change it to whatever you like

The key to the positioning of the buttons is the colon. I went with:
:minimize,close
because I don't really care about maximize. Everything to the right of the colon is floated right.

Another tweak worth considering if you're a keyboard shortcut person is rebinding "Key to show HUD" in the Keyboard config screen. That is the one which, if your experience is anything like mine, is capturing your keypress when you try and alt-tab around.

Edit:
Since 12.10 it seems the gconf-editor setting is sometimes ignored. You can move everything by running this on the command line:
sudo gsettings set org.gnome.desktop.wm.preferences button-layout ":minimize,maximize,close"

Friday 18 May 2012

Restore u300s touchpad on resume in Ubuntu

I have finally found the time to fix the touchpad on my u300s. It was causing problems on resume from hibernate (as per notes from before). After a bit of poking around I've found a work-around.

I have synaptics which applies its changes on boot, however I have a problem with resume. Solution is this script:
#!/bin/sh

# Restore three finger tapping

case "${1}" in
    resume|thaw)
        # faster speed and acceleration
        DISPLAY=:0.0 su  -c "/usr/bin/synclient MinSpeed=1 MaxSpeed=2.81 AccelFactor=0.13"
        # 2 fingers scroll
        DISPLAY=:0.0 su  -c "/usr/bin/synclient VertTwoFingerScroll=1 HorizTwoFingerScroll=1"
        # enable tap to click (2 fingers for middle click, 3 fingers for right click)
        DISPLAY=:0.0 su -c "/usr/bin/synclient TapButton1=1 TapButton2=2 TapButton3=3"
        ;;
esac
Put in /etc/pm/sleep.d/ called something like 80_touchpad_restore and remember to make it executable. Done - mouse settings will be set as per this script on resume from hibernate.

Solution was cobbled together from here, here and here.

Playing with <audio>

I was looking for a better option than directory listings for making a folder of mp3 files accessible on a website so I wrote a very simple php loop.
Initially I omitted the firefox support (firefox doesn't play mp3 files) then, when adding it, I needed to convert my mp3 files into oggs. Step forward dir2ogg which is completely perfect:
dir2ogg -d .
Will quite happily convert all the mp3 files in the current dir to oggs. What more could you ask for?

Getting it on ubuntu is as simple as:
apt-get install dir2ogg

Friday 11 May 2012

How to play Star Wars - Harmy's Despecialised Edition

Are you one of those fans who think the Star Wars original trilogy has gotten worse with each successive release? Do you get angry watching Han Solo step on Jabba's tail and not get his face shot off? Do you go on about Han shooting first? Or wonder where the mountain went in the twin sun sunset?

In short, are you a human being?

Help is at hand, from a chap named Harmy. This colossus of a man has created a "despecialized" edition - basically an upscaling with all the new additions taken out. You can find the iso files here.

Actually playing them is a bit of a trick. The first (platform non-specific) tip is:

Make sure your files are not corrupted.

Seriously. That cost me a couple of evenings.

Windows 7

* mount the iso as a drive using daemon tools
* download vlc - I have this running with version 2.1
* in vlc do media -> open file -> select your virtual drive -> bdmv -> stream -> m2ts file

Et voila!

Linux

* mount the drive thus:
sudo mount -o loop -t udf $path_to_iso/ANH.ISO $mountpoint
* download vlc or pull it from a repository (package name vlc in ubuntu)
* in vlc do media -> open file -> mountpoint -> bdmv -> stream -> m2ts file

Suddenly you're back in the past, watching Star Wars version awesome.

Thursday 10 May 2012

Installing Ubuntu 12.04 on a Lenovo u300s

After a bit of faffing I have Ubuntu 12.04 running on my Lenovo u300s.

Important info:

* You can build a usb installer using the utility here
* It is possible to keep One Touch restore working and nuke all of Windows if you're brave with the partition table
* Windows will keep booting until you remove the small partition no matter how many times you think you've deleted it - presumably the mbr is in there?
* The touchpad is a pain - you need to install the synaptics drivers and tune it there, but it will reset when you wake from hibernate. Found a fix for this.
* Hibernate and Suspend are easy to fix using this script
* Hibernate can be re-enabled in the power menus using this fix
* To save battery power, Bluetooth can be disabled on startup using the first answer here
Don't forget to install build-essential and synaptic packet manager. You want also probably want rcconf to update applications running at startup (command line tool). Finally, you might want to move the window buttons.

Unity seems quite good on the u300s. This isn't the first time I've encountered this environment but it's the first time I've not utterly hated it. The extra width on the laptops screen (over a standard 4:3 ratio screen) makes the left menu bar work - especially once it has been shrunk as far as it will go. There are a couple of oddities (such as some programs sometimes not appearing in the alt-tab list) which I hope will be fixed soon.

Note about the touchpad. This is the first modern (ie less than 7 years old) touchpad I've used and it took some getting used to. Sensitivity and cursor speed can all be configured in the synaptics driver menu obviously but it's worth mentioning the "disable touchpad on keyboard use" option. If you're using the keyboard to navigate (such as alt-tab) you will find this triggers the mouse disable regardless of the "ignore multiplier combinations" setting which is really annoying. Also, the mouse responds to taps thus:

* one finger tap - left click
* two finger tap - right click
* three finger tap - middle click (needs enabling)

Horizontal and vertical two finger scrolling can be enabled in the synaptics interface.