Cassini: The Grand Finale

“1:55 a.m. PDT

Cassini engineers have received the signal that Cassini has started a five-minute roll to point the instrument that will sample Saturn’s atmosphere (INMS) into the optimal direction, facing the direction of the oncoming gases. Along with this roll, the spacecraft is reconfiguring its systems for real-time data transmission at a rate of 27 kilobits per second (3.4 kilobytes per second). Final, real-time relay of data starts immediately after. That relay marks the beginning of Cassini’s final plunge.”

Not long now before Cassini plunges into Saturn. It’s sending data back as fast as it can, at a speed comparable to a modem used by many in the late nineties!

Absolutely amazing.

Check out the NASA live stream for commentary.

Move DNG files when the Android camera exits

Many Android phones can shoot RAW photos now but some of them will record a Jpeg file at the same time. This didn’t bother me until Google Photos started backing up DNG files, but it would back up the Jpeg files too so I ended up with duplicate images. I created a FolderSync shortcut to move the DNG files out of the DCIM/Camera/ directory but of course half the time I’d forget and duplicates would end up on Google.

I bought Tasker a few weeks ago when it was finally on sale, but only used it for one task, to auto rotate the Maps application, but then this morning I realised I could use it to fix up my DNG files!

So, here’s the task I created with much help from various forum threads, especially this one. I added it as an exit task for the Samsung Camera app which at least ensures I won’t need to remember to move files around any more. It would be handy to fire it every time a photo was taken but this is a good start.

Move DNG Files
A1: List Files [ Dir:DCIM/Camera Match:*.dng Include Hidden Files:Off Use Root:Off Sort Select:Alphabetic Variable:%Filestomove ]
A2: For [ Variable:%Files Items:%Filestomove() ]
A3: Move [ From:%Files To:dng Use Root:Off ]
A4: End For

I did try adding a flash notification if %Filestomove was set but it never worked and I don’t know why. If any Tasker experts want to chime in I’d love to hear how to get that working!

Crashplan Home RIP

With Crashplan Home on the way out I’m in a bind. I was using it to backup my Dad’s laptop to my machine. It was so very handy as it was plug-and-play. Fire up the app on his machine, type in the code and it started sending over his data whenever he was online, wherever he was. All that comes to a screeching halt in October 2018 when Crashplan drop their Home product.

I’m not sure what I’ll replace that with. I’m tempted to try Backuppc, and setup dynamic DNS on his router, but it’s a Windows machine, which is always a complicating factor. Maybe I’ll try that Backuppc Windows Client but all I need are a local ssh server and rsync, right? It might just be simpler in the long run to use Backblaze however. They even published a blog post to encourage Crashplan customers to migrate!

Besides using Crashplan for my Dad’s backup, I also used it to keep versioned copies of my photos directory on a separate external drive, but I zapped that and installed rsnapshot on my Macbook using Homebrew, and configured it to back up every few hours. It’s working fine so far too, and the simplicity of rsync and hard links is comforting. Sort of like Time Machine you can use Finder to navigate through the backups, and copy files from it to restore them. As an added bonus it’s not running in the background the whole time. A cronjob fires it up on a regular basis.

If that all sounds too technical, just use Backblaze. I’ve been with them for years, and recently renewed for another two years. If you want to get a month free (after signing up following the free trial) you could do worse than sign up using this signup link. I currently have over 2TB of data backed up there and it’s still going strong!

Edit: Over on /r/datahoarder there’s a lively discussion about Backblaze, including a rep from the company answering questions. Also, I’m not the only one looking for a replacement for PC to PC backup.
Edit 2: I wonder if Syncthing could be a replacement for PC to PC backup. The Backups aren’t encrypted unfortunately, but it has support for file versioning now which is a plus.

Eclipse 2017 in Ireland

A tiny portion of the August 21st solar eclipse will be visible from Ireland as seen in this NASA web app that shows you the track of the Moon’s shadow across the Earth.

It’ll probably be cloudy anyway but don’t look unless you have special glasses. I doubt most people will notice anything, it might get slightly dimmer around 8pm local time for a few minutes. Wait for the photos from the US to show up on social media. 🙂

Remapping the Keyboard on a new Macbook Pro

I must have an odd keyboard, at least for one that’s paired with a Mac. It’s a Microsoft split keyboard and has a bunch of extra keys that aren’t on a Macbook Pro keyboard, like a dedicated # key and the keys are all over the place compared to the laptop keyboard. But I like it that way.

I’ve heard comments from people who use my laptop and they are confused by how shift-2 doesn’t print @ but ” instead, and the key by the left shift prints \ instead of ~ (which is over by the Return key). They’ll say, “Oh, it’s some sort of PC keyboard?” Well, yeah.

This is not the first time I’ve had to fix my keyboard. A long time ago Justin Mason created a useful Irish Fixed Keyboard Layout, but for some reason with this latest hardware upgrade it wasn’t working exactly as planned. The #, \ and ` keys were mixed up. Luckily, with the help of the Key Codes app I could detect the the key code of the physical key pressed. For example, the key next to the left shift is key code 10 so it was just a matter of editing the keyboard layout in a text editor and changing that to output “\”. Logout and login to refresh and the key works!

What’s odd, is that this keyboard layout has served me well for almost a decade and didn’t need editing, which is why I’m documenting it in this post.

I looked at both Ukelele and Karabiner but the former looked overwhelming (yeah, then I went editing XML by hand..) and the latter doesn’t work in macOS Sierra (there’s a simplified “elements” version for Sierra). Then I thought I should just edit the keyboard mapping directly. 🙂

WP Super Cache 1.5.0

WP Super Cache is a fast full-page caching plugin for WordPress. Download it from your dashboard or get it here.

Version 1.5.0 has been in development for some time. It has a ton of bug fixes and new features.

REST API

The headline new feature is REST API access to the settings. This will allow developers to create their own interface to the settings of the plugin. Unfortunately it isn’t yet documented but you can see the code in the rest directory. Start with load.php where you’ll find the code that registers all the endpoints. Users who access the API must be logged in as admin users. If you want to test the API, see the end of this post.

Settings Page

We have also simplified the settings page to make it easier to choose which caching method is used.

Instead of maybe confusing the user with technical words like PHP, mod_rewrite and WP-Cache we have split them up into “Simple” and “Expert” delivery methods, and done away with mentioning WP-Cache completely. Simple delivery uses PHP, expert uses mod_rewrite and well, WP-Cache got the boot because it’s always active anyway.

WP-Cache caching is always active, but it can be disabled in different ways.

  • Disable caching for known users.
  • Don’t cache pages with GET parameters
  • Disable caching of feeds

Headers

We expanded the number of headers cached by the plugin. The list of headers was borrowed from Comet Cache. However, anonymous users will still only see the bare minimum like content-length or content-type. If you need to use security headers like “X-Frame-Options” or “Content-Security-Policy” you should enable caching of HTTP headers. This unfortunately disables super caching so only WP-Caching is used but it’s still very fast (and faster in this release than before which I will get to below). You can also use the “wpsc_known_headers” filter to modify the list of recognised headers.

WP-Cache Reorganisation

WP-Cache cache files are split into two files – one holds the page content, the other (meta file) holds information about the page such as cookies, headers and url. In the past these files were stored in two directories which could become a problem if there were many thousands of those files. Even with only a few hundred files, maintenance could be an issue as deleting related files (like page archives, or copies of the front page) needed every meta file to be inspected.
Now the files are stored in the supercache directory structure that mirrors your permalink structure. Deleting related files is is simpler and serving files will be faster as the operating system won’t need to open a directory of thousands of files.
If you currently rely on WP-Cache files, the plugin will still look for them where they are, but new WP-Cache files will be created in cache/supercache/example.com/ (where example.com is your hostname).

Sitemaps

We added support for caching sitemaps, but your sitemap plugin will need to cooperate to get it to work. The sitemap plugin needs to identify the sitemap request as a feed. Jetpack 5.1 now supports this since #7397. You can disable the caching by excluding feeds from caching.

Debugging Improved

The debug log is now protected by a username/password. For convenience, the username and password are the same but they are a long md5 string:

Deleting the log file clears it and resets it ready for more logging. Before, toggling debugging would create a new debug log and the old one would be kept around, but not linked, until deleted by garbage collection, and of course they were text files anyone could access.

This release includes lots of other small bug fixes and changes. Take a look at the number of closed PRs for an exhaustive list of those changes!

Testing the REST API

There are a number of ways to send POST requests to a web server but one I like is using curl in a shell script. You’ll need two bits of information from the website:

  1. The “wordpress_logged_in” cookie from your browser.
  2. The wp_rest nonce which you can get by adding `echo wp_create_nonce( ‘wp_rest’ );` somewhere on your site where you’re logged in. It’s good for 24 hours.

My test script looks something like this:
export NONCE='1234567890'
export COOKIE='wordpress_logged_in_xxxxxxxxxxxxxxxxxxxx=1234567890'
curl -v -X "GET" -H "Content-Type: application/json" -H "X-WP-Nonce: $NONCE" -H "Cache-Control: no-cache" -H "Cookie: wordpress_test_cookie=WP+Cookie+check; $COOKIE" \
-d '{}' "https://example.com/wp-json/wp-super-cache/v1/settings/"

Mindbomb – the beginning of Greenpeace

I’m going through my backlog of podcasts and this episode of Undone stood out. It’s about the beginnings of Greenpeace when a group of people in their twenties sailed a boat around the Pacific Ocean hoping to confront a fleet of Soviet whalers.

Near the end of their supplies they heard Russian voices on the radio and spotted the ships. The rest is history but the story is fascinating.

While looking up “Greenpeace mindbomb” I came across this article about a movie on Greenpeace called “How to Change the World” which covers the same subject. Here’s the trailer:

Unfortunately the podcast Undone was cancelled after one season but I’ve downloaded the rest of the episodes and look forward to listening to them!

Thank you Translators!

Well, well. WP Super Cache translations are coming along well. 100% of strings in the development version are translated into Canadian English and Romanian! (That might change over the next few days as I have a couple of UI changes in mind, sorry!)

Other languages like Persian, Japanese, Spanish, Russian and Italian are roaring along and sometimes only need a handful of words or sentences translated to hit that magic 100% too. The next version of the plugin will grab translations from WordPress.org if they’re available which is awesome for users around the world. We’re still shipping translation files but I think the release after that may ship without and rely entirely on the up-to-date online translations.

So, thank you so much to the translators. Code is nigh on useless if the user and developer don’t speak the same language and the interface is incomprehensible. WP Super Cache has lots of technical language which must be a pain to translate. Your work is invaluable!

Mulțumesc! متشکرم! ありがとうございました!¡Gracias! Спасибо! Grazie! Hvala ti! 谢谢!Vielen Dank!

Google Photos Overload

The Google blog announced that Google Photos will now allow you to share whole albums or just the photos of particular people with someone else.

I tried it this morning and it works, but there’s one big stumbling block. Too many photos.

When I take photos I’ll take 2 or 3 photos of the same scene sometimes, or if there are people in the photo I’ll take photo a few times just so everyone is looking at the camera. Or if kids are involved they’ll be looking every which way except at the camera.

So, what should really be one representative photo it’s really five or six images.

No. Using machine learning and image recognition is a huge step, but what a lot of non photographers want is a curated collection of “the best” photos.

I’m sure it’s only a matter of time before Google learns how to select from near identical photos to create this “best of” album. Their daily albums are a good indication that they can do this already.

The other problem with machine learning is that it might try too hard. This morning it suggested i share street photos I took a few weeks back. Unfortunately one of the suggested people was a former colleague who lives in Colorado and was not in Cork on the day. Another suggestion was my niece who also was not roaming the streets!

Anyway, I love Google Photos. The image recognition is amazing. I’ll search that for an image I need before diving into Lightroom 5 to edit it. 🙂