Fixing the MailChimp API SSL certificate

Here’s a StackOverflow answer by me for anyone who sees this error:

SSL certificate problem: unable to get local issuer certificate

…when using the MailChimp API.

The problem is due to MC using a root certificate that’s been removed from the Mozilla certificate bundle (you’re most likely to see it on Debian systems.)

This is a safer way to work around the problem that rolling all your certificates back to 2014 or disabling SSL certificate verification entirely.  You also won’t need to set cURL options or edit your php.ini.

Also covered: how to ‘ping’ the MailChimp API to check it’s working.

How to upgrade Laravel Homestead to PHP7

I wrote this StackOverflow answer, explaining how you can safely backup  your work, destroy the old PHP 5.6 Vagrant box and download a brand new one that comes with PHP 7 as standard.

In my opinion this will be easier and cleaner for most people than trying to perform an in-place upgrade (the exception is where you’ve extensively customised PHP, MySQL or Nginx, in which case you need to backup the appropriate config files too.)

There are also some notes on the format of Homestead.yaml when you have more than one site, as the documentation on shared folders isn’t terribly clear.

PhpStorm troubleshooting – ideaVim stops working

IdeaVim is a popular plugin that adds vim shortcuts (e.g. hjkl navigation) to PhpStorm and similar products.

A rare bug Mac users may replicate one day: it’s possible to accidentally disable IdeaVim by pressing cmd-alt-V – the same shortcut as moving files in Finder.  PhpStorm does need to have focus; in my case I was typing the standard copy/paste/move shortcuts to transfer some files in the Project window.

You can see/toggle the Vim status with Tools > Vim Emulator (which won’t show up as a search result if you use shift-cmd-A and type ‘ideavim’).  It’s a handy shortcut to be aware of – temporarily turning Vim off may make it easier to complete certain refactoring tasks where you’re entering a new variable name.

IdeaVim’s settings are in vim_settings.xml in the WebIde100 folder (where the 100 at the end indicates version 10.0.*), in the event of a problem you can inspect or trash that file.

Patching servers for glibc (CVE-2015-7547) – remember to reboot!

This is a significant (though we’re not sure yet realistically how dangerous) buffer overflow bug in the Linux C library, glibc. The library handles system calls, for example, reading/writing to files.

The bug is with gethostbyname (used to find the DNS entry for a domain name).  Full explanation (Google)

Security updates have been available since 16 Feb 2016.

It’s easy to update but… remember to reboot afterwards! That’s the main reason I wrote this up – there’s a note to this effect in the security advisories, but utilities like aptitude won’t remind you. All sorts of services could be using glibc and remain vulnerable until they’ve restarted. Dan Kaminsky, at length, on how bad it could be

Much as it’s nice to accumulate a large uptime value, a forced reboot is also a useful opportunity to check the relevant services on your machine will come up after a power outage and, for example, your firewall settings are being loaded correctly.

Recommendation: check your existing version before you update, so you can verify it’s changed afterwards:

sudo aptitude show libc6 (Debian)
or execute the library itself, e.g.
/lib64/libc.so.6
(look for the line: Compiled on a Linux 2.6.32 system on [date])

How To:

Use your usual update procedure (e.g. apt-get update/upgrade on Debian/Ubuntu, yum update on CentOS/RedHat) then reboot the server.

Remember to do your VMs (e.g. Vagrant boxes) too.

Note packages are backported, so for Debian you pay attention to the uxx after the version number, not the version itself.

Does it affect Mac OS X?

No. (OS X doesn’t have glibc.)

Software Recommendations

For developers:

For everyone:

  • 1Password (password manager – works with all web browsers and iOS)
  • coconutBattery (detailed iPhone / Mac battery stats)
  • NVAlt (notetaking. Works with SimpleNote web service/iOS app)

Last updated Feb 2016.