Toshiba FlashAir quickly hacked togethor syncronisation script

, posted: 3-Feb-2014 21:23

The Toshiba FlashAir is one of those nifty wifi-enabled sdcards.  If you don't know what that is, well, it's an sdcard, which has a teeny tiny computer inside it complete with a wifi connection (isn't miniaturisation incredible), inserted into a camera it means you can connect to your camera wirelessly and download your pictures.

Anyway, it's a cool little device, and while (unfortunately) it doesn't expose an FTP or Samba server (all access is over HTTP), Toshiba does publish an API ( at https://flashair-developers.com/en/documents/ ).

Using this I cobbled together a quick hack of a synchronisation script (using PHP), it checks to see if the card is online (I put the card into AP Client mode and have my wifi router assign it a reserved IP address, so it's just a matter of pinging that IP, if it replies, it's online), if it is then it checks if any new images have been added and downloads them, and checks the download directory to see if any images were deleted and deletes them from the camera if so.

I take a lot of product photos and such for the electronics stuff I sell ( http://sparks.gogo.co.nz/ ) and it was always a real pain to take a photo, plug my camera in (which can't take photos when connected by USB), re-mount the camera as a drive, navigate to the photos, find the one I want, download it....  now, I can take a photo and bam it's there on my PC's local drive.

Should you want the code, it's here: https://github.com/sleemanj/FlashAirSync

No support, it is what it is, a real quick hack to get the job done.



Equivalent Parallel Resistor Network Finder Using Your Personal Stock List

, posted: 20-Jul-2013 03:49

There are plenty of resistor network finders out there, but I never came across one that worked off "just what I personally have to hand", they assume you have at least a full E24 or better set - if you are a cheap bugger like me, you don't keep a full set, just more common values in a few decades.

So anyway, long story short, I wrote my own equivalence finder that considers only those resistors you actually have, and figured somebody else might find it useful, so I put it on the interwebs -
Equivalent Parallel Resistor Network Finder Using Your Personal Stock List Of Resistors (it's a mouthful, but trying to be friendly to the future googlers here).

Caution, you should use Chrome for best results. Firefox works as long as firebug is disabled. No idea what IE will think of it all.

Scroll down the page to enter in the base values you have decades/partial decades of. Select the number of decades you usually keep. Enter in any holes in your decades. And any bumps outside of the decades. You can hit the "Save (sort of)" button and bookmark the result for next time.

Once you've described your resistor stock, you can search for a desired value (you can enter it in the usual various styles people use - 1.0, 3k7, 1.5M, 0R5, 0.5R, 762913 ... you get the idea), specify how much error you will tolerate, choose when the search should give you a less-precise but less-resistors solution, the maximum number of resistors per stack, and if there are no solutions within your error tolerance you can select a Last Resort option to look for a solution of two parallel stacks in series.

NB: The first time you hit Search it builds an array the possible stacks, so that can take a few seconds depending on the Maximum Stack setting.

Anyway, there you go, hope somebody else finds it useful :)



Live by the sword

, posted: 22-Feb-2013 13:36

So this story caught my attention.

Short version, employee went to a party that her boss wasn't invited to, boss fires employee accusing her falsely of being a Nazi sympathiser and promoting Nazi ideals in the business.

So at first glance you'd think that's pretty appalling.

Then we read what the employee's job was...

Nelson said one of her main tasks at work was to create false blogs using search terms that would trick Google's search engine, bringing the company's website to prominence on the Google search page.
[...]
After several failed meetings, Nelson was suspended for setting up a "Nazi sympathising email address", which included "hitlerhatesbabies", and using the password ilovehitler.
[...]
Nelson said because it was her job to create several email addresses, and because more conventional addresses had been taken, she had to think of unusual word sequences to come up with a unique one.


My sympathy, it disappeared.  If you choose to do a job which is at it's core a fraud, you need to accept that the people you are working for are scum.  Live by the sword, die by the sword.



Permalink to Live by the sword | Add a comment (3 comments) | Main Index


Diabetics - Deadline For Strips On Repeat - 1 March

, posted: 14-Feb-2013 16:02

Long time no blog, just a quick notice for my fellow Diabetics.

If you have test strips (that are to lose their funding) on repeat, you must pick up those repeats before the 1st of March.

If you don't, the repeat will not be valid from the 1st of March, thanks to Pharmac.

So, make sure you go into your chemists next week to pickup any test strips you have on repeat, just tell them you had to do a lot more testing, or going on holiday, or something like that to put in the computer as to why you are picking up early, you won't be the only one for sure.

Please pass the message on to any Diabetics you know.

My local pharmacist has said that the whole thing is a complete shambles, he has people coming in with scripts for 10 boxes at a time when normally they'd collect 2 a month, has no idea how many he should order in advance.  So don't leave it to the last minute.

Eventually of course, you're going to have to switch to the new meters.  And when you do.  Please take care that you still have enough of the old strips so you can do a series of comparisons, people are reporting that the new meters are hopelessly over-reading, 2 units is typical, some are reporting up to 5.  Apparently CareSens reps have even said to be aware of it.

Sounds like if your new CareSens meter tells you you are at 4.0, well you should probably treat for a rather serious 2.0 hypo, if you're still managing to stay upright.

Who knows how Pharmac thinks this is appropriate for medical equipment?



3 News: What is your personal imcome...

, posted: 13-Sep-2012 17:37

3 News is running an survey on their website, this question is interesting, strikes me as rather weighted towards the upper classes.  That, or maybe I'm just horribly abused, overworked and underpaid by my boss (being self employed) and everybody else in the country is far better off than I.  Actually.  That's entirely possible.





Stuff: "Beside Vigil"

, posted: 23-Aug-2012 18:17

Seriously now Stuff, did your proof reader take the day off?  On the homepage, in big letters, embedded in an image no less.


Permalink to Stuff: "Beside Vigil" | Add a comment (4 comments) | Main Index


Misleading CGA Statement by Surpulstronics

, posted: 9-Aug-2012 23:17

Update: Rowan from Surplustronics has contacted me out-of-band to say that the statement on their website to which this blog post refers comes directly from his suppliers.  I have invited Rowan to comment publically here.  As it stands, the statement is still on his website.

So, idly looking at the Surplustronics (http://www.surplustronics.co.nz/) website and I stumbled upon this gem in the product details for a mains-direct soldering iron.

http://www.surplustronics.co.nz/shop/product-TT0042.html

Under the heading "Note For Public buyers:"

"Firstly you need to know that if these are returned with a faulty element, then there is No Warranty. The elements are a Non-warrantable product and therefor, refunds / repairs or swaps will NOT be given."

Well I'm sorry Surplustronics but that statement right there, that's absolutely 100% against the law, on two fronts.

Firstly, under the Consumer Guarantees Act, you don't get to choose what you do and what you don't guarantee as to the quality and fit-for-purpose of your product.  That statement reads that if you buy the item, take it home, and find it has a faulty element that Surplustronics is going to tell you to take a hike!

Secondly, under the Fair Trading Act, you are blatantly misleading the consumer on their rights, you are telling them effectively that if the element is faulty (within a reasonable life time of the product) they don't have the right to return it for repair, replace or refund.  The CGA gives them that right, and you are (attempting) to mislead the public with regard that right!

Not on Surplustronics, not on at all.  You should know better than this sort of nonsense.




Uses for a shattered LCD monitor.

, posted: 21-Jul-2012 01:55

I write this looking at my old faithful 17" CRT which has been stored in the shed since I went LCD about 5 years ago, reason being my 22" Viewsonic took a little trip off the back of my desk to see the corner of a toolbox sitting on the floor. 

Unfortunately the LCD is, to put it politely, a rainbow full of stuffed.  However apart from that it is fine, backlights still good, driver circuitry, power supply etc all still good.  

I guess I could look out for another Viewsonic 2235WM with a good LCD but some other fault and make a good one out of the two, but with LCD's so cheap these days it hardly seems worth it, or particularly likely.

Can anybody think of something more interesting I could use the remains for.



Stripping Signature Images from IMAP

, posted: 21-Mar-2012 11:28

Dear world, could all you people who just LOVE putting loads of embedded inline images in your email signature, or using "cool" "email stationary", please just stop it.  

It:
  1. takes up space, especially when you email me like 20 times a day, and we inevitably end up with reply stacked on reply because I forget to delete your signature so that replies are containing many copies of the inline images
  2. causes problems for email clients like my Thunderbird which quite often gets stuck trying to re-attach your inline signature images when I reply
  3. is just a complete and utter waste of time, nobody reads those damn things, even if they do, they don't need to read them EVERY SINGLE TIME YOU SEND THEM AN EMAIL

Alternatively, has anybody got a good solution for Thunderbird, or IMAP in general, that can be used to strip only signature images (perhaps by determining common occurrences of images across emails or something) from messages automatically?

 



Pharmac puts boot into Diabetics... again.

, posted: 28-Feb-2012 10:39

As many will know, I am a Type 1 Diabetic.  

That means in simple terms through no fault of my own when I was in my late teens my insulin producing cells of my pancreas decided to go out of business.

I produce no insulin of my own, I take insulin every time I consume anything containing carbohydrate, and must test my blood glucose level every few hours in order to maintain a good level of control to try and minimise both the short and long term problems associated with fluctuating glucose levels (potentially resulting in death at both ends of the scale).  A functioning human body can control it's glucose with very good precision, in contrast a Type 1 Diabetic is trying to hammer in a carpet tack with a sledge hammer, it works, but inevitably you get it wrong, a lot.

To have any chance of getting it more right than wrong, I use a Blood Glucose Meter, these devices use single-use "strips" which are inserted into the meter, then a drop of blood is added to the strip, and (through an electro-chemical reaction taking a few seconds) this is interpreted by the meter to display the amount of glucose in my blood.

Naturally, these strips are not really cheap (somewhere around a buck a strip, multiple that by 6 to 10 strips a day, 7 days a week, 365 days a year, for the rest of your life...), but of course Pharmac subsidises these vital necessities of a long and healthy life, as it should, in a socialised medical system such as ours (there is a lot more that Pharmac could and should fund for we long suffering Type 1 Diabetics, but let's not get into that).

Originally I had an original "Glucocard", a truly venerable device (if slow), it was the benchmark nearly 20 years ago.

Then some years later I purchased a "Glucodisc" which was a real upgrade, the strips being contained within the device (on a rotating foil card holding 5 strips, or was it 10) meant one less thing to carry, it had test memory and produced averages on the fly.  

But Pharmac in their wisdom, a number of years ago decided that the Glucodisc test strips would no longer be funded, this made the Glucodisc worthless, as paying sticker-price for strips was simply not economically viable.  So I was forced to choose from the range of funded meters, of course there was a range, as you'd expect, different people have different needs, right?  

I chose the Optium Xceed, and despite my misgivings with it not having self-contained-test-strips, it has proven a good meter, it stores 450 results, produces 3 different averages (although not the A/B averages that I remember the Glucodisc could, to tell you what was happening at different times of day), it is very small and pocketable (almost walletable) and while not self-contained, the strips are individually sterile foil-wrapped (on a perforated sheet of 5) like the old glucocard, so are still fairly convenient to slip in your pocket/wallet.

Fast forward a few years, I'm on my second Xceed now, the first having finally bitten the dust through being sat on, walked on, slept on, and generally abused.  I'm still happy with it, in fact I was thinking about getting a third one soon since my current one is looking a bit raggedy now too.

But today, I read this:

http://www.stuff.co.nz/national/health/6489930/Pharmac-money-saving-plans-alarm-diabetics


Pharmac are doing it again.  Withdrawing funding for my meter's strips.  Not just my meter in fact.  Virtually every single diabetic in New Zealand!

Their brilliant plan is to give a monopoly on supply of test strips to one manufacturer and their own meters, "CareSens".

A quick look at the CareSens meters (pretty much unknowns!) shows without much investigation that they are NOT AS GOOD AS THE EXCEED and probably not as good as many of the other meters that we currently can use under subsidy.

If you want the one that stores 250 results, then it's physically MASSIVE.  My tiny Xceed stores 450 results.

If you want one that's smallish (but nothing like the Xceed), it only stores 10 results!  That wouldn't even give me a day of results sometimes, let alone a useful average!  What's the point of it, 10 results, what?!  How is that even useful to anybody.  TEN RESULTS?!

The strips seem to come in a plastic (like photographic film type) canister rather than be individually wrapped.

I don't want to carry a bulky canister with me everywhere I go! My Xceed strips are foil wrapped, I can take 1, or 2 or 5 in their foil wrap with me slipped in my wallet without any problem of contamination.

Even with the larger meter, you only get a 14 day average 

My Xceed can display averages of 7, 14 and 30 days.

So pretty much Pharmac is throwing out any notion of choice, we are going to get what we are given, and what we are about to be given is a glucose meter which is vastly inferior in comparison to many of those which we ALREADY OWN AND USE.





sleemanj's profile

James Sleeman
Christchurch
New Zealand


PHP Programmer Extraordinaire

All views expressed are held by the poster, not necessarily any person or organisation associated therewith.