Labels

3G (1) 8600GT (1) AI (4) amazon (1) API (1) apple (3) apple mail (1) atlassian (1) bambo (1) Bamboo (1) bloat (1) boost (1) bugbear (1) C++ (5) calling conventions (1) cdecl (1) chromecast (1) CI (1) compiler (1) continuous integration (1) coursera (1) custom domain (1) debugging (1) deltanine (1) diagnosis (1) diy (5) DLL (1) dns (1) don't be evil (1) ec2 (1) education (1) electronics (1) express checkout (1) fail (6) fink (1) free hosting (1) GAE (1) google (1) Google App Engine (4) hackintosh (1) Haskell (3) homebrew (2) icloud (2) iOS 9 (1) ipad2 (2) jobhunting (1) lag (1) letsencrypt (2) libjpeg (1) linux (1) mac (2) mbcs (1) mechanic (1) memory (1) MFC (3) Microsoft (1) migration (1) ML (1) mobile (1) movi (1) MSBuild (1) music (1) naked domain (1) NLP (2) o2 sensor (1) obd (1) Optiplex960 (1) osx (1) outlook express (1) payments (1) paypal (1) photos (2) PIL (1) Project Euler (1) python (2) raspberrypi (3) renwal (1) soundcloud (1) ssl (2) stdcall (1) stripe (1) subaru (2) supermemo (1) supermemo anki java (1) sync (2) Telstra (1) tests (1) thunderbird (1) udacity (1) unicode (1) Uniform Cost Search (1) university (1) upgrade (2) vodafail (1) vodafone (1) VS2010 (1) vs2013 (1) VS6.0 (1) weather (1) win (1) Win32 (1)

Monday, 29 August 2016

Google Chromecast Video does not work without an internet connection even for locally hosted video!

Google's motto is "Don't be evil". I guess they don't think that spying on every thing you do is evil.
That's the only reason I can see why your Chromecast video needs an internet connection to function, even if all you wan't to do is cast videos stored locally on your laptop to your TV.

I recently picked up a Chromecast Video in preparation for a a weeks snow holiday at Thredbo, thinking it would be handy so the kids could watch some of their own videos on the TV in the chalet. The chalet came with WiFi internet, but the cheapskate owner must have purchased the cheapest possible internet plan with the lowest quota, because even though all the right lights on the router were lit, there was no internet access.

This caused big problems trying to setup my new Chromecast, which needs to download some updates when it is first configured. I can understand why it would need internet access for that.

But once it is setup it refuses to work without an internet connection. The only reason I can see it might need an internet connection is so that it can spy on you and report your viewing habits back to google.

I managed to get it working by creating as hotspot on my iphone, having the chromecast use that hotspot for internet access and use my laptop to connect to the chromecasts WiFi to configure it.

But that's way more complicated than it needs to be. It really should be written on the box in big letters:

REQUIRES INTERNET ACCESS!


Tuesday, 26 July 2016

Letsencrypt certificate renewal process is awful!

So, my free 90 days letsencrypt certificate is about to expire.

I tried the auto-renew feature, but it does not work in manual mode. They intend it to be run automated and unattended, but I can't do that because I want to use the certificate on google app engine.

So basically, you have to re-issue the certicate , which means updating the challenge response on your website.

Well, I did all that, and generated a new certificate.

Unfortunately it expires the same time as the certificate I want to replace... WTF?

Anyway, I cleaned out /etc/letsencrypt and tried again from scratch:



sudo ./letsencrypt-auto certonly -a manual --rsa-key-size 2048 --email webmaster@mydomain.org.au -d shop.rhubarbfood.org.au

and this time it generated me a certificate with the correct expiry date. For future reference,

fullchain.pem is the public cert that appengine wants.

The private key needs to be fixed for google app engine:

openssl rsa -inform pem \
  -in /etc/letsencrypt/live/mydomain.org.au/privkey.pem \
  -outform pem 

the output of this command can be pasted straight into the text box in the appengine certificate page.

This time I documented it so I can rmember in 90 days time when I need to renew it again!

Monday, 2 May 2016

Let's Encrypt and Google App Engine... not a match in heaven

I recently got on the SSL bandwagon for a site I manage, and bought an SSL certificate from GoDaddy for less than $10 (I can't remember exactly), but it only lasted a year.

True to form, when time came up for renewal GoDaddy wanted to charge me $100.

Top Tip: Never, ever allow GoDaddy to autorenew anything you buy from them. Because they alway jack the price up when they autorenew by default.

Anyway, I heard about LetsEncrypt, the new CA which offers SSL certificates for free.

"This must be too good to be true", I thought. And once again, I was proved right.

After much yak-shaving, (installing the prerequisites on my mac, the letsencrypt software, and the appropriate challenge/responses to prove I owned the web servers) I actually managed to sucessfully generate my certificate...

...which expires in 90 days!?!

Now the people at letsencrypt think that 90 days is a really, really long time, and any longer would be a security risk. And they say, "Hey, you should automate all your certificate issuance/renewal/web hosting malarky".

The only problem is, THERE IS NO API TO AUTOMATE UPLOADING OF YOUR CERTIFICATE TO GOOGLE APP ENGINE!!!

So, every 90 days, you will have to do it manually.

And one more thing... when I tried to upload my 4096 bit key certificate, app engine complained with an extremely generic error message. Turns out it only supports a maximum of 2048 bit keys.

Way to be cutting edge Google!


Wednesday, 25 November 2015

How to move your amazon instance to another account

Did you know amazon offer 1 years free EC2 hosting on a t2.micro instance when you create an account?

Free hosting for a year! But, what happens when the year is up? Hmmm, I wonder....

You might wan't to migrate the instance to another account.

How?

1) Create an AMI image of your instance
2) Add the account id of the new account to the permissions on the instance
3) Now you can see the AMI image in the new account and deploy it.
4) Create an elastic IP address and associate it with your new instance
5) You may also need to update the DNS records to point to your new elastic IP.

Voila! Another years free hosting!

Sunday, 11 October 2015

Do not install IOS9 on your iPad 2!!!

So, Apple released IOS9 with a bunch of PR hoopla about how well it was optimised for older devices.

So, I installed it thinking, well my iPad 2 is running okay, and Apple promises the new version will not make it any worse, so what the hey, lets install IOS9.

What I forgot was that I never installed IOS8 because I heard it was a dog. Now I have IOS9, and my iPad has massive, massive lag!

The onscreen keyboard has a few seconds lag before the letters appear, scrolling through the apps is glacially slow, the whole thing is sluggish- basically it is a terrible UX.

And would you believe it is impossible to downgrade any lower than IOS 8.4.

I can't believe that QA at Apple signed off on IOS9 for iPad 2 because the experience sucks.

If I was cynical, I might think this was a deliberate strategy to make perfectly usable devices useless and push people to upgrade.

So DO NOT UPGRADE TO IOS 9!


Monday, 28 September 2015

No wonder PayPal is having it's lunch eaten by Stripe...

I am currently trying to integrate paypal express checkout with an organic fruit and vegetable online shop that I manage the website for.

Wow! What a flakey experience, I can only hope that the PayPal production site is more stable than its sandbox!

First up, when I tried to create test accounts in the sandbox I kept getting mysterious "system errors". Only after much googling I discovered that this mysterious system error means that the password for the test account does not meet the password complexity rules... (hint: Password1! meets the criteria).

Then there are the random, intemittent failures when I call the express checkout apis.

And now, I find that paypal gives me an nginx 404 error when I try to launch the integrated express checkout page: https://www.sandbox.paypal.com/checkoutnow?token=blah. After a while it comes good...

This just smells of a half baked test sandbox environment. No wonder upstarts like Braintree (now bought by PayPal) and Stripe are eating paypals lunch in the payments market.

In fact, I was thinking of using Braintree integration, but there signup process was a bit onerous, asking me questions about our shops delivery and returns policy (we don't have one - people pick up their groceries each week), privacy policy, etc.

Anyway, PayPal needs to step up its game as far as developers are concerned... when you have so many issues in its test environment you have to wonder how stable the production environment is.




Tuesday, 8 September 2015

My iCloud photos library finally synced sucessfully - no thanks to Apple!

In my previous post I mentioned how iCloud photos sync killed my MacBook. It was stuck on 90 Gb of my 180 Gb for 3 months, and when I fixed the issue it did the remaining 90 Gigs in about 10 days (on optus cable 1.5 Mbs upload speed).

Basically, my problem was that a couple of photos and videos in my library were corrupted, and iCloud photo sync is rubbish and keeps getting stuck on the corrupted files, instead of just skipping them (like rsync would). But you would never know this as it doesn't give any meaningful feedback on how the sync is progressing.

I first observed the issue using the system activity montor and seeing what files and handles the cloudd process had open. I could see it repeatedly looping over the same set of photos, over and over again. When I tried opening each of these photos in the finder, one of them caused preview to crash. I deleted this file and the sync got as little bit further before gettign stuck again.

I then tried repairing my Photos libaray by holding command + option while launching Photos.

http://osxdaily.com/2015/05/21/repair-photos-library-photos-app-mac-os-x/

This obviously did something as it managed to upload a few more gigs after that before getting stuck again.
Then my macbook died due to the stress of running icloud photo sync for 3 ½ months, so I took out the HDD and plugged it into my spare windows box and installed mac os 10.10 in VMWare to continue the sync, but after a while I would get a file IO eror and VM ware would crash.

I thought it might have been a problem with the physical disk, so I ran Disk Utility, and lo and behold it found a few errors and repaired them, but VM ware would still crash after a while when accessing my photos library. I then decided to copy my photos library to a virtual disk file and see if I had any more luck.

When using the finder to drag and drop the photos library to the virtual disk file, it would copy 90 Gigs (suspiciously close to the size of the library it has managed to upload before getting stuckl) and then crash.
I then began to suspect it was a problem with my photos library, so I went to the terminal and used cp -R -v to copy my photos library. After copying 90 gigs, it failed again, but this time I could see which file inside my library caused it to fail. I tried opening the photo in the finder, but it just caused the finder to hang, so I deleted the photo, which happened to be from the same event as the corrupt photo I deleted previously, and tried to copy it again, this time using rsync -v -a instead.

rsync is much more robust, and instead of failing it skips the files then tells you at the end which files failed- the iCloud developers could learn a thing or two from rsync! In this case, it was a photo and a video, both from the same event as the previous photos I had deleted. I deleted these files and ran rsync again, and it finished super quickly as it had managed to sync all of the files in the previous run.

I set . my newly copied photos library as my system photos library, and then tuned iCloud sync back on which continued to upload with no further dramas. It may have helped that the VM was running on a quad core Q6600 processor, and not a core 2 Duo laptop becuase the icloud photo sync uses your computers CPU to convert all your photos and videos to lower resolutions, which was the cause of the thermal stress which killed my trusty 2008 MacBook Pro.

TL;DR
If you are having trouble syncing your photos library to icloud, try repairing your photos library by holding down command + option when launching Photos. If that doesn't work, try copying your photos library using rysnc to see if there are any corrupt files which could be causing the problem and delete them. It also doesn't hurt to use a computer with a lot of grunt and Apple makes it work really hard converting all your photos and videos to lower resolutions.

Good luck!