10th October, 2014

Teaching an old dog to Fish

Filed under: General — andy47 @ 2:38 pm

Inspired by the recent furore around Shellshock I decided that it was time to try an alternative to bash. By the very grown up process of shutting my eyes and poking my finger at the results of a search for “shell” I ended up at fish shell, described by the project as “a command line shell for the 90s”. I’m presuming that this means the 1990s and is not a minimum age requirement.

I’m quite enjoying it so far but the missing piece for me was something equivalent to the very useful virtualenvwrapper. Luckily for me someone else has already had this problem and wrote virtual fish. For which many thanks. I did have a little trouble with installation and configuration. I’m sure that this was entirely my own fault but as a reminder for me and anyone else who stumbles on this here is what I did.

  1. Downloaded virtual.fish from the Github repo to ~/bin
  2. Because I don’t use ~/.virtualenvs to store my virtual environments I added set -x VIRTUALFISH_HOME ~/Work/envs/ to my .config/fish/fish.config file
  3. Included the currently active virtual environment name in my prompt by following the instructions. A trap for young players is to make sure that you do funcasve fish_prompt as instructed. I missed this out the first couple of times and kept wondering why my prompt was wrong.

Update: Thanks for the comments. bronsen – yes I do source virtual.fish in my config.fish. Or at least I did until jl pointed me at Pew. Now I’ve switched to that from virtualenvwrapper and virtual.fish and I must say that it works like a dream. Thanks both for taking the time to leave a comment.

28th March, 2014

My Career

Filed under: General — andy47 @ 11:14 am

The next time anyone asks me what I do for a living I’m just going to point them to this YouTube video.

Found on the twitters thanks to Nick Hodge and Jess Dodson.

12th December, 2013

Playing with Software

Filed under: General — andy47 @ 9:58 pm

I’ve been trying to install open source software. In this case an application called Moodle. I followed the instructions to install it on an Ubuntu Server vm but they were missing a couple of key points.

After installing the Moodle package (under “Moodle Installation” in the instructions) you need to copy the generated Apache configuration file into your Apache conf.d directory. To do this try the following command;

$ sudo ln -s /etc/moodle/apache.conf /etc/apache2/conf.d/moodle.conf

As you can see from this handy guide to configuring Apache on Debian application specific configuration files should go in the conf.d directory rather than hacking the httpd.conf file.

The second problem is that the default http://locahost/moodle URL won’t work on a server because access is restricted to the local machine only by default. To allow access from other machines (in my case the host computer) you need to edit the generated apache.conf file and uncomment the line which says allow from all. This will enable remote access to the instance from your host machine.

23rd August, 2012

Interrupted Service

Filed under: General — admin @ 1:52 pm

This site may not be available for various periods over the next couple of days as I move it lock, stock and barrel to a new web host. It has been a good few years at Cornerhost but it’s time to move. After an exhaustive search I’ve signed up at WebFaction and will be up and running on their servers in no time at all.

This does mean that email reception may be spotty as I migrate. In the rare event that you send me an email and I don’t reply please accept my apologies. Then resend your email. See you on the other side.

Update (2012.08.24): the blog and web site migration seems to have worked. Hopefully email will as well.

21st July, 2012

Quotable Quotes

Filed under: General — admin @ 10:01 pm

It started with a tweet from Tim O’Reilly. He mentioned a quote that I’m very familiar with – “Data matures like wine, applications like fish”. When I read it I wondered if it was anything to do with. His tweet linked to a blog post called the 11 best data quotes from the DataMarket blog. On that list (which I highly recommend reading) the quote was tentatively attributed to me based on a write up of my 2009 OSDC presentation entitled “Change Bad!”.

I’d like to take the credit for this, I really would. But I can’t. I did feature it on the 9th slide of my presentation but I didn’t write it. The problem is that I can’t remember where I first read it. Normally I put a reference in at least my notes so that I know which giant’s shoulders I am standing on but I’ve rummaged around in various hard drives and back ups and can’t find any reference. Which is a shame because it is a great quote – not least because it is very true. If anyone does know the real origin of the phrase please do leave a comment and I’ll put proper attribution in my slides.

You can check here http://www.annjewelry.com

The good news is that it has prompted me to clean up and re-publish the papers and slide from various presentations that I have given. I’ve put up a new index page for my presentations and checked and uploaded the correct versions of all of the files.

UPDATE: thanks to A C Censi in the comments the original quote was from James Governor’s Monkchips –
Why Applications Are Like Fish and Data is Like Wine

23rd June, 2011

Freedom

Filed under: General,ubuntu — admin @ 4:47 pm

Due to a recent accounting error (on my part and in my favour) I recently found myself in possession of a netbook. I know that makes me a luddite and I should have bought a tablet. Call me a throwback. In my defence it was half the price of an iPad and a lot more practical for me. The major deal breaker for me is that iPad’s don’t come with a command line client and can’t (to the best of my knowledge) run the only editor worth having. Also, iPad’s don’t run free software and that is becoming more important to me. So I bought a netbook.

As it came with Windows installed my first task was to install a decent operating system. I’m a fan of Xubuntu so I grabbed the latest release and then … stopped. Because my first thought was to burn the Xubuntu .iso file to a disk and install from that, but my netbook doesn’t have a CD drive. I’ve never installed from anything else in the past so I was a bit stuck.

The good news is that it is 2011 and Google came to the rescue. After a couple of false turns, and via Pendrivelinux.com, I found the rather wonderful LinuxLive USB Creator. Whilst it isn’t an exhaustive test, and don’t come to me with your problems, I simply installed and started LiLi, pointed it at my USB stick and the .iso file I had downloaded and 10 minutes later I had a bootable copy of Xubuntu.

Some words of praise, too, for the (X)ubuntu installer folks who have made getting their operating system on a new machine a complete breeze. Thanks everyone, top job.

Now all I’ve got to do is install all of the software that I rely on, configure the thing and I can start using it. At my pace that should only take a week or two. I’ll be back then.

24th November, 2010

Use the right tool for the job

Filed under: General — admin @ 1:28 pm

I was going to write an informed and opinionated piece about the use of proper tools in corporate IT departments. In particular I was going to say that I found it interesting that smaller, more cost conscious teams (in startups or open source projects) use more modern and sophisticated tools for issue management, project planning and code management than the big IT departments that I have the pleasure to work in.

But, well, I’ve got to go and write a status report showing the break down of issues by status, and that is going to take me about three and a half hours. So I don’t have time to faff about on my blog.

Instead, I’ll just paraphrase JWZ (who was apparently in turn paraphrasing an older comment about sed) and say;

Some people, when confronted with a problem think “I know, I’ll use a SharePoint list.” Now they have two problems.

I mean, a SharePoint list for issue management? When we could use Jira or FogBugz? I give up.

1st June, 2010

Generating HTML versions of reStructuredText files

Filed under: General,python — admin @ 1:37 pm

I wanted to quickly and easily convert a series of reStructured text documents into HTML equivalents. For reasons too dull to discuss here I couldn’t just use rst2html.py and didn’t want to go to the trouble of remembering enough bash syntax to write a shell script.

So I thought that as long as docutils is written in Python it would only take a moment or two to knock up a script to do what I needed. Well yes, and no. The script itself is fairly simple;

from docutils import core

def convert_files(name_pattern):
    for file_name in glob.glob(name_pattern):
        source = open(file_name, 'r')
        file_dest = file_name[:-4] + '.html'
        destination = open(file_dest, 'w')
        core.publish_file(source=source, destination=destination, writer_name='html')
        source.close()
        destination.close()

The most useful line being the one where I call core.publish_file. But it wasn’t immediately obvious from the docutils documentation what series of incantations would achieve my desired results. Luckily, after some time spent perusing the documents I came across this dissection of rst2html.py. This, in turn, lead me to the description of the Docutils Publisher, which lists the convenience functions available to work with the engine.

The end result isn’t particularly elegant but it does get the job done and I thought I would share it in case anyone else has a similar need in the future.

30th January, 2010

You Are Nothing Without A Command Line

Filed under: General — admin @ 11:35 am

I’ve always said that the appeal of any operating system – for me – is that I can fire up a terminal window and tinker around. When I say that many people look at me like I’ve got rocks in my head. But I’m glad I am not alone.

28th January, 2010

Professionalism

Filed under: General — admin @ 12:49 pm

I just read a fascinating article by Ed Smith called “Are We Too Professional?” which, although it is ostensibly about cricket, covers too many interesting topics to disect here. But it did prompt a couple of observations.

One is that he is bang on the money and that some of the best performances – at work, play or scientific endeavour – come from those who don’t always follow the proscribed practices. But this then lead me on to the thought that professionalism, especially in the contexts that Ed quotes it in the article, is often just used as an excuse to implement restrictions on people who are perfectly capable of thinking for themselves and shouldn’t need them. But for whatever reason those in authority don’t trust and think that without these controls there will be chaos. This is illustrated by the example he quotes of teachers having to plan their lessons in 3 minute chunks. Some of my favourite teachers at school often couldn’t plan how to get to their classrooms from the staff room, heaven help them if they had had to go into this level of lesson planning.

The other observation is that, as with many other things, the devil is in the details. Professionalism itself isn’t a bad thing, as long as you don’t confuse it with being good at what you are supposed to be achieving. Sure, having a “mission statement” can be a bad thing. Especially if it is as bad as –

“ICI’s vision is to be the leader in creating value for customers and shareholders through market leadership, technological edge and a world competitive cost base.”

After reading that I still don’t know what it is that they do. What is wrong there is not trying to define the purpose of the organisation, it’s how they have gone about doing it. Maybe they should have gone for “Be the best chemical producer in the world”. Just a thought.

Anyway, enough of my rambling, go and read the article.

Next Page »

Powered by WordPress