Out-of-school education settings

Here is the comment I sent to the Government consultation on out-of-school education settings. Feel free to re-use, modify, distribute as you like.

I am writing to express my opposition to the government’s plans to regulate the content of out-of-school education.

I volunteer on an annual residential Christian holiday for young people which includes teaching on Christianity and the Bible. I am concerned that the work of this holiday would be regulated under these proposals. However, my concern is much wider than simply this and similar work.

I want to defend people I disagree with, as well as those with whom I agree.

I do not believe it is beneficial to society for governments to control the content of education provided outside of the state education system. In fact, I think it is a dangerous path to take, since while we may trust our current government and inspection regime, we have no reason to suppose it will always be tolerant and respectful of diverse views.

The use of terms such as “British values”, “emotional harm” and “tolerance” in the proposals is concerning since these are open to widely-varying interpretations. In recent history, it could certainly have been considered “un-British” to lobby for the legalisation of homosexuality or the enfranchisement of women, or to support a communist political party.

Personally, I interpret “British values” to mean being tolerant of views very different from my own, and keeping state interference in individual decisions to a minimum. In that context, I believe these proposals are in conflict with British values, and my own values.

I believe that the best way to counteract violent religious extremism is to practice the tolerance that we preach: to demonstrate in words and actions that we respect individual freedom of speech and action. Where children are being taught values with which we disagree, we should argue in public against those values, not ban them from being taught.

New open source project on work time – git-history-data

Announcing a little open source project that I have built at work and been allowed to publish Freely.

git-history-data analyses a Git source code repository and dumps out data in a form that is easy to analyse.

I wrote an article demonstrating how to use it to find out some interesting information about the codebase of Git itself and got it published on IBM DeveloperWorks Open: Learning about the Git codebase using git-history-data.

Java HTTPS to a server with a self-signed certificate

Nothing is easy in Java, and nothing is more disproportionately non-easy than downloading something. If you add SSL to the equation, it becomes unfeasible for any human to navigate the twisted passages of the Java API, so here is a tiny fragment of map I have pieced together using the Internets.

If you have a server that you want to download something from, and you need to use SSL (i.e. your URL starts with “https://”), and it has a self-signed certificate, you will need to get hold of a “trust store” file (a .jks file) that tells Java it can trust your server. How to get hold of this file is out of the scope of this blog post, by which I mean I don’t know how you get one.

Assuming you have somehow magicked up a trust store file (let’s call it trust.jks), and you know the password for it (let’s call it yourpassword), we can continue.

Let’s write a little program Get.java that fetches a URL and tells us whether we got an error with the SSL connection:

import java.net.URL;
public class Get
   public static void main( String[] args ) throws Exception
           new URL( args[0] ).openConnection().getInputStream();
           System.out.println( "Succeeded." );
       catch( javax.net.ssl.SSLHandshakeException e )
           System.out.println( "SSL exception." );

Compile this with:

javac Get.java

And run it with:

$ java Get https://google.com

This should succeed, because Java knows it can trust the benevolent Google deity, as we all do.

Now try it against your server with a self-signed (or otherwise untrusted) certificate and you should see an error:

$ java Get https://selfsigned.example.com
SSL exception.

And now for the answer you were waiting for. You don’t need to use keytool. Repeat: you don’t need to use keytool. To run Java telling it to trust your server, just do this:

$ java \
    -Djavax.net.ssl.trustStore=/path/to/trust.jks \
    -Djavax.net.ssl.trustStorePassword=yourpassword \
    Get https://selfsigned.example.com

That’s it.

Vim as editor for Claws Mail

I got sick of not having Vim as my text editor for emails in Claws Mail but GVim makes my eyes bleed so I wanted proper Vim-in-a-terminal as my editor, which was not particularly straightforward.

The proper incantation was to make a script in my PATH called terminal-vim like this:


mate-terminal --disable-factory -x vim -f "$@"

(gnome-terminal should work similarly if you’re in GNOME.)

and to set it as my external editor in Claws Mail by going to Configuration, Preferences, External Programs, and setting Text Editor to terminal-vim '%s'.

Then under Writing in Preferences, I ticked the box “Automatically launch the external editor” and all is well.