(Almost) time to say goodbye…

Well done Oppy, you did way more than originally planned, but we knew this day would eventually come… RIP

The Road To Endeavour

oppy 1f b2

This is a very hard post to write. It’s one I’ve been dreading, for years, literally years, but there’s no putting it off any longer.

Overnight last night the final, Final, FINAL ‘Wake up, please?’ commands were sent to Opportunity, the absolutely last throw of the last dice. Its been 8 months since we last heard anything from her, and even as those last commands were being beamed from Earth we all hoped against hope that Oppy would stir, and bleep back a last minute “Ha! Had you fooled! Surprise!!” reply –

But Opportunity didn’t answer.

So.

Barring some kind of miracle it looks like this evening’s (7pm) NASA press conference will be for the announcement that Opportunity’s mission is finally over. This day was always going to come, and it’s important for everyone to remember that Oppy – which we hoped would last for 90 days after landing –…

View original post 1,263 more words

Slowly catching up with things…

It’s been a busy 6 months, trying to update all of my websites whilst commuting etc & it’s taking a long time especially as the front end’s are being done from scratch. If someone ever tells you it’s simple to move from a classic website to one using microservices, don’t believe them – it will take some time.

Anyhow, progress is progress. Here’s the current status:

  • The blog is now on it’s own domain, new layout, still not happy about how it looks though.
  • Documentation and API’s are now on the area51.onl site with more being added as I finish them.
  • departureboards.mobi is almost complete, just got some minor layout issues to solve.
  • uktra.in is next. Most of the backend stuff is done, just got to port the CMS over and rewrite the timetable search & real time search pages.
  • map.lu is running to the point it’s now providing maps again to the other sites.
  • maidstoneweather.com & the weather station are still sadly down. I’ve got the replacement electronics ready but again it’s finding time to fix it – it’s only taken a year so far :-S
  • trainwatch.uk is still dormant – not found a use for that domain yet.

So there’s still plenty to do. When you spend 20+ hours just commuting on top of the working week it’s a problem, but I’m getting there.

John Cleese’s “Letter to America”

This was from 2008 but again it applies to today’s potentially disastrous result

Things Are Looking Up...

Originally uploaded by Browserd.
Dear Citizens of America,

In view of your failure to elect a competent President and thus to govern yourselves, we hereby give notice of the revocation of your independence, effective immediately.
 
Her Sovereign Majesty, Queen Elizabeth II, will resume monarchical duties over all states, commonwealths and other territories (except Kansas, which she does not fancy), as from Monday next.

Your new prime minister, Gordon Brown, will appoint a governor for America without the need for further elections. Congress and the Senate will be disbanded. A questionnaire may be circulated next year to determine whether any of you noticed.

To aid in the transition to a British Crown Dependency, the following rules are introduced with immediate effect:

1. You should look up “revocation” in the Oxford English Dictionary. Then look up “aluminium,” and check the pronunciation guide. You will be amazed at just how…

View original post 745 more words

Converting OS Grid coordinates into Lat/Long using PostGIS

I had a case of needing to convert Ordnance Survey grid coordinates like 548420,247240 that were in a table from NAPTAN into latitude & longitude so that I could display them in a map.

Most references online appear to do this by running the data through some application then importing it back into the database but as I’m using PostGIS I wanted to do it directly on the database.

So here’s how I did it.

First here’s the table I want to process:

gis=> select crscode,stationname,easting,northing from naptan limit 5;
 crscode |           stationname           | easting | northing
---------+---------------------------------+---------+----------
 ABA     | Aberdare Rail Station           |  300400 |   202800
 AUR     | Aberdour Rail Station           |  319100 |   685400
 AVY     | Aberdovey Rail Station          |  260600 |   296000
 ABE     | Aber Rail Station               |  314870 |   186950
 AGL     | Abergele & Pensarn Rail Station |  294612 |   378681
(5 rows)

Now you see we have the rail station’s coordinates as an easting & northing pair.

First I added a geometry column to the table naptan:

gis=> select AddGeometryColumn( 'public', 'naptan', 'the_geom', 27700, 'POINT', 2);
                  addgeometrycolumn
------------------------------------------------------
 public.naptan.the_geom SRID:27700 TYPE:POINT DIMS:2
(1 row)

Here 27700 is the ESRI code for the OS grid system.

Next I updated the table to create geometries for each entry:

gis=> update naptan set the_geom=GeomFromText('POINT('||easting||' '||northing||')',27700);
UPDATE 2603

This updates each row using the easting and northing columns.

Finally I needed to add two new columns for latitude & longitude and populate them with the final values:

gis=> alter table naptan add column lat real;
ALTER TABLE
gis=> alter table naptan add column long real;
ALTER TABLE
gis=> update naptan set long=st_x(st_transform(the_geom,4326)), lat=st_y(st_transform(the_geom,4326));
UPDATE 2603

That’s it, we now have the table populated with lat/long coordinates:

gis=> select crscode,stationname,lat,long from naptan limit 5;
 crscode |           stationname           |   lat   |   long
---------+---------------------------------+---------+----------
 ABA     | Aberdare Rail Station           | 51.7151 | -3.44308
 AUR     | Aberdour Rail Station           | 56.0546 | -3.30056
 AVY     | Aberdovey Rail Station          |  52.544 | -4.05707
 ABE     | Aber Rail Station               |  51.575 | -3.22983
 AGL     | Abergele & Pensarn Rail Station | 53.2946 | -3.58262

Hopefully this is correct – if it isn’t please let me know but the final data looks ok to me.

/home/edivad

If in emacs you need a different file coding system (line terminator), for example you are on a windows system and need to type a unix like text file (or vice versa), you can easily convert the buffer coding system.

Dos to unix

M-x set-buffer-file-coding-system RET undecided-unix
save the file (C-x C-s)

or

C-x RET f undecided-unix
C-x C-f

Unix to dos

M-x set-buffer-file-coding-system RET undecided-dos
save the file (C-x C-s)

or

C-x RET f undecided-dos
C-x C-f

View original post

Generating private keys with openssl

Keys are the basis of public key algorithms and PKI. Keys usually come in pairs, with one half being the public key and the other half being the private key. With OpenSSL, the private key contains the public key information as well, so a public key doesn’t need to be generated separately.

Public keys come in several flavors, using different cryptographic algorithms. The most popular ones associated with certificates are RSA and DSA, and this  article will show how to generate each of them.

Generating an RSA key

A RSA key can be used both for encryption and for signing and generating a key is quite easy, all you have to do is the following:

  openssl genrsa -des3 -out privkey.pem 2048

That will generate a private key with is password protected (it will prompt you for the password during generation). If you don’t want it password protected (usually for server side use) then leave the -des3 parameter out, i.e.:

  openssl genrsa -out privkey.pem 2048
 The number 2048 is the size of the key, in bits. Today, 2048 or higher is recommended for RSA keys, as fewer amount of bits is considered insecure.

Generating a DSA key

A DSA key can be used for signing only. This is important to keep in mind to know what kind of purposes a certificate request with a DSA key can really be used for.

Generating a key for the DSA algorithm is a two-step process. First, you have to generate parameters from which to generate the key then to generate the key itself.

  openssl dsaparam -out dsaparam.pem 2048
  openssl gendsa -des3 -out privkey.pem dsaparam.pem

Again like RSA, 2048 is the size of the key, in bits with anything smaller than 2048 being insecure in todays standards.

Also the -des3 parameter will prompt you for a pass phrase – for server use leave it out:

  openssl dsaparam -out dsaparam.pem 2048
  openssl gendsa -out privkey.pem dsaparam.pem

Shows I must catch up with some blog rea

Shows I must catch up with some blog reading…

James Gosling (Father of Java) was at the Reno air races where they had that fatal crash last week, and he was actually sitting only 40 feet away from the impact.

There’s some interesting entries in his blog about it & from my little knowledge of aerodynamics it does look like a total control surface failure…

Part 1: http://nighthacks.com/roller/jag/entry/i_m_alive
Part 2: http://nighthacks.com/roller/jag/entry/some_more_detail
Part 3: http://nighthacks.com/roller/jag/entry/some_theorizing