ascii image


0010101000011111101001101010000010011000
1110101110110101011011111010010010001011
0001011100011101111001010011010010111110
0000010111101001100000110011101100001000
0011000000111010001111111000100110000001
1010110110000000000001011001000110001010
0101100010101100000100000010100100010101
0001011001011101100011000101110111101110
0110010100110100111101110100110011111101
0010111100110011010010110010101111011011
0100000000001001001011000010110100101001
1101000111100000110111011100110111000010
1111110001111111101101001010000111101100
0010110000100000111011000000101100010110
0101111000011100111010000000011111101111
0010010011110010011101001000110101000101
0000000001000100001111111100111010001111

Thursday 10 November 2011

Diaspora

You can find me on diaspora now...

diasp.org (USA) and diasp.eu (EU).

You really should read the review here:  chronicle.com

 Remember you are the CUSTOMER NOT the PRODUCT !

Bye bye G+

I've left Google+, well they asked me to as i used a pseudonym...

c'est la vie, their loss...

Sunday 30 October 2011

Pumpkin

Two things done today. 

1. Installed extra insulation in Loft and Kitchen - horrible, scratchy, dirty job.

2. Carved a pumpkin.

I have always fancied carving a pumpkin.  Thing is they are so small and bloody expensive here in the UK, plus i'm not a big fan of Halloween over here (it's a sad, sad attempt of what the Yanks can do - so why even bother).

Any way onto the pumpkin.





Okay so it looks quite small right...?




And here it is growing on the allotment in my pumpkin patch.



And the scary part...

Here we go CSI Warwickshire...  or daft insulation contractors...





Tuesday 23 August 2011

Sort HTML table with a row header (2 row sort)

Table
ID NAME Value SPECIALIZATION
Row Header 11
1Angelina-1Computer Science
Row Header 22
2Martina10Mathematics
Row Header 33
3Tina0.5English
Row Header 44
4Simran100Biology
Row Header 55
5Christina-99Psychology
The code below allows the above table to sort the data values while keeping the row headers above. Something i couldn't find an example for on Google.
 function doSort(column, tableID, direction) {  
   var data = []  
   var table = document.getElementById(tableID);  
   var skip = 1; // skip column headers  
   // set up sortable data array [ sorted key, row data, header data ]  
   for (var i = skip + 1, l = table.rows.length; i < l; i=i+2) {  
           // grab each row - so we can clone later  
     var header_cell_row = table.rows[i - 1]; // header cell row data  
     var data_row = table.rows[i]; // sortable row data  
            var cell_data = table.rows[i].cells[column].innerHTML; // this is the bit we sort.  
             data.push([parseFloat(cell_data), data_row, header_cell_row])  
   };  
   //sort that array in the direction we ask  
   data.sort(  
     direction==0 ?  
       function(a,b){return a[0]<b[0]?-1:a[0]>b[0]?1:0} // ASC  
     :  
       function (a, b) { return a[0] > b[0] ? -1 : a[0] < b[0] ? 1 : 0} // DESC  
   )  
   // run thru sorted array  
   for (var i = 0, l = data.length; i < l; i++) {  
           // we append at the bottom of the original table the new sorted table  
           // as we have saved the real rows we can clone and append  
     //  
     // header row  
     //  
     var source = data[i][2];  
            table.appendChild(source.cloneNode(true));  
     //  
     // data row  
     //  
     var source = data[i][1];  
            table.appendChild(source.cloneNode(true));  
           //  
           // delete an old row from the table  
           //  
          table.deleteRow(1);  
           table.deleteRow(1);  
   }  
 }  

Sunday 17 July 2011

Monday 11 July 2011

Fat and Sugar

Ever wondered how much bad stuff there is in your normal diet?  I did...

So i thought i would just check out a few things to see what saturated fat and sugar they contained - well i was quite surprised...



Click here for an up to date chart : https://spreadsheets.google.com/spreadsheet/
The link also makes the text expand so you can see the full items i checked.

Looks like i am sticking to fruit at lunchtime.

Wednesday 18 May 2011

More temp sensors

I have finally wired up the two greenhouses into the 1-wire network.  You can see the temperature sensors on the left...

Friday 1 April 2011

Chitting Carrots

I read in Grow Your Own that a good way to get a great crop of carrots was to 'chit' them.

On a plate, place some kitchen towel and spray with water.  Sprinkle the seed and cover with cling film.  Keep them moist and in 4-5 days they sprout.


Here is a close up and you can see the roots coming.

Of course its not all that easy to get them off the paper towel on to your soil.   I ended up flicking them off with a plant/seed tag.

Now they are in bags in my greenhouse (tomato bags from Wilkos)- I'm not going to plant them outside.  My wife is doing her trial of carrots in a raised bed.

So the competition is on. :)


Wilkos bags wilko-grow-bag-tomato-x-2-46ltr  Yes I know they are tomato bags, but also they are just right for carrots and only 3 quid for 2.

Wednesday 16 March 2011

Heat Gun Desoldering

I've always struggled to de-solder ICs from old PCBs.  Then i happened to find a web page describing how to use a paint stripping heat gun to do it.

Well it's amazingly simple to do.  Here is what i pulled off a board in 10mins.


Basically heat the PCB face down (on low power, 300°C) and tap the ICs out, most just fall out.

Brilliant.


Read more here:  www.instructables.com and www.robotroom.com

Wednesday 9 March 2011

Linux root disk resize with raid, ext4 and grub2

There are lots of decent how-to pages on the 'net;

And here are my notes;
  • Make sure you add a small <5MB partition for the boot loader as these are the boot disks

    # gdisk -l /dev/sdc
    GPT fdisk (gdisk) version 0.5.1

    Partition table scan:
      MBR: protective
      BSD: not present
      APM: not present
      GPT: present

    Found valid GPT with protective MBR; using GPT.
    Disk /dev/sdc: 1953525168 sectors, 931.5 GiB
    Disk identifier (GUID): 1213CECB-D072-12C2-4846-60804FA91405
    Partition table holds up to 128 entries
    First usable sector is 34, last usable sector is 1953525134
    Total free space is 0 sectors (0 bytes)

    Number  Start (sector)    End (sector)  Size       Code  Name
       1              34            6144   3.0 MiB     EF02  BIOS boot partition
       2            6145      1953525134   931.5 GiB   FD00  Linux RAID


  • Set the grub_bios flag on the small partition

    sudo parted /dev/sdc set <partition_number> bios_grub on

  • Once you have swapped out the disks each time, re-sync-ed and grown the raid.
    Boot via a rescue disk and fsck the raid metadevice and then resize the filesystem.

    e2fsck -f /dev/md0

    resize2fs /dev/md0

    mkdir /tmp/a
    mount /tmp/a /dev/md0
    df -h

  •  Reboot and you are done.

    # df -h | egrep "md|Filesys"
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/md0              917G  8.0G  863G   1% /
    /dev/md2              1.8T  456G  1.3T  27% /data


Resync on the old disks

md0 : active raid1 sdd1[2] sdc1[0]
      74920896 blocks [2/1] [U_]
      [>....................]  recovery =  2.6% (2012992/74920896) finish=41.5min speed=29240K/sec


Resync on the new

md0 : active raid1 sdd2[1] sdc2[0]
      976759424 blocks [2/2] [UU]
      [=>...................]  resync =  8.1% (79639488/976759424) finish=181.6min speed=82296K/sec

Some what faster - and a hell of a lot quieter.

Saturday 22 January 2011

1-wire PSU

I've had flakey 5V power in my greenhouse for some time now.  I've tried various wall-warts of differing ampage but no go.   Finally I pulled power directly from the computer PSU this helped but it was still slightly below 5V  (4.86V).

So i built a 12V to 5V 3A convertor using LM7805 regulators in parallel.  Circuit diagram below.
Big thank you to Colin @ g1gsw with the help designing this.

Now, it is much better with 5.28V in the greenhouse (measured by a ds2438 Smart Battery Monitor).


Circuit diagram:



Friday 14 January 2011

New soil temperature sensors

Due to the very cold weather we had in December, -15C and below, my soil temperature sensors didn't hold up.

The sealant i used (brown frame sealant) deteriorated in cold - which is bad for anyone using it to keep their windows in !

So now i have set the sensors in the same 7mm dia. copper pipe, but only used 50mm long pieces.  Hopefully the HMA (Hot melt adhesive) - more commony know as hot glue gun stuff - will keep the water out.

Initial testing showed the sensors reading 35C and 37C while the glue cooled. :)



Now i have to come up with a method to connect the sensors back to the cable i removed them from - last time it was all one piece.

Thursday 6 January 2011

owfs errors : BUS_select_subbranch

I've been getting errors on owfs for some time now, but after reading the doco and discovering the error stats, i thought i would look into it more.

$ grep -v " 0" /var/1wire/bus.0/interface/statistics/*error*
/var/1wire/bus.0/interface/statistics/errors:         359
/var/1wire/bus.0/interface/statistics/select_errors:         359

turning on debug on owfs with "--error_print 1 --error_level 5"

Then you get to see things like this:

Jan  6 14:00:37 ubuntu OWFS[32423]:   DEBUG: ow_select.c:BUS_select_subbranch(178) Selecting subbranch 1F 8F 67 05 00 00 00 B6
Jan  6 14:00:37 ubuntu OWFS[32423]:   DEBUG: ow_bus_data.c:BUS_send_data(38) Response doesn't match data sent

but this doesnt tell me what branch is at fault main/aux

So i edited the following file in the source code and recompiled

Wednesday 5 January 2011

WeatherSnoop to mySQL

I've placed the code for the script i wrote for a friend (g1gsw) on googlecode in case anyone else wants a copy.

It reads the WeatherSnoop (v2) XML and places it into a mySQL database.

https://code.google.com/p/weathersnoop-to-mysql/

1-wire, long runs and owfs

My 1-wire MicroLAN has a long run using BT cable (the stuff that comes into your house from the pole outside) it's not the most capable and CAT5 is better if you can use it, but mine runs through my flowerbeds into my greehouse, so it needed to be semi-amoured.

Long runs need slightly different 1-wire slew rates or you get lots of errors and devices drop off your LAN :(




Maxim Application Note 148 states:



Testing with long and short bus lines has shown that the optimum timings for all networks are as follows:

Pulldown Slew Rate: 1.37V/μs
Write One Low Time: 11μs
Data Sample Offset/Recovery: 10μs


So with owfs how do you do that with your Maxim USB dongle...?

Saturday 1 January 2011

RJ11 1-wire hubs

I have a number of 1-wire hubs.  I've made my own rather than buy them.