15 GB free disk space in the cloud RecentChanges 2014-04-18 XML TXT

Latest weblog entries

2014-04-16 Python vi keybindings on OS X

If you're used to vi keybindings, and you use Python interactively, you're going to do a lot of cursing on OS X. This is because the readline library (responsible for keybindings and history) is GPL licensed and thus not distributed by Apple.

Here's a quick fix.

Add a file called .editrc with the following content:

 bind -v

Add a file called .pythonrc with the following lines:

 import rlcompleter
 import readline

Add a line to your .bashrc which makes Python run .pythonrc when it starts interactively:

 export PYTHONSTARTUP="$HOME/.pythonrc"

Start python from the commandline and voilĂ , enjoy history and vi keybindings and all that good stuff. Tested on 10.9.2 (Mountain Lion).

2014-01-29 tmux and X11

Recently I've been playing around with tmux . For all you neckbeards, that's the modern equivalent of GNU Screen.

On the surface, it looks pretty cool. Especially because iTerm2 can talk to tmux. From the iTerm2 wiki: When you run "tmux -CC", a new tmux session is created. An iTerm2 window opens and it acts like a normal iTerm2 window. The difference is that when iTerm2 quits or the ssh session is lost, tmux keeps running. You can return to the host you were ssh'ed into and run "tmux -CC attach" and the iTerm2 windows will reopen in the same state they were in before.

That's pretty useful!

A problem that I'm now bumping into, is that when I'm SSH'ing into the remote machine where tmux runs, I'm forwarding X11. This is useful because vim supports the X11 clipboard. That way, if I copy text from vim and paste it on my local machine, layout is retained.

Without the X11 clipboard, I'd have to simply "hard-copy" whatever is on the terminal screen. Vim's line numbers will be copied along. I also couldn't copy more than one screen.

In order to make this work, when ssh opens a session and starts the shell, it sets the environment variable $DISPLAY. Vim then reads it when it starts.

However when detach tmux, log out and log in again via ssh, DISPLAY is set again to some other value. All shells in your tmux session now have an old/stale value in DISPLAY. Tmux has some commands for this, but it's not automatic. And if that would work, vim has to be restarted again as well.

It would be nice if you could simply configure the DISPLAY variable but this doesn't work -- the ssh server has an option called X11DisplayOffset but the client doesn't. So there's no way to configure this based on the user.

In summary: X11 forwarding and tmux don't work very well.

2013-12-20 Performance test of USB ethernet adapters on OS X

I've got two USB-based network adapters laying around here: the official Apple USB 2 Ethernet Adapter and this USB 3.0 ethernet adapter based on the Asix AX88179 chipset.

Then I connect over a VPN, and use scp to see how much time it takes to pull over a 100 MB test file. With the Apple adapter:

  $ scp testbox:~/tmp/a.log .
  a.log                    100%  100MB   3.0MB/s   00:33

And now with the USB 3 based adapter:

  $ scp testbox:~/tmp/a.log .
  a.log                    100%  100MB   2.9MB/s   00:34

Huh weird, no difference. I'll go and check where the bottleneck lays. VPN? scp?

Not using VPN gives the following result:

  $ scp .
  a.log                    100%  100MB  16.7MB/s   00:06

That's somewhat better. Testing without scp, but with wget instead shows roughly the same number:

  $ wget
  100%[====================>] 126,805,954 16.0MB/s   in 7.6s

Now I test it on a different machine, within the company network:

 $ wget
 100%[====================>] 126,805,954 64.1M/s   in 1.9s

That's better. So the bottleneck is apparently the physical (ethernet) connection I've got, which is VLAN'ed to provide a guest network. Oh well.

Long story short: better check this guy's test results. You should be able to get up to 110 MB/s.

2013-10-25 What is new in OS X Mavericks

I'm running a little comparison of the file system of a Mavericks install and a Mountain Lion install, to see what's new and what has disappeared.

So far, I found that Mavericks added the following drivers:

Mavericks also added Ruby 2.0 (up from 1.8 in Mountain Lion).

I found a number of apps in /System/Library/CoreServices that are new:

  • Install Command Line Developer Tools -- calling any of the binaries related to development (like /usr/bin/cc) will instead call this Xcode installation utility
  • Keychain Circle Notification -- App that allows you to grant other devices access to this Mac its keychain, used for iCloud syncing of passwords (for example those used in the browser)
  • Pass Viewer -- "partial support for Passbook passes, letting you view emailed passes on your Mac" -- source: MacWorld: Get to know OS X Mavericks: Apple Mail 7.0

There's also a number of new drivers in the /System/Library/Extensions folder:

  • AppleHSSPIHIDDriver, AppleHSSPISupport, AppleHWAccess: would seem to be for communication with keyboards, trackpads, and other buttons (like a hinge-button) that use an SPI bus
  • AppleIntelFramebufferAzul: obviously a display driver, but don't know what exactly
  • Driver for the new Intel HD5000 stuff
  • AppleIntelHSWVA driver, HSW is Haswell, but VA?
  • AppleIntelLpssDmac, AppleIntelLpssGspi, AppleIntelLpssSpiController: LPSS is Intel's Low Power SubSystem stuff, the Linux kernel uses this acronym when talking about Intel's Bay Trail architecture
  • AppleThunderboltIP, that's the driver for tunneling IP over Thunderbolt, duh :D I'm confused if this has anything to do with the Thunderbolt ethernet driver, I don't think so.
  • AppleTopCase, ?
  • GeForce Tesla driver, maybe a driver for the Mac Pro
  • IOReportFamily driver, ?
  • vecLib, see also [2]

In the /System/Library/Frameworks folder, there are a number of new libraries:

  • AVKit.framework
  • GameController.framework
  • MapKit.framework
  • MediaAccessibility.framework
  • MediaLibrary.framework
  • SpriteKit.framework

In /usr/bin, there are a bunch of new executables:

  • afida -- Audio File Image Distortion Analyzer
  • footprint -- gathers memory information about a process or set of processes
  • ipmitool -- utility for controlling IPMI-enabled devices
  • ippfind -- find internet printing protocol printers
  • json_pp -- a Perl-based utility for working with JSON
  • jvisualvm -- ?
  • lsappinfo -- Control and query CoreApplicationServices about the app state on the system
  • ncdestroy -- Destroy kernel NFS credentials
  • pluginkit -- manages the PlugInKit subsystem for the current user. It can query for plugin matches, as well as explicitly change the plugin database.
  • powermetrics -- gathers and display CPU usage statistics
  • timer_analyser.d -- ?
  • timerfires -- analyze timers as they fire
  • wdutil -- Wireless Diagnostics command line utility
  • zipdetails -- display the internal structure of zip files

In /usr/sbin:

  • ioalloccount -- Summarize IOKit memory usage.
  • purge -- force disk cache to be purged (flushed and emptied)
  • sndiskmove -- Xsan File System Disk Mover Utility
  • systemstats -- shows a selection of statistics about system power usage
  • taskpolicy -- execute a program with an altered I/O or scheduling policy. Not sure how this relates to the standard Unix commandline utility "nice"

2013-10-13 Extend drive space in your MacBook Air 2013

Recently I got a MacBook Air, but it wasn't within my budget to get the bigger SSD. The standard SSD is advertised as 128 GB. In practice, this means 112 GiB, so I went looking for additional ways to get some extra storage space.

First and most cheapest, you can get an external harddisk. On one hand, it's very cheap. On the other hand, you have to remember taking it with you, and it's another wire and another device on your desk.

As an extension to that, there's the various wireless external harddisks. This Lifehacker article lists a few: Add Wireless Storage to Phones, Tablets, and Laptops with Wi-Fi Drives.

There's a number of USB-sticks that are so small, you can just leave them in. Here's a nice list of them:

  • Sandisk Cruzer Fit, currently max. 32 G (warning: I've seen a forum post that these are very slow)
  • Kingston DataTraveler Micro, maximum 64 GB
  • Patriot Autobahn currently also 32 GB
  • Verbatim Store 'n' Stay, maximum 32 GB

Of these, I really like the Verbatim Store 'n' Stay because it seems the smallest of the bunch.

There's also a number of solutions that use the SD-card slot. They're basically adapters that take a micro-SD card. They're sized such that they sit flush with the outside of the MacBook.

  • The Nifty Minidrive which looks best and is most expensive, with different options for each MacBook (pro retina, air, pro)
  • The MiniDrive a knock-off with mixed reviews on Amazon
  • BaseQi, another knock-off sold via eBay

Of these three, I am now testing the last one, and it sits perfectly flush with the MacBook Air's chassis:
baseqi detail.gif

I've got it fitted with a 16 GB micro-SD and it seems to work fine. There is no loss of speed noticeable, when comparing with the micro-SD-to-standard-SD-adapter that came with this card.


Weblog Archive

Weblog entries 2013

Weblog entries 2012

Weblog entries 2011

Weblog entries 2010

Weblog entries 2009

Weblog entries 2008

Weblog entries 2007

Weblog entries 2006

Weblog entries 2005

Weblog entries 2004

All weblog entries


Articles, chronologically (latest first):


Not yet finished. Maybe will never be finished. Maybe they'll get deleted. Who knows?


System administration: