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 :)



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.




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?

 



The Death Throes of Dick Smith Electronics

, posted: 29-Dec-2011 00:15

Short random blog post...

Search dicksmith.co.nz for solder
Sigh.  Yes, Dick Smith doesn't sell solder any more.  

Strange to think that once upon a time Dick Smith Electronics actually bought out David Reid Electronics, another real electronics chain, and then promptly started down the dumbification process which they have now nearly completed.

Thank goodness for Jaycar etc.



Thunderbird 70-100% CPU idle in Ubuntu Oneiric 11.10

, posted: 19-Dec-2011 16:06

Dear People From The Future
Use gtk-theme-switch2 to change from Oxygen-Molecule to some other theme, Oxygen-Molecule caused me  massive CPU usage for Thunderbird and *some* other GTK software.  Oxygen-Molecule-Flat works fine.



So, I made the really stupid mistake of thinking that it was time that I could put off an update of Ubuntu no longer, and set about updating to 11.10.

Now, lets set aside the fact for the moment that once I saw (let alone tried to use) Unity I installed kubuntu-* and switched to KDE after many many years of being a Gnome user (much has been written by others on the rampant stupidity that is the Unity interface).

Anyway, after a lot of messing about, I'm now at a state that I'm happy with, EXCEPT, well, lets look at the screenshot and see if you see a problem [click for bigness] - the ever delightful Traylor Howard is not a problem...


Do you see it?  

That's right. Thunderbird is using massive amounts of CPU, matched or exceeded by Xorg (when Thunderbird is running).  Note that I have taken the screenshot with Thunderbird ONLY on the "select profile", WHAT ON EARTH IS IT DOING?!  

It gets worse if you actually select a profile (even a brand new EMPTY one); it will sit there eating 95-100% of CPU, it works, but when it's not doing anything, it is chewing CPU like a crazy thing.  

Luckily I have 4 cores, but having two of them being effectively run at 100% all the time is NOT conducive to multi tasking.  Not to mention the occasional "pauses" it causes, just locking everything for a second or two.

So far I have found two programs that cause this behaviour.  Thunderbird, and Unison.

Ideas anybody?!

Update 1 

Now for something really interesting, if I maximise the thunderbird window, CPU usage falls right away to normal (0-1%), if I un-maximise it, it shoots back to 100% again.  And it ONLY works if you use the maximize button in the window bar, if you just resize to cover the entire screen, it keeps the 100%, but click the maximize button and it falls to zero!

Update 2

Now that I know it is to do with maximized vs unmaximized windows, my Google search has produced some new fruit... http://robpetti.com/?p=100

U
pdate 3

Update 2 works.  The problem is isolated to the Oxygen-Molecule GTK theme which is supposed to match the KDE Oxygen theme.  The Oxygen-Molecule-Flat theme seems to work fine, as do other "normal" GTK themes.

Hurrah!




Coke Zero with Vanilla

, posted: 4-Nov-2011 15:42

A new Coke flavour just got released, or at least I just saw it today in P&S.  Coke Zero Vanilla.

Verdict: nice, but not as good as the old Diet Coke with Vanilla.  I miss Diet Coke with Vanilla.  Vanilla Zero is somehow, harder, not as "smooth" tasting as I remember DCwV.

C'mon Coke, bring back DCwV!
 



New Keyboard Hell

, posted: 30-Jun-2011 15:38

Gah.  My old wireless keyboard gave up the ghost yesterday (with some help from a cup of tea), so today I went and bought a new one.

My mistake, was that I bought a 2.4ghz wireless keyboard and mouse, which despite being the Warehouse "cyber" job is quite nice, unfortunately, it has the cursor keys, insert, home etc scrunched up vertically against the main keys.  

As a result every time I go to hit backspace I hit the Home key instead, then I find backspace but of course I've homed to the wrong place in the line by then and have to go find the end button... and hence forth my fingers get totally confused.  Who's brilliant idea was it to put home right next to backspace!

Damn, this is going to take a while to get used to.




Salvation, thy name is TestDisk!

, posted: 6-Jun-2011 12:08

Last night, my Ubuntu 10.10 workstation had a hissy fit for some reason and one of the USB drives wouldn't come online, unfortunately it was the 500GB USB (ext3) drive with all my MP3 files, backup stuff, torrents etc, fortunately this stuff isn't vitally important to my business, but it would have been a real bummer to have lost it.

To cut a long story short, involving chekcing logs, pulling hair, and googling I determined that at least the partition table was seriously destroyed on the drive somehow; I tried a few things, but I didn't have anywhere to put a full device dump so couldn't be too radical with experimentation with what I tried in case I made the problem worse.

Enter a tool that Google stumbled me upon, TestDisk , what a little ripper, in a few simple key-taps it had found the partition, and was letting me browse the files on it to ensure it was correct, confirmed, and it writes a fixed partition table.  

Thanks TestDisk, if I wasn't an atheist, you'd be giving god a good run for his money in the miracles department.

Now to e2fsck.



TV3 Mathematics Failure

, posted: 21-Sep-2010 18:24

In a story about Labour spinning the GST rise with dodgy figures, TV3 isn't doing much better, break out your calculator on the "National" numbers below, (the 189.34 is GST ex).

 



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.