Thursday, July 30, 2015

Linux on Apple - success

A while back, I wrote I'd given up on trying to get Linux to run natively on my Macbook Pro Retina. The killer problem was that it didn't work reliably with my Apple Thunderbolt Display

Well, since then I sold my Apple display and bought a 25-inch Dell Ultrasharp, which is a great replacement without the Apple vendor lock-in.  So, I tried Ubuntu again (15.04) on dual-boot, following the same instructions as before, more or less. Everything's been fine. I've been using Ubuntu as my day-to-day OS for a couple of weeks now, and slowly transferring files across.

Lookin' good so far. And, more to the point, FLOSS (Free Libre Open Source Software).

Monday, February 23, 2015

Linux on Apple - Fail

Over the last month or two, I've been playing around with using Linux as my day-to-day operating system - on a Macbook Pro. This morning, I came to the decision that this is not going to work - Apple hardware is not the well supported, even within Ubuntu. When it comes time to replace my current Apple hardware, I'll look at the issue again.

Sunday, February 22, 2015

Moving to Zotero (from Mendeley)

Mendeley is proprietary, closed-source software. It also requires the user to store citation data on its servers, and was bought by Elsevier back in 2013. In contrast, Zotero provides similar functionality, and is free and open-source (GNU Affero licence).

Although Zotero can be operated as a standalone application, it works best as a Firefox plug-in. It seems to be a pretty good system, but importing from Mendeley, particularly if you want to keep your PDFs attached, is tricky. Here's how to do it:
  1. Make sure you have installed both the Zotero and the ZotFile plugins to Firefox. 
  2. Under Zotero configuration (the 'cog' menu), search tab, make sure PDF Indexing software has been installed.
  3. Export all references from Mendeley using .bib format. 
  4. Move your .bib file into the same directory as the attached PDFs.
  5. Use search and replace to change the file links in the bib file (see example below).
  6. Don't try to import more than about 500 references at a time. If necessary, split the file made in step 3 into multiple parts, and import one at a time.
  7. Use the import function in zotero (under the "+" menu).
  8. If you have standard options set in Zotero and ZotFile, the PDFs will have been sensibly renamed and copied into the zotero directory which is inside your Firefox profile). So, presuming you have a backup, you should delete the directory from which you imported the PDFs.

Changing file attribute
Basically, you need to remove the path, and just leave the filename. You also need to remove the ":pdf" ending. So, from this:

file = {:Users/andywills/Documents/Research/0 - Paper archive/Abeles-M0-1995-001.pdf:pdf}

to this:

file = {Abeles-M0-1995-001.pdf}

Sunday, February 15, 2015

Ubuntu 14.10 on Macbook Pro Retina

After playing around with Fedora 21 a bit, and having some problem with the Macbook running slightly hot, I decided to try Ubuntu 14.10, as there are a lot more users and hence more useful web pages for a newbie.

Installation was pretty straight forward:
  1. Follow the guide provided for Ubuntu.
  2. Under the guide's step 2.3, the bluetooth thing didn't work for me with an iPhone 4. Easier just to connect a Thunderbolt Ethernet adaptor (at boot time), and load WiFi drivers over a wired connection.
  3. Under Step 2.1, I found a scale factor of 1.5 to be better.
  4. Under Step 2.5, note that the --calibrate function causes the screen to blank repeatedly, and takes several minutes. This is normal, just let it run through and finish.
  5. Under Step 2.6, I found the trackpad worked fine without doing any of this.
  6. After installation GRUB does not show OS X as a boot option, despite following the instructions in the guide. I found this worked (adapted from this askubuntu post):
menuentry "OS X" {
   insmod hfsplus
   set root='(hd1,gpt2)'
   chainloader /System/Library/CoreServices/boot.efi
Cooling fan - The machine runs a little hot, so I installed macfanctld and set minimum fan speed to 2500, temp_avg_floor to 40 and temp_avg_ceiling to 45.

WiFi after suspend doesn't returned, fixed using this code.

Apple Thunderbolt Display - This was a bit tricky, because Ubuntu 14.10 uses Linux kernel 3.16, which does not support Thunderbolt, whilst the Macbook Pro Retina wireless card needs the bcmwl-kernel-source code, which expects a 3.16 kernel.  So:
  1. Update kernel to 3.18, following the instructions here.
  2. Manually install the 3.18-compatible wireless drivers, following instructions here, which are for 3.17, but seem to work fine.
After this, all was great, with even my Focusrite ADDAC working fine.
Apple wireless keyboard and trackpad - Although the bluetooth setup menu bar (top right) is a little flakey under Ubuntu, it does work and (unlike Fedora 21) it reconnects at logon as long as you turn them on. The keyboard doesn't work with the GRUB boot menu, so I set the timeout for the default on GRUB to 2s to speed up boot times.

  1. LaTeX: TeXStudio looks great, much better than OS X TeXShop. 
  2. R: works fine, using the install instructions on CRAN. RStudio also works.
  3. Libre Office: Already installed and fine for occasional GUI office work.
  4. Firefox: Already installed, and works fine. 
  5. iTunes replacement: RhythmBox is pre-installed and looks good.


Friday, February 13, 2015

BT Homehub 5 restricts your freedom

As Richard Stallman puts it, you have a choice - either the user controls the software, or the software controls the user. The router BT provides with its Infinity broadband package is a pretty striking case of the latter. As BT state on their help pages, the router automatically downloads firmware updates without the user's knowledge and then BT remotely forces a reboot of the router so that the firmware update is installed - again without the user's consent or knowledge. The only sign something has happened is that if you happen to look at bottom of the page of the router's web interface, the date of the firmware is different to it was before (presuming you knew what it was before). There seems to be no way to turn off this 'feature'.

In addition to the poor ethics of this practice, it can cause real problems. A recent firmware update put my router into a continual cycle of connecting and disconnecting from the VDSL line for several hours. The only fix I've found so far was to disable the Apple Time Capsule I was using for WiFi and backup, and use the built-in wifi of the router. And it's still flakey. So, I'm going to try and replace the router with a third-party VDSL modem that I can actually control, rather than vice versa.

UPDATE: The modem arrived today. Setup was OK, but some of the information required product registration with Draytek, and other bits were on the BT customer support site. So, here it is, all in one place:
DrayTek Vigor 130: This should work out of the box but, just in case, here are some details:
  • The modem web interface is at
  • Set to pass through a PPoE connection.
  • VDSL2 VLAN tag set to 101
  • ADSL VPI/VCI set to 0/38 to PPoA (0/101 for MPoA) I think this is actually irrelevant unless you want to connect to an ADSL rather than a VDSL line.  
  • NOTE: You should change the login details for the modem web interface, for security reasons.
Apple Time machine (or Apple Airport): This needs to work as a router, which is different to the operating mode when connected to a BT HomeHub:
  • Open AirPort Utility, go to the Internet tab, and set 'connect using' to PPoE.
  • Enter the username and password. These (for my connection anyway) are:  and BT. Technically, there is no password, but the Time Machine will not accept this as an answer. BT support pages say to use the password 'BT' in these situations, and this works here. 
  • Service name should be left blank.
  • Click  Update.
UPDATE: Since switching to the DrayTek, uptime is now 55 days and counting!

Sunday, January 25, 2015

Fedora on Macbook Pro Retina

Rationale: I own a lot of Mac hardware, but would now like to use free software as much as possible. That potentially includes the operating system, although I have mixed feelings about this as OS X is pretty finely tuned for its hardware. Is running a generic OS a viable proposition? I'm trialing a toy Fedora installation in odd quiet moments to investigate...

List of installation instructions, updated as I go along. I'm trying this on a 13" Macbook Pro Retina:
  1. Turn off OS X FileVault - encryption causes problems with  rEFInd
  2. Use OS X Disk Utility to create an additional partition - create as free space. Size depends on how much you can spare - I used 60GB.
  3.  Install rEFInd - this is a bootloader - a program that allows you to choose which operating system to use on reboot.
  4. Download Fedora 21 Workstation, and burn to DVD. 
  5. Connect to Ethernet - WiFi does not work out of the box, so plug in a Thunderbolt Ethernet adaptor and use that for now.
  6. Reboot, and run Fedora from the DVD. Note, the DVD can take some time to spin up, so you may need to press ESC until you see it.
  7. [Reinstall rEFInd] - Not sure why this should be necessary, but when I rebooted after Fedora install, rEFInd did not appear. I had to boot to Apple's standard bootloader (press ALT whilst rebooting), go into OS X, and do step 3 again. rEFInd is now back, but I have several boot options. One is obvious (OS X), the Fedora next to it seems to be the easiest way to boot to Fedora. All a bit niggly, but usable.
At this point, Fedora boots fine.

Issue 1: WiFi doesn't work. This is basically down to Apple using a wireless card that does not support Free Software. Here are the steps needed to get it to work (which unfortunately requires some proprietary software):

  1. Enable RPMFusion free and nonfree packages.
  2. Install some packages to support the wireless card:
    sudo yum install kernel-devel akmod-wl
    sudo yum install wl
  3. Update all packages. I found I needed to do this in order to get the WiFi card recognised:
    sudo yum update
  4. Reboot
  1. Firefox displays web pages a little small on a Retina display. Type about:config into the URL bar, then change layout.css.devPixelsPerPx to 2.

Apple Thunderbolt display: Works absolutely fine, no need for modifications. However, Fedora cannot handle the different DPI of this display and the laptop built-in display very well if both are being used - everything is too big on the external display.  Only solution seems to be to disable the built-in display, which is fine as I don't use it with the Thunderbolt display anyway.

Apple wireless keyboard, and wireless trackpad: These work fine with Fedora, but the trackpad seems to have to be re-connected after each reboot (weirdly, the keyboard reconnects automatically). So lid has to be open on reboot so wireless trackpad can be reconnected. Also, they don't work with rEFInd, so you either have to reboot with the lid open or wait a while for the auto-selects.

Apple wireless keyboard mapping: Seems like some mappings e.g. ALT-3, which should be # on a British keyboard, are not working under Fedora. Will need to look into that.

Focusrite Scarlett 2i2: This is a pretty good USB audio device that I have plugged into the USB port on my Apple Thunderbolt display. It works fine with Fedora, no issues. Wow!

Next step: Power management. There are various reports that battery life sucks under Fedora. Under OS X I can get a full day's use on the battery. Wonder what will be achievable initially, and after some tweaking, with Fedora?

    Tech specs: Macbook Pro Retina 11,1; 2.6 GHz Intel Core i5, 8 GB 1600 MHz DDR3, Intel Iris 1536 MB, 500GB flash storage.

    Friday, January 23, 2015

    Free (as in freedom) software

    One of my goals for 2015 is to move completely away from proprietary software, and use free (as in freedom) software instead. If you've not come across this before, Richard Stallman explains it better than I ever could.

    It's turning out to be a bit more complex than expected, but that complexity is, in itself, reinforcing my resolve to do it - because its the deliberately defective design of proprietary software that is at fault. For example, I'm trying to move to a free email client - away from Outlook and Apple Mail, and towards Thunderbird. But getting my 14 years of email archives out of these programs and into an open format is not easy. Outlook for Mac is the worst case - it will only export in an .OLM format, which basically nothing else reads.  It claims to export to MBOX format, but this does not work reliably. Similar problem with Apple Mail - claims to export to MBOX but only actually exports a seemingly random sample of large archives. I'm now in the process of uploading my mail archives to my mail provider, so I can then download them into Thunderbird. Argh! I never want to have to go through this again, and avoiding proprietary software seems to be the best hope in that regard.

    Tuesday, January 13, 2015


    In a recent memo:

    *** has been recognised for his thought-leadership on Mission Groups

    Friday, January 2, 2015

    CD to FLAC (OS X, command-line) using abcde

    The Free Lossless Audio Codec (FLAC) is an lossless open-source format for music (cf. MP3 which is both lossy and proprietary). abcde is an open-source command line program to convert CDs to FLAC, and auotmatically add metadata (Artist name etc.). The OS X  version is available on MacPorts. Only one command needed:

    abcde -o flac -d /dev/disk2

    If you also want to eject the disk from the command line (rather than Finder):

    diskutil eject -t  /dev/disk2