tensixtyone

Rants of Andrew Williams / Nik_Doof

Archive for the ‘Projects’ Category

OBLogout 0.2 Released

without comments

I have to say, hell has actually froze over. I’ve been promising this release for months now and I never thought i’d actually get it out the door. Due to numerous showstopping bugs and hitches this release has seen numerous delays. Finally, we’re there.

OBLogout is a logout and shutdown script designed with Openbox in mind, it’s simple, themeable, extendable, and useable even on a low powered machine like a EeePC. This new release sports alot of new features:

  • Keyboard shortcuts – each button can have a shortcut key assigned to it
  • Customisable commands – allows for you to modify what each button does.
  • PolicyKit support – allows for everything to work well with HAL.
  • Better theme support – themes are easier to setup and change.

If your interested, drop over to the Launchpad project page. At the moment i’ve got packages for Ubuntu Intrepid and also Arch, if anyone wants to contribute any others then please drop me a mail.

So now I storm onto the 0.3 release, I’ve got a few blueprints that I want to clear on this release but i’m always welcome to new ideas. If you have any suggestions then raise a blueprint on Launchpad.

Written by Andrew Williams

April 13th, 2009 at 11:06 pm

The version controlled home directory

without comments

For the last year or two i’ve been using SVN to store my common configuration files, this has worked wonders and has enabled me to move my config seamlessly between systems with a few simple commands. In the last day or so i’ve decided to move from SVN to Git as my control system, and now I think it’s a time to do a post on why exactly i’m doing this.

The idea of a version controlled home directory stemmed from people storing their /etc config files in CVS, this allowed for any modifications to be tracked, tested, and if worse came to worse, rolled back without much hassle. These ideas can be very useful for the end user, imagine you want to fiddle around with your terminal settings but forget to make a backup of your original settings, the time you spend trying to fix it back can be avoid with a simple vcs command. Another situation that I often get into is when you format or move to another system, a few quick commands can return your config and no pain of trying to remember your favourite settings.

So, how do we do this?

Each person has their own method, and hopefully I’ll describe my little world to everyone in a easily digestible way. It’s neither pretty or easy but it works for me.

My SVN version was very simplistic, a single repository broke down into “packages”, which contained the batch of config files for each program, such as “irssi” or “bash”, these would live under “trunk” in the repository.

~/trunk
$ ls
abook          gtk2     ikog   keepass-private  mutt  ssh          tin
gnupg-private  hamachi  irssi  mozilla          pine  ssh-private  xchat

For each machine I made a new branch under “branches” then I would use the “externals” properties to pull in the packages that I needed from trunk. So, when I wanted to pull in my configuration I would simply checkout that machine’s branch into a folder then symlink the required files over as needed.

~/branches
$ ls
ithaca  manex  orion  vektor

This took time to setup but once the initial linking was done it was a simple matter of managing the files in the single checkout folder.

This system served me well for a year or two, but with the increase of machines and the general pain of symlinks I decided I needed a new method. I reviewed a few examples but the one that stuck with me was Martin Krafft’s system using Git, MR and a few handy scripts. I’ve now managed to rework this into a similar system for myself.

First of all, you need a method of getting the configuration files in the location you require. Git has this excellent feature to having detached worktrees, this allows you to remove the need for symlinking all together. For example, we can setup a git repository in a storage directory then tell the repo to checkout the files to your home directory.

$ mkdir -p ~/.dotfiles/test.git
$ cd ~/.dotfiles/test.git
$ git init --bare
$ git config core.worktree ../../

So now, you have the test.git repository, and the worktree is your home directory. Now it’s simply a case of checking in the files you require and commit them to the repo. This scenario is a little different from the original Git idea so a little bit of a workaround is needed to actually use the repo in this way. Two variables need to be configured for Git to use the detached worktree as desired.

$ export GIT_DIR=~/.dotfiles/test.git
$ export GIT_WORK_TREE=~/.dotfiles/test.git/../../

Now, you can use the Git command as if you were in a normal Git worktree. This is a pain to work with by hand but luckily Martin also created a little shell script to set these variables as needed. It’s based on zsh but i’m in the process to converting this to bash to avoid a extra unneeded dependency on my part.

So, we can get the configuration files to the place they need to be, now we move onto actually packaging and distributing the files. I decided that Martin’s method works the best, using the mr tool you can configure and manage multiple repositories and automate the checkout and update of these. This with tool the management of your packages can be done by simply changing the config file of mr.

mr supports importing extra configuration files based on wildcards, this allows for a global configuration to be setup which will only include configuration on a per machine basis. For example in the current .mrconfig I have this.

[DEFAULT]
include = cat ~/tools/mr/lib/* ~/.mr/* 2>/dev/null || :

Simply put, this will include any files in my ~/tools/mr/lib/ and ~/.mr/ folder. Then in my .mr folder I have a file for each type of package I have available

[.dotfiles/mr.git]
checkout = git_fake_bare_checkout 'ssh://git.tensixtyone.com/mr.git' 'mr.git' '../../'

[.dotfiles/bash.git]
checkout = git_fake_bare_checkout 'ssh://git.tensixtyone.com/bash.git' 'bash.git' '../../'

[.dotfiles/bin.git]
checkout = git_fake_bare_checkout 'ssh://git.tensixtyone.com/bin.git' 'bin.git' '../../'

[.dotfiles/ssh.git]
checkout = git_fake_bare_checkout 'ssh://git.tensixtyone.com/ssh.git' 'ssh.git' '../../'

So when I execute the mr command this will checkout each of those repositories as needed. If I require any extra packages I can pull in another config file and drop it into the .mr folder.

Now we have the method and the configuration sorted, how do we get this onto a bare machine? Again, Martin has come to the rescue in a form of a script he has setup to do the initial bootstrapping of a fresh account, it pulls in the basic configuration for mr and then it’s a case of dropping in the require config files into the .mr folder. Job done.

While my system isn’t perfect yet, it is workable and very flexible. The benefit of being able to move my active configuration between machines with a few commands outweighs the time needed to setup and configure the system. If you are interested my public configuration files are available via gitweb, hopefully from the mass of files you can work out what i’m doing. For the bootstrapping script check the setup.git repository, for my mr configuration files check mr.git.

If your interested in setting up a version controlled home directory, I’d advise you to join the vcs-home mailing list and check out their archives and wiki. Also, remember there’s no all ruling version control system to use for your home directory, Git works well for me but it doesn’t for everyone. The idea is to have a system that works for you, while I’ve followed Martin’s example very closely, again, this wont fit all.

Written by Andrew Williams

April 13th, 2009 at 2:02 am

Posted in General, Projects

Tagged with , , ,

A few days with Android

without comments

Last week I finally got round to ordering a T-Mobile G1 and I got accepted, and to be honest I was expecting my contract application to bounce like a rubber ball. I guess I left T-Mobile on good terms last time so they’re one of the last networks in the UK that will actually accept me for a new account. I’m quite a aficionado of mobile phones and I do like “smart phones”, so I’ve decided to write this brief overview of the handset and of Android in general.

Out of Box Experience

I ordered my handset online so I had the joy’s of Royal Mail to contend with, that alone is a separate post and UK followers will know the usual pain everyone goes through in regards to getting anything shipped by them. The first issue that tripped me up was that the SIM card was loose in the packaging and not even slid into the handset box. In a rush I nearly binned the SIM and scupper my chances of actually using the device for another week.

The G1 is very nicely boxed, almost in the same way Apple devices are usually done. Since the release of the iPod and it’s over the top fancy packaging a lot of device developers have been scrabbling to match that “Out of Box” experience, the joy of opening the packaging and having your device presented to you in soft black foam padding. The first major gripe was struck at this early stage, while unpacking the device and it’s related accessories I noted that my white phone has some very nasty black accessories. While the contrast of black and white may work well in some peoples minds, I’d personally like the accessories to be a matching colour.

The box included the standard extras, a quick start guide, a small manual, USB cable, charger and a wired headset. Nothing really to write home about. The manual is the usual introduction spiel, which I refuse to read. I decided to get the phone up and working and to have a play around.

What surprised me next is my first battle with the phone, trying to get the SIM card in the actual device. Turns out you have to use the little pull tab at the top of the phone to remove the back, of course the device or documentation didn’t have any mention of how to do this. Jo can vouch that I spent a frustrated five minutes trying to tear the back off without destroying the phone. A simple plastic pull tab would of sorted this, but I guess it’s the last thing on the manufactures’ mind.

Next came the activation, I thought being a non-tied phone that I wouldn’t have to jump through so many hoops like the iPhone, while this is true the actual procedure can be a little frustrating. Anyone who has visited my house can attest to the near Faraday Cage properties that it has for some networks, unfortunately T-Mobile is one of them, the signal levels in the local area are great, just not in my house. This presented a major issue when I was asked to login to my Google account to sync over various details, the phone then spent the next ten minutes trying to establish a GPRS connection to the outside world. After the tenth or so try it managed to get all the details it needs. I understand that the activation sequence can also do WiFi connection but I didn’t see any mention of this during the set-up, and I think it’s reserved for the people who have “rooted” their phones already, something I’ll want to avoid wherever possible.

So after much hissing, cursing, and a few cups of tea, I was ready to roll.

Applications

Almost everything on Android is wrote in Java, and I’m quite amazed that it runs as well as it does. While Google/OHA are still polishing the edges the OS seems very stable and easy to use, once you’ve worked out the basics of navigating around you’ll be flying through the applications in no time. The standard “tool set” included with Android will cover the 90% of users, the usual host of tools are included; SMS, Email, Web Browser, Call Manager, along with a few others you might not usually see, like IM.

As this is the “Google Phone” the standard software includes the usual Google mobile applications, Gmail, Maps, and Youtube. I’ve recently moved away from using Gmail, so I can’t really comment on how the application works, and the rest of them operate just as you would expect on the N95 or any other Series 60 handset. I’m not going to spend all day digging into specifics as anyone who has had a go of these apps will know what to expect.

The biggest seller is the Market, the Android team broke away from the strict market that you see on the iPhone and went with a more open process.This has allowed developers to create a wide range of apps in a very short period of time, including replacement applications for the built in-clients. One great example is K9Mail, which expands on the existing Email client to enable better interaction with IMAP servers and a few added features. I’m sure over time the market will grow, and with the introduction of the paid market we’ll see some of the big players start developing apps for it.

Overview

Ok, I’ve warbled on for a while about my usage of the phone, it’s still early days and I’m still not 100% up to speed with the handset. It’ll take time and I’m sure i’ll have more posts in the future. I’m starting to get my feet wet in the SDK and I’ve got my first “Hello World” application currently installed on my handset. So, Would I recommend the handset to anyone else? A resounding yes, it’s got alot of potential and anyone slightly technically inclined will love using it.

Written by Andrew Williams

February 24th, 2009 at 11:10 pm

Posted in Projects

Tagged with , , , ,

Manchester Open Street Map Party

with one comment

This weekend (25th to 26th of October) CloudMade will be hosting a Open Street Map mapping party in Manchester at the Marbella Cafe. The weekend will consist of walking the streets on the east side of Manchester, friendly banter and a few pints. Everyone is welcome from hardcore experts to the complete newbies.

The day starts at 10:00am with a introduction and a simple overview of how to map your data, then we’ll head out and meet back at the Marbella Cafe for lunch, then head out again for the afternoon and concluding in drinks in a local watering hole.

Check out the wiki and Upcoming for more details. Hope to see you all there!

Marbella Café
2nd Floor
Sunshine Studios
52-54 Newton St
Manchester
M1 1ED

Written by Andrew Williams

October 23rd, 2008 at 11:16 am

Posted in Projects

Tagged with , ,

“The Hub” – A Manifesto

with one comment

It’s come to my attention recently that some people don’t understand what “The Hub” project is all about. So let me explain the details of the project.

“The Hub” was originally an idea born out of a talk given at Open Source City. James Wallbank from Access Space gave an insightful talk on the community benefits of a open computer cluster, along with their computer recycling scheme they are able to poliferate computer usage around the local community. As you would expect, with a increase in computer usage and access to a common area a community grew and evolved in the project.

After Open Source City, discussions between the members of The Art Organisation about a similar project being setup in the half empty building they have, Mello Mello. A few interested parties were approached and Vladimir from Liverpool LUG was one of these few. Discussions happened and plans made, but no decisive action was took.

Fast forward a few months, Liverpool LUG was holding its first couple of talks since it’s “rebirth”, stuck for a backup location for when FACT was unavailable the admin team approached The Art Organisation for space in Mello Mello. Greg, who is co-curator of The Art Organisation, talked about the community space project that started months before, and a few members of LivLUGs admin team (myself, Joanne, Graeme and Dan) offered to help out.

The overall plan is to setup four or five PCs in the space, with a common printer, internet connectivity, and a file server. In one of the storage areas we will keep old computer parts in a recycling capacity, but this will not happen until we’ve got the main hub in order. All the PCs will be networked and will be able to share out their media, along with the likes of a “pool” instant messaging system to allow quick transfers between individuals working on the PCs. Exact plans for software and incident tracking haven’t been worked out yet, we think that should be saved to when we have actual hardware on site. The only thing we know at the moment is that all the software will be Open Source.

At the moment we have the space and a load of old computing kit that has been scavenged from somewhere. The area has a lot of “junk”, well, I say “junk” but the items actually belong to a artist who was using the space as storage. We’ve organised the items as much as possible and are trying to organise PCs and desks for the area.

We need help, If you know somewhere we can get some old PCs, some desks, or other useful computing equipment, drop us a line. We’ll be approaching the FreeCycle lists sometime this week so keep your eyes out if your on there.

Written by Andrew Williams

October 8th, 2008 at 1:21 pm

“The Hub” – Day 1

without comments

So, our first day of work inside “The Hub” has gone smoothly; We’ve managed to organise several boxes of computer equipment down to the essentials. The room was full of “junk”, I say that loosely as alot of the items there belonged to the artists so I was unsure of what it would be used for. Greg mentioned that the room would be cleared on Monday so I hope on our return visit it should be easier to move around.

We noticed that the room is wired up for CAT5, this is a massive timesaver as the least enjoyable part of the job would be wiring network cable up. Cream, the previous owners, must of had a fully wired network in the building at some point, so all we need to do is find where the cables drop out at.

We’ll be returning on Wednesday to do some further cleaning and organisation, hopefully we will be able to locate the missing drop point for those network cables. If anyone is interested in doing some heavy lifting and tidying your more than welcome to come along and help out!

Written by Andrew Williams

September 30th, 2008 at 9:46 am

Posted in Projects

Tagged with , ,

The Mello Mello Project

with one comment

As part of our location scouting for Liverpool LUG, Jo made a visit to Mello Mello to ask them if we could use some space in their building for hosting the LUG. The result was quite interesting.

Greg from The Art Organisation (current managers of Mello Mello) has asked if we can setup a open source computer cluster that will hopefully be open to the public and artists alike. We jumped at the chance and we’re going to be visiting tomorrow morning to do some initial scouting and investigation. One of the key requirements that Greg had was to make this completely open source and free as in beer, The TAO have little to no money.

I’ll be able to post a few more details and some photos after tomorrow’s visit.

Written by Andrew Williams

September 26th, 2008 at 11:40 pm

SQL Server Last Full Week

with 2 comments

While writing a new report today I’ve been drove mad while creating a dynamic query that selects the last full week. So here is the code for SQL Server, to save anyone else the pain:

dateadd(dd,0, datediff(dd,0,
   dateadd(day,-1*datepart(weekday,getdate())+1,dateadd(week,-1,getdate()))
))
dateadd(dd,0, datediff(dd,0,
   dateadd(day,7,dateadd(day,-1*datepart(weekday,getdate()),dateadd(week,-1,getdate())))
))

Written by Andrew Williams

September 17th, 2008 at 2:12 pm

Posted in Projects

Tagged with , , , ,

Xen Stupidity

without comments

Last night I spent a few hours getting Liverpool LUG’s website on its own Xen VM, so hopefully we can provide some services to members, like webhosting and email aliases. This was my first venture into creating a Xen VM for myself, previously Chris has spent the time to set it up for me.

I’ll name this little adventure: Trip on the Fail Boat

Ok, so I was a little stupid. I didn’t read any existing documentation and bungled through it based on a few commands in the bash_history file. I know, stupid. For a while I hissed and cursed about incomplete setup which I thought debbootstrap would do, reading the documentation this morning has highlited how much of a monumental idiot I actually was. So now i’ll go through my idiotic bitching and explain why I was wrong…

1. 4Gb Fixup error messages
When I started up the VM I was assaulted by thousands of messages regarding a “4Gb memory fixup” or something to that nature. Of course, I was too busy trying to edit files in vi to actually look at the issue but was more than happy to shout and scream at my console formatting getting mixed up.

The fix? Install libc6-xen, or move /lib/tls to /lib/tls.disabled

2. Missing network config
The VM couldn’t see eth0, or lo for that matter. After hammering my head against the table checking the Xen config files I finally realised that updating /etc/network/inferfaces could help.

3. “Why is the hostname dom0?”
Stupidity ensues, thankfully I noticed before I issued the shutdown on dom0.

4. Services randomly failing to start up
Missing loopback network device, no actual 127.0.0.1. You would be suprised how much this can effect your system.

So for now, The VM is working. I’ll get round to posting some more details about LivLUG services soon, but for now i’m going to get some coffee…

Written by Andrew Williams

August 18th, 2008 at 2:38 pm

Posted in Projects

Tagged with , , ,

Howto: Debian Lenny & Huawei E160G

with 18 comments

So, in my last post I described how it was using the E160G with Debian. All in all it’s very good and i’ve not experienced any major issues, bar a few minor apt-get and NetworkManager issues. So, heres a quick rundown of how to get it on your machine.

So first, you need to get the hardware to work correctly under Debian. Plug in your E160G and check dmesg to see if the device recognises correctly. If you see ttyUSB0/ttyUSB1 appear you can skip this step.

First, you need to download USB_Modeswitch:

# wget http://www.draisberghof.de/usb_modeswitch/usb_modeswitch-0.9.4.tar.bz2
# tar jxvf usb_modeswitch-0.9.4.tar.bz2
# cd usb_modeswitch-0.9.4/
# ./compile.sh

Now you have the usb_modeswitch program, as this will be executed by udev it needs to be in a sensible location, personally i’d copy it to /usr/local/sbin/

# cp usb_modeswitch /usr/local/sbin/

Also, you need to grab the latest config file from the usb_modeswitch website and put it into /etc

# wget http://www.draisberghof.de/usb_modeswitch/usb_modeswitch.conf
# sudo mv usb_modeswitch.conf /etc/

Now, by default the config file comes with the section commented out, so edit the file and uncomment the section for the E220 (which is essentially the same device).

# sudo $EDITOR /etc/usb_modeswitch.conf

One last step, you need to add a small configuration file to udev to detect the E160G and run usb_modeswitch, put this file in you /etc/udev/rules.d/ folder:

SUBSYSTEM=="usb", SYSFS{idProduct}=="1003", SYSFS{idVendor}=="12d1",
  RUN+="/usr/local/sbin/usb_modeswitch"

Restart udev, and plug in your E160G…

sudo /etc/init.d/udev restart

and you should see something similar to:

[   16.085904] usb 5-3: GSM modem (1-port) converter now attached to ttyUSB0
[   16.086033] usb 5-3: GSM modem (1-port) converter now attached to ttyUSB1

So, the device is detected and you have your USB ports, first a quick overview. The E160G shows two serial ports, one is a data port, the other is for control signals. NetworkManager only makes use of one of these ports but the Vodafone Connection Manager uses both. Now you have a choice, install Network Manager 0.7 to gain native GPRS/UMTS data support or use another package. I went for Network Manager, while it’s still in beta and i’ve had a few run-ins in the past with it I decided to give it a go.

So, it was a simple case of adding the 0.7 repositories to /etc/apt/sources.list, updating, then installing the needed packages.

# echo "deb http://debs.michaelbiebl.de/ unstable main" >> /etc/apt/sources.list
# apt-get update
# apt-get -t unstable install network-manager

You might need to remove any old Network Manager packages before you do this, as network-manager-openvpn collides with the new package.

Hopefully thats give you the overview you needed, and you should be up and running!

Written by Andrew Williams

August 7th, 2008 at 11:08 pm