Sep 22, 2017 - Some Further Commentary

Some further commentary on proper hygene of the R library search path (especially w/r/t MacOS)

TL;DR

Only put stable, universal packages in the default R system library (/Library/Frameworks/R.framework/Resources/library). Write protect it to enforce this policy.

Long version:

  1. By default, not-root has write permissions to the default R system library
  2. There’s no way to remove the default R system library from R’s search path, that I can tell, on Mac OS.
  3. If a package is present at the default R system library, biocLite will try to update and over-write the package at this location, rather than adding a new version atR_LIBS_USER. Hence ignoring the search order in .libPaths() and argument lib.loc.
  4. Therefore, to avoid unintentionally altering your configuration, change the permissions of the R system library so that you can’t casually write there (eg with sudo chmod -R 755 /Library/Frameworks/R.framework/Resources/library)
  5. Now, however, if a package is present in the now write-protected site library, biocLite and install.packages will moan and die about a lack of permissions, rather than falling back (well, actually forward) to a write-able, higher-order location in .libPaths().
  6. Therefore, move all packages that you might have to manage on a per-project basis to a separate, user-writable folder, and set this as R_LIBS_USER in your .Renviron file.
  7. Now you may override or add to this value on a per-project basis.

Apr 25, 2017 - Blogoverflow

Blogoverflow: those pesky unix idioms that you keep googling

Mainly relating escaping shell globs, it seems. Maybe next time I will find my own blog?

Rsync only files matching the pattern “*.R”

sh rsync -rv --include="*/" --include="*.R" --exclude="*" . bluehive:HurdleNormal/

Remove non-printable characters from a text file

sh perl -i.bak -pe 's/[^[:ascii:]]//g' lecture3-variance-bias-crossvalidation.Rmd

Apr 4, 2017 - Brick Yo Tablet

One must kill the Asus TF700T in order to save it

I bought an Asus Transformer Infinity back in 2013 to take notes on PowerPoint slides. It worked well at first, until I installed the OTA upgrade to Android 4.2. Then it became clear that the only “infinite” part of it was the lag that would occur under even tiny amounts of IO. Such as loading a webpage, which is mainly what a tablet is supposed to do? So it sat in a shoe box for the past two years. Supposedly installing a different ROM fixes the issue for some folks. It did for me. Here’s the newbie guide:

  1. You need to unlock the bootloader. But first, you’ll need to remove your Google account from the tablet. The unlock tool wants your password, and it uses some old, unsupported Google auth API. It will acquiesce if it can’t find any accounts.
  2. Download the unlock tool for bootloader from one of a number sketchy websites. Version 8 worked for me. Other versions gave me “invalid group signature errors.” YMMV.
  3. Enable developer mode, plug the tablet into a computer and install the unlocker app with adb install. Run it and unlock the bootloader.
  4. Install TWRP with fastboot.
  5. Boot into TWRP using the recovery mode (power + volume down). Format cache with ext4. Format /data with f2fs.
  6. adb push your desired ROM onto the device over USB. I used Timduru’s Katkiss ROM and it works nicely. (ROM is a misnomer, since it’s getting written onto SSD..?)
  7. Install (“flash”) a new ROM using the option in TWRP.
  8. Push and flash SuperSU.
  9. Push and flash gapps.
  10. Cross your fingers and hit reboot. If all went accounting to plan, you’ll boot into a shiny, new, usable OS.