Archive for the ‘Uncategorized’ Category

Broad Beans On Toast

Tuesday, August 23rd, 2011

Yes,

I like broad beans on toast with lots of butter (for breakfast).

using your linux box as a mass storage device

Saturday, June 25th, 2011

this is something i have wanted to do for a while now but havnt yet tackled. i thought however i would note down what i have found so far.

  1. you will most proably need a usb peripheral card. this is different to the normal host mode chips you get on motherboards.
  2. you will have to use the linux usb gadget project, it looks like they already have a mass storage driver written.

one day i’ll give this a go

tv to watch

Sunday, June 19th, 2011

The shadow line

Case Histories

Doc Martin

The freeview signal keeps breaking up on my Panasonic Viera but its ok on my PVR — FIXED

Wednesday, April 14th, 2010

I have been battling with a poor quality freeview signal on my Panasonic Viera. Its been intermittent but very annoying, the biggest pain in the arse was the picture was fine on my digifusion PVR. I eliminated down lead issues, power interference, central heating interference and other devices plugged into the tv. That could only mean the signal was too strong for the tv! Apparently posher tuners (unlike my cheap pvr) will “squash” the signal if there are strong frequencies in it. What was needed was a signal attenuator, these are easy to build comprising of only three resistors. Now all my freeview problems have gone…. Serves me right for being a stones throw from winterhill

http://www.whoshouldyouvotefor.com

Tuesday, April 13th, 2010

Take the Who Should You Vote For? UK General Election quiz

Green 45
Liberal Democrat 21
UK Independence 11
Labour -8
Conservative -28

Your recommendation: Green

Click here for more details about these results

Getting mach64 dri working on a debian 2.6 kernel

Thursday, November 12th, 2009

I just did this, install git

apt-get install git-core

get the source

git clone git://anongit.freedesktop.org/git/mesa/drm

build it

cd drm/linux-core

make DRM_MODULES=”mach64″

then insmod it

insmod drm.ko

insmod mach64.ko

its done

Pairing keyboard with latest version of BlueZ in debian

Wednesday, October 28th, 2009

Just a quick note, hidd has gone in the latest build in favour of using DBUS to get things going…. here are the docs about it on the bluez wiki

http://wiki.bluez.org/wiki/HOWTO/InputDevices

this didnt work for my debian install so I had to install the bluez-compat package to get hidd back. Now I can still use it to connect my keyboard

hidd –connect AA:BB:CC:DD:EE:FF:00

and it dosnt timeout anymore :)

Implementing RSA Encryption and Decryption in Java

Wednesday, September 2nd, 2009

Specifically RSA, this example shows how you can sign a communication. Signing is where you encrypt with the private key and everyone can decrypt with the public key. It works the other way where everyone can encrypt with the public key and only you can decrypt that message with the private key. This example was lifted from an axis web service.

public class SignExample {
    static KeyPair keys;
    static {
        try
        {
            KeyPairGenerator keyGen = null;
            keyGen = KeyPairGenerator.getInstance("RSA");
            keyGen.initialize(1024);
            keys = keyGen.generateKeyPair();
        } catch (NoSuchAlgorithmException e1) {}
    }

    public byte[] testEncrypt(String message, ByteArrayHolder encrptedMessage)
           throws NoSuchAlgorithmException, NoSuchPaddingException,
                  InvalidKeyException, BadPaddingException, IllegalBlockSizeException
    {
        Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
        cipher.init(Cipher.ENCRYPT_MODE, keys.getPrivate());
        byte[] text = cipher.doFinal(message.getBytes());
        encrptedMessage.value = text;
        return keys.getPublic().getEncoded();
    }
    public String testDecrypt(byte [] message)
             throws NoSuchAlgorithmException, NoSuchPaddingException,
                    InvalidKeyException, BadPaddingException,
                    IllegalBlockSizeException, IOException
    {
        Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
        cipher.init(Cipher.DECRYPT_MODE, keys.getPublic());
        byte[] text = cipher.doFinal(message);
        return new String(text);
    }
}

Really, the keys generated should be persisted and re-used in this example. However you may want to regenerate keys for each conversation and transmit those keys securely to the person you are conversing with.