Dec 29 2008

Installing the Flash plug-in on Ubuntu from behind a proxy

There is a package for the Adobe Flash Player plug-in for Mozilla-based browsers in the Ubuntu repositories.  If you install the package it downloads the plug-in directly from Adobe and installs it on your system.  I tried to do this on a machine behind a proxy that requires authentication and it failed, despite having set up the proxy details in Synaptic, as well as in an http_proxy environment variable for both my user account and the root account in the respective .bashrc files.

There’s probably an easier way to do this, but to get around the problem I manually edited the flashplugin-nonfree.postinst file in /var/lib/dpkg/info following the failed installation attempt.  This file is a shell script, part of which sets up a wgetrc file for use by wget when downloading the plugin from the Adobe website.  As root, add a section for your http proxy in here, something like as follows:

# setting wget options
:> wgetrc
echo "noclobber = off" >> wgetrc
echo "dir_prefix = ." >> wgetrc
echo "dirstruct = off" >> wgetrc
echo "verbose = on" >> wgetrc
echo "progress = dot:default" >> wgetrc
echo "http_proxy=http://user:passwd@proxy.tld:port" >> wgetrc

Then in Synaptic you can mark the flashplugin-nonfree package for reinstallation and it should download and install without further problems.

You may be able to download the package (apt-get -d?), unpack it manually, edit the postinst file, then install to avoid having to sit through a failed attempt at installing first – I haven’t tried this myself. UPDATE – I have now – see Hacking .deb files.

Nov 19 2008

Wordpress

Hello and welcome to my new Wordpress-powered site!

Rather than move my venerable Blosxom site here I am starting again with Wordpress.  Don’t get me wrong, I think Blosxom’s a fantastic tool and using it to run my site was both great fun and a valuable learning experience, but I really need something a bit more sophisticated now that doesn’t require quite the level of tinkering and hacking that Blosxom did.

My plan is to move all the old content into the new Wordpress installation, hopefully preserving the URL structure either directly or by using some mod_rewrite hackery.  I’m not sure when I’ll get the time to do this so in the meantime if anyone wants any of the old content (e.g. any of the Blosxom plugins I wrote or modified) please drop me a line at sam at sgp.me.uk and I’ll send you copies.

To be honest I’m not sure whether I’ll get back into blogging, but as this site has been up for six years I can’t imagine abandoning it completely.  I often think that I should write more and that I should get over some of the inhibitions I have about blogging longer and more thoughtful stuff, but a big reason at the moment is lack of time – a full-time job that’s not particularly amenable to personal blogging plus two small children keep my life pretty full!

Jul 06 2008

Back-door European three-strikes rule

As reported elsewhere (Open Rights Group, Boing Boing), there is a set of back-door amendements to a European Telecoms law that will potentially introduce invasive monitoring of internet usage and the removal of internet access following three unsubstantiated accusations of illegal filesharing. These amendments have not been properly discussed or debated given their wide-ranging impact on civil liberties and net neutrality.

I wrote to my MEP via the excellent WriteToThem.com. The vote is tomorrow, so there’s not much time. That’s the problem with back-door deals like this, they tend to avoid democratic scrutiny.

Dear Neil Parish, Glyn Ford, Graham Booth, Graham Watson, Roger Knapman
and Caroline Jackson,

I understand that this coming week (7th July) the European Parliament
will be debating changes to the law governing telecommunications in the
EU, the “Telecoms Package”. It has come to my attention that elements
of these reforms include provisions relating to the “protection” of
intellectual property rights which include opening the door to
collaboration between ISPs and third party media content producers in
monitoring internet usage to detect illegal filesharing. This
monitoring would of course include all legal and normal usage of the
internet.

The provisions would also appear to open the door to the kind of
“3-strikes” policy that I understand MEPs have already indicated they
do not favour in that the removal of internet access is felt to be
disproportional (I believe this was indicated in an amendment passed on
the so-called Bono Report on the Cultural Industries, not legally
binding but certainly an indication of feeling and intent.)

These proposals will have an impact on internet access that far exceeds
their supposed aim, and have clear implications for civil liberties and
net neutrality if all usage is to be monitored. For example, the
proposals would also seem to include the legal right for ISPs to
prevent users of their networks from using software and systems that
are perfectly legal, which clearly impacts on free access to online
resources for essentially arbitrary reasons.

There is also the question of how these systems would be policed
themselves and how much democratic oversight there would be of them.
From my (admittedly not too detailed) reading, this is far from
satisfactorily answered. Would users have any recourse against threats
and intimidation from ISPs and/or media producers if they were being
unfairly treated or had internet access curtailed or limited?

Now I understand that some member states are debating similar measures,
but these are being examined in a way that allows more scrutiny and
democratic control. I do not sanction the illegal downloading of
copyright material but I think that if we are to have laws like this
they need to be framed properly following proper debate at the national
level and not brought in by the back door like this, given their wide
ranging potential impact on internet usage.

Please can I ask you to do all you can to prevent Compromise Amendments
2,3,4,5 and 7 from being voted through on the IMCO committee. I do not
believe that the rejection of these amendments will impact the adoption
of the bulk of the “Telecoms Package”.

Thanks for taking the time to read this. I understand that there is
very little time to act but I feel strongly in favour of net neutrality
and civil liberties generally and so had to voice my concern. Perhaps
if these measures were not being introduced in this way there would
have been more time to properly debate this.

Yours sincerely,

Sam Pearson

Aug 17 2007

Dual boot Windows XP and CentOS 5 with NTLDR

I wanted to install CentOS onto a spare partition on a machine with Windows XP already installed, leaving the MBR as it was and using the NTLDR bootloader. CentOS installed fine onto the partition but the installer only seemed to offer two options for setting up GRUB: installing to the MBR or not installing at all; there wasn’t an obvious way of getting it to install onto the boot sector of the CentOS partition. There might have been some more advanced options in the installer but I didn’t have the time to experiment (I’m fairly new to CentOS/Red Hat/Fedora, being more of a Slackware and Debian-family user normally), so I elected to not install and set up afterwards. This leaves CentOS unbootable, but with a bootdisk like sysresccd and a basic knowledge of GRUB it’s fairly straitforward to fix this. Here’s a rundown on what I did, which might be useful in a similar situation or when having trouble with a b0rked GRUB installation.

Obviously the partition details specified below are derived from the system I was working on, where the hard disk is/dev/sda, Windows is on /dev/sda1 and CentOS on /dev/sda2. There is a swap partition on /dev/sda3 but it isn’t relevant for this exercise.

Also, you follow these instructions at your peril. It is all too easy to screw up and make your entire system unbootable, lose data or just render the whole process more painful than it has to be. Back-up, read relevent documentation before you begin, back-up, check the sytax of the commands you type before executing them and have I said back-up?

  1. First, if you are not familiar with GRUB browse the documentation. The steps below are fairly terse and not pitched at total beginners. They also assume a familiarity with basic shell commands.
  2. Once the CentOS install is complete reboot using sysresccd.
  3. Create a mount point for CentOS’s root partition, e.g. /boot/centos, and mount it:

    # mkdir /boot/centos
    # mount -t ext3 /dev/sda2 /mnt/centos
  4. Mount your Windows partition (/mnt/windows is usually present):

    # ntfs-3g /dev/sda1 /mnt/windows
  5. Copy the following files:

    # cp /mnt/centos/usr/share/grub/i386-redhat/stage1 /mnt/centos/boot/grub
    # cp /mnt/centos/usr/share/grub/i386-redhat/stage2 /mnt/centos/boot/grub
    # cp /mnt/centos/usr/share/grub/i386-redhat/*_stage1_5 /mnt/centos/boot/grub
  6. Launch GRUB. Fortunately sysresccd and CentOS 5 both use GNU GRUB 0.97, so there are no compatibility problems.

    # grub
  7. This will dump you into GRUB’s command interpreter. You need to set the root drive and then install GRUB into the partition’s boot sector as follows; output from the commands represented by elipses but note that you might get warning messages – as long as the final message indicates success, you should be fine. Oh, and be careful to ensure you install this onto the correct partition – remember GRUB starts counting partitions at 0, not 1 like Linux!

    grub> root (hd0,1)
    ...
    grub> setup (hd0,1)
    ...
    grub> quit
  8. Next you need to create the file that NTLDR will use to hand-off booting CentOS to GRUB, basically the first 512 bytes of the partition:

    dd if=/dev/sda2 of=/mnt/windows/bootsect.lnx bs=512 count=1
  9. Next modify /mnt/windows/boot.ini to include a line for CentOS at the end. The cautious may wish to reboot into Windows to modify this file.

    C:\bootsect.lnx="CentOS 5"
  10. Reboot. You should now see a boot menu offering you Windows and CentOS 5. If you don’t, check C:\boot.ini for a timeout stanza and edit accordingly. Selecting CentOS 5 will dump you back into GRUB’s shell – GRUB is installed but doesn’t have a configuration file set up. You can use the following commands to boot CentOS 5:

    grub> root (hd0,1)
    grub> kernel /boot/vmlinuz-2.6.18-8.el5 ro root=/dev/sda2 rhgb quiet
    grub> initrd /boot/initrd-2.6.18-8.el5.img
    grub> boot
  11. CentOS 5 will then boot and you can complete the installation. Depending upon your choices, you may need to reboot again using the above procedure.
  12. Once complete you can configure GRUB to boot automatically by creating /boot/grub/device.map, /boot/grub/grub.conf and /boot/grub/menu.lst. The device.map file should just contain a single line mapping the linux hard disk device to a GRUB device notation:

    (hd0)   /dev/sda

    The grub.conf file specifies the various boot options, in our case a fairly straitforward single kernel and ramdisk image:

    default=0
    timeout=5
    hiddenmenu
    title   CentOS (2.6.18-8.el5)
            root (hd0,1)
            kernel /boot/vmlinuz-2.16.18-8.el5 ro root=/dev/sda2 rhgb quiet
            initrd /boot/initrd-2.6.18-8.el5.img

    Then, with /boot/grub as your working directory, do:

    ln -s grub.conf menu.lst
  13. Now when you reboot and select CentOS from the Windows boot menu GRUB should automatically start CentOS after a five second timeout. You can add additional entries to the grub.conf file – custom or testing kernels, memtest86+, etc – then view the menu within the timeout period to select them.

I’m more than happy to get feedback on stuff like this, even if it’s just to tell me I’m an idiot and could’ve done it in a simpler way. There’s no commenting system here at the moment, but please feel free to email me with questions or suggestions, or even if you just found this useful.

Aug 12 2007

Balloons and Blackberries

Bristol’s annual Balloon Fiesta has just wound up (I’ve written about this before, and taken photos too). We’ve had some good weather recently and Perrett’s Park, which overlooks much of Bristol, has been busy in the evenings with people watching the launches taking place over at Ashton Court.

Two out of three evenings the wind favoured us and the balloons passed by low overhead, much to the delight of all the children present. I didn’t take so many pictures this year, but you get the general idea from this – balloons at dusk. They do early morning launches as well, but as I was on earlies this week I missed them.

As I mention above, the kids love the balloons. Our eldest has also just discovered another summer delight – wild blackberries. We’re fortunate enough to have a lot of green space around us even though we live in the city and at the overgrown local cemetery, the city farm and around the nearby allotments the brambles are heavy with blackberries at the moment which the kid would eat until she was sick if we let her.

We went over to Arnos Vale before lunch and let Uma run around while we picked a bag or two to bring home. It’s great to be able to do this in the city; both Polly and I grew up in the countryside and we occasionally worry that our kids might miss out on things like this. We eventually tore Uma away from the free food and took our pickings home.

We’re not sure what we’ll do with them yet. Crumbles, jams or just as they come. Yum!

Aug 09 2007

Weblog reboot

It’s remotely possible that last night someone might have dropped by this site to be greeted by an HTTP 500 or pulled a feed with some rather old content, as I finally got around to re-posting the content from between November 2002 and March 2005. I’d hoped to recategorise everything into the simpler structure I created following the domain move and rebuild, but that’s just not going to happen so I have dumped the entire structure of the old site under weblog/original. There’s an archive page; I intend to merge this with the current site’s archive, so bear that in mind. I might also whip up a sitemap type page where you can browse by topic/directory.

It wasn’t too difficult a task, but it did involve a but of fiddling and some quick fixes once the content and metadata files were in place as I overlooked the fact that I switched file extensions when redesigning the site and this initially caused me a bit of headscratching. Thanks to sed, find, xargs and rename I soon got this sorted out. If you ever need to change multiple file extensions in a directory hierarchy on a linux box (in this case .txt to .blx) try this for size:

find ./path/ -iregex ".+\.txt$" -print0 | xargs -0 rename "s/\.txt$/\.blx/"

or maybe:

find ./path/ -iregex ".+\.txt$" -exec rename "s/\.txt$/\.blx/" '{}' \;

But you’ll find the first command works faster, particularly if you do a test run with the -n switch on rename.

Unfortunately a lot of the markup in the older posts is HTML rather than XHTML, so you might get XML parser errors on same pages if you’re using a browser that can handle application/xhtml (Firefox, Opera). I’m slowly working my way through the site trying to fix these problems but it might take me a while, so please bear with me – a lot of the older posts were handcoded using a variety of text editors on various platforms and often in a hurry and markup wasn’t always my primary consideration. Also, I’ve yet to get the final batch of redirects from the old URL sorted so there might be the odd dead link or missing image, but that should be sorted faster than the parser errors.

Aug 08 2007

Busy Weekends and other things

Hey, over a week since I last posted. That’s better than eight months. You’d think that I’d get more of a chance to do things like this at weekends given the fact I don’t blog from work, but it just doesn’t work like that when you’ve got kids. If anything, my weekends are busier and more manic than my workdays and I’m often more tired than on a weekday by the time they’re tucked up in bed. Besides, we often have friends or family over at weekends, which usually means the evening are full too.

Not that I’m complaining about any of this, merely pointing out why no more likely to post at weekends than I am during the week. I reckon the most opportune times for recreational blogging for someone with a none-blog-friendly full time job and two small children are weekday evenings and the occasional moment like now when I’m home from work early and Polly’s out with the kids.

In addition to all of this, the weather has finally improved and we’ve been spending our evenings sitting in the shade on our balcony looking out over Bristol. We’ve got a fantastic view, and I think you’ll agree that sitting outside sipping a drink and watching the sun set is hard to improve upon.

There’s a couple more like this on Flickr (1, 2, 3), plus a whole lot more.

Jul 31 2007

BBC iPlayer

The BBC are testing a new service whereby it’ll be possible to download TV content from the previous seven days over the internet. This is a great idea. Unfortunately they are currently committed to using a broken, DRM-based system that only works on Windows XP. There are a whole host of reasons why this is a bad idea (some of which are outlined and linked to from this brief report at the Open Rights Group site). The main reason I object is the fact that it locks out license payers who do not use or have access to this particular expensive and proprietary operating system, or choose not to use it for security, ideological or other reasons.

So, if you are a British citizen and BBC license fee payer, please consider signing the iPlayer petition at petitions.pm.gov.uk.

Jul 30 2007

pipes.yahoo.com

Now this looks pretty cool, although I haven’t got a proper handle on it yet. It’s totally passed me by until today – I don’t remember even noticing it mentioned anywhere, which surprises me as it’s the sort of site I’d expect to have picked up on, but then I suppose there are a lot of new sites and neat ideas out there.

I may not have much time to mess around with it properly but it might at the very least scratch my personal itch of creating a unified feed containing my own disparate feeds (this blog, flickr, del.icio.us, etc). I was comtemplating coding something up myself to do just that only earlier today but wasn’t sure when I’d get the time – this might save me the bother. More anon.

Jul 27 2007

Sustainable Blogging

I’ve been itching to start blogging again for months and I’m glad that I have even if I have no readers right now. Previously I ground to a halt not only because I had far less time to do it, but because I had slowly started making posting into a big deal and would spend hours tweaking drafts and then not posting stuff because it had come to seem trivial. I never had a massive readership and that’s never really bothered me – I wouldn’t keep coming back to it if it did – so it always frustrated me that I let this happen.

Then I read something today which solidified my feelings on this, funnily enough on the blog of a chap who had also recently taken up blogging again after a hiatus. His name’s Russell Beattie, he’s got a lot of interesting stuff to say and his last blog was quite widely read in some parts of the tech blogosphere, but on blogging he had this to say earlier this month:

One of the pieces of advice that I give to new bloggers regularly is post, post, post. Get a routine and stick with it, because if you don’t, you’ll start to build up what a blog is in your mind, and eventually you’ll just stop posting because it seems like this massive hurdle to overcome. My advice is always the same, post when you think about posting, and if you’ve got nothing to say, just say that just to keep in the rhythm. Most people don’t bother listening to me, but that’s okay, it works for me.

I read that and it clicked. He’s right, and this is what happened to me, hence this evening’s two posts. Both stuff I’d been turning over in my mind and thinking of writing about while also wondering whether it was worth it. Of course it’s worth it – I enjoyed banging these posts out and it’s left me feeling satisfied; so thanks, Russ, for helping crystalise my own thoughts on the matter and giving me a prod in the right direction. Maybe I’ll even take your advice and keep it up over the coming days and weeks.

WordPress Themes