Very Noisy

I'm Mark Kennedy. I'm part of the furniture at Eurogamer Network Ltd. and I do my best to lead the web development team there.

Pals

Categories

What on Earth are you doing now?

  • Speed up composited Metacity on GMA 500 (06 February 2010)

    If you've got a netbook with Intel's useless GMA500 (Pouslbo) chipset, and you've managed to get the closed source Linux drivers working, you'll know that some things work well (libva accelerated video decoding) and some things not so well (2D acceleration). You can mitigate that last problem by using Metacity's composited mode which makes dragging windows around a hell of a lot smoother, and is preferable to trying to use a 3D window manager like Compiz, which is a bit flaky on this chipset.

    You can activate composited mode using gconf-editor and activating the options /apps/metacity/general/compositing_manager. You also get some nice shadows around your windows, which I think is good for usability.

    Unfortunately you'll now find alt+tab'ing to be un-usably slow (1-2 sec delay before the switcher appears) since in composited mode, Metacity uses little downsampled screenshots of all your apps instead of good, recognisable icons. I don't know about you, but at 100x100 (or whatever) I struggle to tell the difference between a web browser and a wordprocessor.

    So I poked around the Metacity source and found that you could hack out this 'feature' trivially. Check out the trunk from the Metacity SVN repos and apply this patch (which also has some minor changes to the constants used for the shadowing since I thought the defaults were a bit heavy handed):

    Index: src/compositor/compositor-xrender.c
    ===================================================================
    --- src/compositor/compositor-xrender.c	(revision 4239)
    +++ src/compositor/compositor-xrender.c	(working copy)
    @@ -232,11 +232,11 @@
     #define SHADOW_LARGE_RADIUS 12.0
     
     #define SHADOW_SMALL_OFFSET_X (SHADOW_SMALL_RADIUS * -3 / 2)
    -#define SHADOW_SMALL_OFFSET_Y (SHADOW_SMALL_RADIUS * -3 / 2)
    +#define SHADOW_SMALL_OFFSET_Y (SHADOW_SMALL_RADIUS * -3 / 2 + 1)
     #define SHADOW_MEDIUM_OFFSET_X (SHADOW_MEDIUM_RADIUS * -3 / 2)
    -#define SHADOW_MEDIUM_OFFSET_Y (SHADOW_MEDIUM_RADIUS * -5 / 4)
    +#define SHADOW_MEDIUM_OFFSET_Y (SHADOW_MEDIUM_RADIUS * -5 / 4 + 1)
     #define SHADOW_LARGE_OFFSET_X -15
    -#define SHADOW_LARGE_OFFSET_Y -15
    +#define SHADOW_LARGE_OFFSET_Y -12
     
     #define SHADOW_OPACITY 0.66
      
    @@ -2829,6 +2829,7 @@
     xrender_get_window_pixmap (MetaCompositor *compositor,
                                MetaWindow     *window)
     {
    +    return None;
     #ifdef HAVE_COMPOSITE_EXTENSIONS
       MetaCompWindow *cw = NULL;
       MetaScreen *screen = meta_window_get_screen (window);
    
    
  • How to create self signed certificates for multiple domains (25 January 2010)

    If you want to host multiple https sites on a single IP using name virtual hosts, then you'll need to use a single certificate due to way SSL works. To make this work you need to either make a wildcard domain, which only works for subdomains of a single domain (e.g. *.mydomain.tld) or set one of the domains as the 'common name' and then the entire list of desired domains in the in the x509v3 extension area.

    If you want to use a 'multiple site' (not a subdomain wildcard certificate) for whatever reason (they are cheaper for a start) then the issuing authority will have an interface for specifying the extra domains. If you want to test out your server configuration first, before potentially wasting a lump of cash on the certificate, then you'll want to do a bit of self signing using openssl.

    However, the alternative names (formally: 'subject alternative name') stuff isn't well documented. Here's what I did:

    Choose a permanent location on disk for your certificates and keys.

    In the example, my domain is '''domain.tld''' and I'm setting up two subdomains: www and www2.

    cd [that location]
    

    Generate a lovely private key and keep it somewhere safe (safe = private but backed up - if you lose it, you'll have to make a new certificate):

    openssl genrsa -out www.domain.tld.key 1024
    

    Don't use a passkey - you'll only have to enter it every time you start up Apache.

    Generate a certificate request file:

    openssl req -new -key www.domain.tld.key -out www.domain.tld.csr
    

    Answer the questions! For 'Common Name' put the first domain name (www.domain.tld). Be careful to make sure all the info is correct.

    Create a extensions config file for the certificate generation (you can throw this away when you're done). This is the important bit for getting the extra domains in. You need to list ALL the domains, since the Common Name you set above is only used in the absence of the subjectAltNames field (I think).

    In www.domain.tld.cnf:

    subjectAltName=DNS:www.domain.tld,DNS:www2.domain.tld 
    

    Then run:

    openssl x509 -req -days 365 \
      -in www.domain.tld.csr \
      -signkey www.domain.tld.key \
      -text \
      -extfile  www.domain.tld.cnf \
      -out www.domain.tld.crt 
    
  • Christmas curry sauce for turkey (29 December 2009)

    Gotta use up the turkey, innit. Anyway, keeping it vague:

    Fry 1 tsp fennel seed, add chopped onion and garlic and fry till sweet. Add bits from the fridge, like a small quantity of aubergine, courgette, sweet pepper and then mix in 2 tsp of decent, but mild, curry powder, a couple of fistfulls of fresh tomato (any variety - I used cherry) and a good splodge of tomato puree. Dilute with a cup or two of water, at least 1 tsp of salt and simmer down to a thick sauce. Add chilli and salt to taste.

    I served in a separate bowl to a plate of sliced turkey, with potato and spinach, rice and some tarka dal. Makes a nice change from cheese and chocolate!

  • Smoked salmon and cauliflower chowder (22 December 2009)

    A cosy winter soup that uses up the sort of things that tend to accumulate in my fridge.

    You may need more liquid than I've quoted - you can use extra milk, stock or just water, obviously.

    • 50-75g unsalted butter
    • 1 onion
    • 1 little garlic man (don't go crazy!)
    • 1 cauliflower (or romesco) split into small, bitesized florets
    • 1 large potato
    • 1 large or 2 small carrots
    • small stick of celery (or a pinch of ground fennel seed will do - it's what I did last time)
    • 1-2 tsp of ground coriander seed
    • a good fistful or two of smoked salmon trimmings
    • heaped dessertspoon of plain flour
    • pint of milk
    • pint of homemade, unsalted stock (vege or fish) or half strength instant stock
    • pepper

    Chop onion, celery, garlic and carrot very finely and soften low-medium for 5-10 mins in plenty of butter. Chop the potato into bitesized pieces and add that. Continue to fry for a minute or two - the potato will start to cook at the edges, and may stick a bit - don't worry.

    Add the flour and cook the whole lot (dry) for a couple of minutes as if you were making a roux (you are!).

    Take off the heat and pour in the stock slowly, stirring so it all mixes well, then add the milk. Bring to the boil but not too hard, making sure to scrape the bottom of the pan to disolve the stuck bits. Add enough salt so it's just a little underseasoned (the salmon is salty) and some pepp. Also add the pinch of fennel seed, if using.

    Simmer for a minute or two, then add the cauliflower and continue to simmer till it's tender enough for you. It's a soup, so you don't want it as crunchy as if you were eating it on its own.

    Now, what I did was take my hand blender, and sort of whizz up about half of the soup, so leaving lots of nice chunky cauli and potato, but also giving it a good thick texture.

    Then dump in the salmon and the ground coriander and break up the salmon as it cooks with a spoon. Leave it for long enough that you feel the flavour of the salmon has got into the soup and adjust the seasoning, etc.

    I just served with a little cream dribbled in, and some extra black pepper. Don't put any fresh coriander on - it's not the right flavour.

    Enjoy!

  • Tethering a Nokia N95 over Bluetooth on Ubuntu 9.10 (03 December 2009)

    N95's and certain other Symbian Nokia phones, implement tethering over bluetooth by offering a Dial Up Networking (DUN) service, i.e. a serial modem over bluetooth. You have to use Hayes modem commands and everything! It's a bit fiddly to set up by hand, and isn't supported (yet) by Gnome's built in bluetooth manager. Fortunately, you can just use the Blueman project's applet instead, though this isn't really documented anywhere.