tensixtyone

Rants of Andrew Williams / Nik_Doof

Archive for the ‘General’ Category

Winter Trees

without comments

Yet more snow pictures. Again took last Monday.

Posted via email from tensixtyone shorts

Written by Andrew Williams

January 13th, 2010 at 11:57 pm

Posted in General

Unneeded Dependencies

without comments

$ sudo apt-get install bzr
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  bzrtools defoma file fontconfig fontconfig-config graphviz libcairo2 libdatrie0
  libdirectfb-1.0-0 libfontconfig1 libfontenc1 libgraphviz4 libice6 libpango1.0-0
  libpango1.0-common libpixman-1-0 libsm6 libsysfs2 libthai-data libthai0
  libts-0.0-0 libxaw7 libxcb-render-util0 libxcb-render0 libxext6 libxfont1
  libxft2 libxmu6 libxpm4 libxrender1 libxt6 python-paramiko ttf-dejavu
  ttf-dejavu-core ttf-dejavu-extra ttf-liberation x-ttcidfont-conf x11-common
  xfonts-encodings xfonts-utils
Suggested packages:
  bzr-gtk bzr-svn python-pycurl xdg-utils pybaz librsvg2-bin defoma-doc dfontmgr
  psfontmgr gsfonts graphviz-doc ttf-kochi-gothic ttf-kochi-mincho ttf-thryomanes
  ttf-baekmuk ttf-arphic-gbsn00lp ttf-arphic-bsmi00lp ttf-arphic-gkai00mp
  ttf-arphic-bkai00mp
Recommended packages:
  libft-perl
The following NEW packages will be installed
  bzr bzrtools defoma file fontconfig fontconfig-config graphviz libcairo2
  libdatrie0 libdirectfb-1.0-0 libfontconfig1 libfontenc1 libgraphviz4 libice6
  libpango1.0-0 libpango1.0-common libpixman-1-0 libsm6 libsysfs2 libthai-data
  libthai0 libts-0.0-0 libxaw7 libxcb-render-util0 libxcb-render0 libxext6 libxfont1
  libxft2 libxmu6 libxpm4 libxrender1 libxt6 python-paramiko ttf-dejavu
  ttf-dejavu-core ttf-dejavu-extra ttf-liberation x-ttcidfont-conf x11-common
  xfonts-encodings xfonts-utils
0 upgraded, 41 newly installed, 0 to remove and 7 not upgraded.
Need to get 16.1MB of archives.
After this operation, 38.9MB of additional disk space will be used.
Do you want to continue [Y/n]?

That is why it pays to have the following settings in your apt preferences if you want to keep things to a minimum:

APT::Install-Recommends "false";
APT::Install-Suggests "false";

Written by Andrew Williams

November 18th, 2009 at 10:43 am

Posted in General, Soapbox

Tagged with , , , , , ,

Upgrade Pains

with 2 comments

Yesterday I learned a lesson the hard way. I upgraded a “production” system (My home MythTV box) to the latest testing version of Debian and suffered numerous small failures. The knock on effects ment the MythTV system was unavailable for recording for about five hours, much to the fustration of the other half.

The idea came to me at first when I spotted that MythTV 0.22 has been released and maybe it was time to upgrade to get up to speed, of course I didn’t read through the new features list or check out what was happening in the world of MythTV. As it turns out, nothing changed that affected me or improved the situation . I did a senseless upgrade when I didn’t need to.

So, from now on i’ll follow a simple checklist:

  1. Do you need to upgrade? Will it fix a bug or a ongoing issue?
  2. Do you REALLY need to upgrade? Will the upgrade fix a world shattering issue?
  3. No, DO YOU REALLY NEED TO UPGRADE?

Production systems usually run old software for a reason, I learned that today.

Written by Andrew Williams

November 17th, 2009 at 4:01 pm

Posted in General, Soapbox

Tagged with , , ,

Not allowed to disconnect from Virgin Media?

with one comment

I’m really unhappy with Virgin Media, the most I’ve ever been.

Virgin have provided a bad service for the last few months, their traffic management is just a insult on top of the bad service. A few weeks ago I got Be installed and I finally started the long process of disconnecting from Virgin, or so I thought.

Turns out you can’t disconnect from Virgin if you have a outstanding balance, You have to pay 100% up front or they wont do anything, instead leaving your line connected racking up more service fees and late payment fees.

Very nice.

My Virgin bill is around £90, an amount I can’t just drop at a seconds notice. I thought that I’d be able to give 30 days notice then pay off the balance once I get my final bill in August.

Silly me.

*Edit*

Virgin Media has now decided to accept my disconnection on the basis of this blog post. Thank you, thats all I was asking for!

Written by Andrew Williams

July 20th, 2009 at 11:35 am

Hacking the ZTE MF627

with 23 comments

ZTE MF627 3G DongleIts been a while since I’ve done a good hack article. so again I’m back onto my favourite topic of 3G modems. Thanks to the generous promotions at 3dongles4free I’ve been able to pickup a new Three dongle for next to nothing. As I’ve already got my E160G I didn’t really need this to be on the Three network.

After a quick search around and a few suggestions from existing mailing lists I’ve found out that a hacked firmware exists and these cheap and cheerful dongles can be flashed to allow any SIM card to be used. This should be a simple job of updating the software and using the new SIM card.

First of all, grab the software pack from Rapidshare, due to the questionable nature of this copy of the firmware no one has been willing to host it on their own hosting, and I’ll keep to that idea. Extract the files from the RAR and you should have a firmware upgrade, and a installation folder for the connection software. As the existing Three connection software is very limited, the software package includes the Telstra version which allows you to define your own settings.

Before you attempt the software upgrade, you need to remove any existing Three software, install the Telstra version and remove your SIM card from the dongle, then simply plug it in and run the firmware upgrade. This process will take around 15-25 minutes and once it’s done it’ll give you a prompt. During the upgrade do not power off your PC or remove the dongle from the USB socket. This will brick your dongle rendering it completely useless.

Now, put in your non-Three SIM card and plug it back into your PC, the Telstra software should start-up and try detect the device, you need to configure the software for your provider’s APN settings, but the PDF document included with the software package will give you all the details you need.

Remember, I take no responsibility for people bricking their equipment, you have been warned.

Written by Andrew Williams

June 10th, 2009 at 10:31 pm

Posted in General, Technology

Tagged with , , , , ,

LUGRadio Live 2009

without comments

Jono Bacon has announcedthat LUGRadio Live 2009 is happening and the basic website is now up and available. So for all that have not heard about LUGRadio Live before, let me give you a brief overview.

LUGRadio Live was a spin-off of the successful LUGRadio podcast, the guys decided that there was no decent open source conferences in the UK so decided to setup their own. The conference is in its fourth year, even though the podcast has finished. LUGRadio Live is described as a “rock conference”, everything is light-hearted and easy going but it attracts some big speakers right across the open source community.

If it sounds interesting, checkout the website, register your interest on Upcoming or Facebook, and follow the Twitter or Identi.ca users.

Written by Andrew Williams

May 11th, 2009 at 12:30 pm

Posted in General

Tagged with , , ,

Woes of Webmin

with 7 comments

My name is Andrew Williams, and I used to be a Webmin user.

During the last year or so, I’ve used Webmin and Virtualmin to manage my VPS hosting. For those who don’t know, Webmin is a web based server management console built on Perl, it allows each service to be managed by the use of modules, which you can install/uninstall to create a customised interface for your machine. With the addition of Virtualmin, the Webmin interface becomes a virtual hosting console much the same as Plesk or CPanel.

Webmin has a murky past, several high profile exploits existed for the system and it’s been advised for the last 10 years or so not to install it unless you really need to. Giving world access to Webmin was generally advised as stupid and silly. While Webmin is now up to date with it’s security it still leaves a bitter taste in the mouth of the administrator world and people who use it are usually noted as “newbies”.

I originally went with Webmin/Virtualmin as I was still hosting the few remaining customers of Blueshift Media. While I have the technical skills to work without it, the customers didn’t. The system gave a simple interface for the users and allowed them to add in basic stuff like new email addresses and aliases. To work around the security issue I only allowed access via SSH and port tunnelling, that way the user would have to be authenticated with the server before accessing the system. 

Over the next year or two I started using Webmin to do my daily administration tasks, as working outside of Webmin once it’s installed can open you to a world of pain, Webmin keeps track of some configuration in it’s internal database, not in the external configuration files. Over time I become comfortable with the system and my technical skills slowly slip away from me, why do I need to know the in and outs of a program if Webmin can do it all for me?

Today, I learnt the hard way. I had a issue with Postfix content filters and I spent 10 minutes faffing in the Webmin console only for it to be a five second fix in the main.cf file. In a further similar fault I had to read up on Postfix Virtual file format as I’ve totally forgot how it’s supposed to be formatted, somehow the file had got munged and I had to reconstruct what I could.

Then it clicked.

Since I’ve installed Webmin I have been wrapped up in cotton wool, not actually touching the underlying the system and just using this fluffy interface to do my work. This is all well and good in the desktop world but in the server world your risking security and your knowledge of the underlying system.

So, today, I’ve officially removed Webmin, and I’ll never to return again. It’s time to actually learn my trade again and start using the distributions as they’re meant to be.

Written by Andrew Williams

April 21st, 2009 at 11:50 am

Posted in General, Soapbox

Tagged with , , ,

Importing History into Git

without comments

With my recent move over to Git for my VCS Home solution I decided to start afresh with new repositories and not migrating the history over, in the last few days i’ve noted that it was a very bad decision and having the full history will always be useful. Now i’m stuck in the situation of two repos with different histories. How do you reconcile these two trees into one full history tree?

First of all we need a working Git version of your existing repo, in my case, it’s in SVN, so I used the git-svn tool to import my svn repository.

$ cd ~/dev/
$ git svn clone http://tensixtyone.com/svn/home/trunk/bash

Git then downloads each SVN commit and imports it, this can be quite slow on large repositories but thankfully mine was only 20 or so commits. Now you have your originally repository in Git format the few final steps will bring in the changes you have done in the new repository.

To import the history we are going to generate a set of diffs, while this sounds less than ideal it is really the only clean way to get your new commits into your old repository, attempting to pull the commits in will throw errors as the commit hashes will not match.

First of all you need to find out the hash of your first commit in your new repository

$ cd ~/.dotfiles/bash
$ git log

...

commit ec508803a080f2146231fb4cd396cc18a2906a9b
Author: Andrew Williams
Date:   Sat Apr 11 02:32:07 2009 +0100

    Imported initial bash files

Then generate the diffs since that initial commit

$ git format-patch ec508803a080f2146231fb4cd396cc18a2906a9b..HEAD
0001-Added-bash_logout-file.patch
0002-Updated-bash-config-files.patch
0003-Updated-a-few-aliases.patch
0004-Updated-prompt-to-detect-if-we-re-using-vcsh.patch
0005-Fixed-nano-alias.patch

Now you have your fresh diffs, you need to import them into your existing repository. In addition i’m importing these into a new branch.

$ cd ~/dev/bash/
$ git branch new-bash
$ git am ~/*.patch

The am command is mostly used to apply patches from a mailbox but for this case we can just tell it to use the patch files instead. After the command has completed you should be able to check git log and be able to see all the new commits.

Once your happy with the patches, it’s a case of switching to master and merging the changes.

$ git checkout master
$ git merge new-bash

One thing to note, after this process the commits will have different hashes, so it wont be a simple case of pushing to your remote repo. I’d only recommend doing this if you have to, i’m sure that a better proceedure exists but this is what worked for me.

Written by Andrew Williams

April 15th, 2009 at 1:31 pm

Posted in General, Technology

Tagged with , ,

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 , , ,