Monday 24 October 2011

Just don't ask...


0 @M1@ INDI
1 NAME Josef /Fritzl/
1 SEX M
1 FAMS @U1@

0 @F1@ INDI
1 NAME Rosemarie /Fritzl/
1 SEX F
1 FAMS @U1@

0 @F2@ INDI
1 NAME Elizabeth /Fritzl/
1 SEX F
1 FAMC @U1@
1 FAMS @U2@

0 @F4@ INDI
1 NAME Paula /Fritzl/
1 SEX F
1 FAMC @U1@

0 @F5@ INDI
1 NAME Doris /Fritzl/
1 SEX F
1 FAMC @U1@

0 @M2@ INDI
1 NAME Gabriele /Fritzl/
1 SEX M
1 FAMC @U1@

0 @M3@ INDI
1 NAME Joseph /Fritzl/
1 SEX M
1 FAMC @U1@

0 @M4@ INDI
1 NAME Harald /Fritzl/
1 SEX M
1 FAMC @U1@

0 @M5@ INDI
1 NAME Sepp /Fritzl/
1 SEX M
1 FAMC @U1@

0 @F3@ INDI
1 NAME Kerstin /Fritzl/
1 SEX F
1 FAMC @U2@

0 @M6@ INDI
1 NAME Stephan /Fritzl/
1 SEX M
1 FAMC @U2@

0 @M7@ INDI
1 NAME Felix /Fritzl/
1 SEX M
1 FAMC @U2@

0 @F6@ INDI
1 NAME Lisa /Fritzl/
1 SEX F
1 FAMC @U2@

0 @F7@ INDI
1 NAME Monica /Fritzl/
1 SEX F
1 FAMC @U2@

0 @M8@ INDI
1 NAME Alexander /Fritzl/
1 SEX M
1 FAMC @U2@

0 @M9@ INDI
1 NAME Kind /Fritzl/
1 SEX M
1 FAMC @U2@

0 @U1@ FAM
1 HUSB @M1@
1 WIFE @F1@
1 MARR
1 CHIL @F2@
1 CHIL @F4@
1 CHIL @F5@
1 CHIL @M2@
1 CHIL @M3@
1 CHIL @M4@
1 CHIL @M5@

0 @U2@ FAM
1 HUSB @M1@
1 WIFE @F2@
1 MARR
1 CHIL @F3@
1 CHIL @M6@
1 CHIL @M7@
1 CHIL @F6@
1 CHIL @F7@
1 CHIL @M8@
1 CHIL @M9@

Thursday 20 October 2011

Accessing RDS using HeidiSQL

Whilst looking at family-tree type things yesterday at work (it was for a work-based project, honest!) I remembered that my boss was looking at a way to administer our database on RDS. After reading shed loads of documentation, which said that it couldn't be done or that you needed to jump through loads of hoops I managed it.

Basically what I had to do it connect to it via one of the instances we already have running on AWS.

When we log into RDS we use this command on one of the instances running in order to get access to the mysql commandline:

mysql -u [username] -p[password] --database=[database name] --host=[location of RDS instance]

So for instance when we use puTTY to log into our Development instance we issue the above command to get into the RDS instance - there doesn't seem to be a direct way of accessing it.

HeidiSQL can understand that work-flow so in the Session manager of HeidiSQL create a new Session and call it "RDS" for example.

On the Settings tab select SSH tunnel as the Network Type, enter the host variable from the command detailed above into the Hostname / IP field (i.e. [location of RDS instance]). In our case User is [username] and Password is [password]. We'll keep Port as 3306, keep the Compressed client/server protocol tickbox ticked and enter [database name] in the Databases field.

Next click the SSH tunnel tab. Locate plink.exe on your hard drive or download it (handy link on the tab itself). The SSH host + port is the instance you just copied the command from. So for us it's [some subdomain].[some domain].com, port 22. Username is [not necessarily the same username as above] (the username you use to access the AWS instance). Leave the Password field blank and locate your ppk file (which you converted from your initial pem file using PuTTYgen.exe a while ago). Leave the Local port as 3307.

Click Save and then Open and Bob's your Uncle and Fanny's your Aunt!

Happy browsing of the DB!

Saturday 15 October 2011

Of demented cats and rapid mice

So her indoors is nigh on always late home from work, which drives me up the wall TBH, she's canny though and keeps track of all the time she's late and takes a day off here and there when the time owing accrues to allow it.

She took yesterday off and did a grand job of servicing the engine on the boat.
Now the cat thinks we're just too stupid to be able to breath let alone hunt so every-so-often he decides to take pity on us and deliver us a mouse (if we're lucky) or a rat (if we're unlucky). Yesterday he decided her indoors needed some exercise while she was knee deep in the engine and covered in oil and goodness knows what (I'm not the most mechanically minded person, as you can tell), so he manages to find an old mouse outside, drops it by her, and saunters off so he can sit in the warm by the fire.

Her indoors looks aghast at the mouse and the cat. The cat takes no notice as he's fallen asleep already but the mouse decides that humans aren't his favourite mammal so buggers off under the fridge.

I get home and feed the cat and after her indoors gets back from visiting a friend we discuss the impending dementia of the daft bloody cat, deciding that we'll leave him be until he starts pissing all over the place.

The evening progresses and off to bed we go but the cat decides that he'll pee where he normally pees, i.e. the engine room, and ends up falling between the boards looking for his litter tray. Once we extricate the daft bugger from between the planks I throw him out and try to settle to sleep.

Sure enough I soon hear the pitter-patter of feet but I figure it can't be the cat as I've not heard the cat flap go. That's it, it must be a bloody great big rat! Lights go on and I look all over, find the cat asleep on his cushion by the fire (bugger knows how he got back in, he stomps about like a baby elephant most of the time).

I'm getting ready to go back to bed when her indoors says she's seen the rat/mouse in the bedroom and it's heading in my direction!

Righty-O, says I, no mouse'll get the better of me!

I stoop down and catch the poor little bugger in my hands, he looks into my eyes, ponders what I'm about to do, pisses himself (unbeknownst to me) and bites down with all the force his little jaws can muster on the bit of flesh between my fore-finger and thumb!

I let out a girly shriek and feel the warm liquid dripping down my arm and beg her indoors to open the front door so I can fling the rabid wild animal outside and try to get some relief before I bleed out (that there mice must have pissed it's own body volume as I'm not joking about the amount of liquid dripping all over).

Mouse thrown I inspect the damage, no blood except where it's welling out of two holes in my palm but I'll be buggered if I get Weil's disease so her indoors goes all nurse and swabs my wounds with antiseptic.

In the meantime all this fuss has upset the cat so he decides that the cushion is no longer good enough and nicks my place in the bed. His ire at being gently moved knows no bounds and he spends the remainder of the night dancing a polka on my head.

Monday 3 October 2011

Had the need to send a set of hex colour codes to a method which used them to create a chart using Google charts. The initial list was too short so that some of the colours ended up being repeated and the data became difficult to read. I pottered around the code base and "borrowed" some functionality from the boss. The following code is what I used to test it. By all means copy and paste it into a blank file and give it a try. Works a treat!
 <!DOCTYPE HTML>  
 <html>  
  <head>  
   <title>Palette Playing</title>  
   <script type="text/javascript">  
    var palette = "000000,0000FF,00FFFF,00FF00,FFFFFF,FF0000,FFFF00,FF00FF";  
    document.write(palette.split(',').splice(0, 4).join(','));  
   </script>  
  </head>  
  <body>  
  </body>  
 </html>  
This will produce "000000,0000FF,00FFFF,00FF00".