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.

Applications
  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 http://192.168.2.1
  • 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: bthomehub@btbroadband.com  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!