Following in Darwin’s Chilean Footsteps

Today we were hiking in Chile’s Parque Nacional La Campana. Charles Darwin hiked up the Cerro La Campana mountain in 1834, and from the top you can see the Andes on one side and the Pacific Ocean on the other. While we followed in Darwin’s footsteps up the mountain, it was sadly an overcast day and views were limited. 

The Sendero El Andinista trail we took was well marked but it was a steep climb from car park at 400m to the peak at 1920m and the footing quite rough at times. With the cloud closing in and the peak hidden behind a cloud we decided to not exhaust ourselves and turned back after a tasty picnic lunch at 1270m—the last 650m of elevation was to be covered in just 2km of trail and the guide book had warned us this part was particularly difficult. While it was sad not to be able to see the full extent of the views, being overcast did keep the temperature pleasant and it was a pretty walk. As an added bonus we also had the trail to ourselves, seeing just one other group who appeared from nowhere at lunch and headed past us for the summit. 

     
IMG_1273-0.JPG

OS X Notes.app and IMAP Accounts

On a fresh install of OS X Yosemite, the notes.app was unable to see the notes stored on my IMAP server. The account was working properly in Mail, and notes.app worked fine with other accounts.

I recall having this same problem with a previous version of OS X, and that it was related to the “IMAP Path Prefix” advanced setting within the Internet Accounts system preference panel. The prefix is set correctly so I was about to give up on this as being an annoying–but–ignorable bug when the very last post in this forum discussion indicated that a cargo-cultish approach of changing the prefix, opening and closing notes, then reverting the setting had fixed it. I can confirm that this solution also worked for me. I kept Mail.app closed for the duration to prevent it being confused, and observed that simply unsetting the value is insufficient, it must temporarily be set to another value, such as “none”, to work.

Which email addresses receive spam?

One of the advantages of owning a domain name is the ability to create a limitless number of email aliases. I use this to allocate each company that requests an email address a unique one, which makes it a lot easier to spot phishing emails, and track whether a company has used it according to my expectations. A recent browse through my spam email folder showed some egregiously bad spam (obvious frauds, scams, etc) being sent to aliases assigned to companies.

  • Vision Express
  • Tumblr (the micro-blogging platform)
  • JET Photographic, Cambridge
  • Adobe — suffered a well publicised data theft
  • LinkedIn — likely someone with whom I am connected since they would then see this email and could import it into their personal address book
  • Dropbox — dropbox includes this email address when I share files and links with others via its service so again the leakage is probably from a third party

Another surprising result of my browse is that the email address I publish on this website does not get very much automated spam, although it does get the occasional offer of “sponsored posts”.

Resolving mixed content errors with WordPress

This blog has in theory been available via a secure (“https“) connection for about 2 years. I say “in theory” because some of the images were being loaded from insecure connections which meant there still ways to easily circumvent that security. After some digging it seems this is a long-standing known problem with the WordPress software that runs this blog, and despite some recent activity, still not fixed in last week’s 4.0 release.

Fortunately the discussion in the bug report does provide a one-line workaround. There was no advice on where to put that one liner, so I decided to write a plugin as it would then be easy to toggle on and off if required.

<?php
/**
 * @package fix_ssl_attachment_url
 * @version 1.0
 */
/*
Plugin Name: Fix SSL Attachment URL
Plugin URI: https://core.trac.wordpress.org/ticket/15928
Description: Hacky fix for wp_get_attachment_url function not checking for https. 
Taken from the bug report referenced above.
Version: 1.0
Author URI: http://www.toobusyto.org.uk
*/

add_filter( 'wp_get_attachment_url', 'set_url_scheme' );
?>

The next challenge was that the instapress plugin I had been using to display my Instagram photographs in the side bar was also using insecure content. It seems that instapress is no longer supported, and although worked for me, might not continue to work for much longer so I upgraded to Simple Instagram. This was a straightforward drop-in replacement (once I had successfully made an Instagram developer account) but displayed three Instagrams per row which I found a bit small. The author appears to be very active and helpful on the forums, providing these hints on how to customise it, but initially I could not get this to work for me when I put the settings in my custom theme’s style.css. The problem is that the first CSS class is now .si_feed_list and I found I needed to mark the customisation as !important in order to override the default.

/* For use with the Simple Instagram plugin */
.si_feed_list .si_item {
  width: 50% !important;
}

Finally I had to disable the Simple Facebook Connect plugin. Like instapress, this was reported as being broken and discontinued by the author.

Photographs from Kuala Lumpur and Langkawi

Photographs from our short trip to Malaysia last year. Kuala Lumpur was busy and fun but also had a lovely lake garden and excellent Islamic Art Centre. Langkawi was very beautiful with lots of nature to relax and enjoy.

You can also view this gallery on flickr.

Managing cron.d with chef

I have recently been playing with the chef configuration management system. I was looking for a way to manage files in a directory such that any that were created by chef would be cleaned up again when they were no longer needed. A classic use case is the /etc/cron.d directory which may be populated by files from multiple sources. There appeared to be no established pattern for this but since chef allows the use of ruby in its recipes, I was able to construct the following. It assumes the use of the cron cookbook.

cron_d 'usercron.chef' do
  minute 0
  hour 23
  command '/bin/true'
  user 'myuser'
end

Dir.glob("/etc/cron.d/*.chef") do |f|
  name = f.split('/')[-1]
  begin
    t = resources("cron_d[#{name}]")
  rescue Chef::Exceptions::ResourceNotFound
    cron_d name do
      action :delete
    end
  end
end

OS X Terminal.app, bash and UK Keyboards

On an Apple UK keyboard, the # symbol is accessed by pressing ⌥-3 (pronounced option 3). Unfortunately the terminal application is only useable when option has been mapped to the UNIX meta-key, which takes precedence over “special” characters such as #. Thanks to this tumblr post, it is possible to work around this problem:

$ cat .inputrc
"\e3": "#"

Unfortunately .inputrc is a bash-specific configuration file and this does not solve the problem for terminal-based applications.

Google Maps and iOS Background App Refresh

I am posting this to the web in case it helps anyone else trying to troubleshoot a similar problem.

Recently I noticed my iPhone’s battery was ending each day significantly lower than usual, causing me to have to charge it every night instead of every couple of days. At first I suspected the extra consumption was caused by communicating to my Pebble smart watch but quickly eliminated that possibility when turning the Pebble off for a day had no effect.

After some experimentation, the change that restored my battery usage to its previous norm was disabling background apps refresh for Google Maps. This was an application I had recently installed because it works very, very, nicely with the Pebble, sending turn-by-turn navigation directions to your wrist as you walk. This completely removes the need to take the phone out of its pocket every few minutes to double check that the road you just passed was not the one you were supposed to turn down! However I do not use it frequently enough to justify doubling my daily power consumption…

Final photographs from Japan

A final collection of photographs from our trip to Japan. We are positioned ourselves on the right side of the train to see Mount Fuji for our trip from Osaka to Tokyo but sadly it was too cloudy. I have included some photographs of the view from the train window because I think it gives a nice impression of what you see when travelling on the Shinkansen. I also managed to get one photo of Mount Fuji from the plane window as we took off for London. Would love to go back one day.