Getting gocode based autocompletion working for Go in GNU Emacs

The existing guides and documentation for this are terrible andincomplete for someone who is not already experienced with GNU EmacsLisp packages (which describes me), so here is what worked for me. I'mgoing to assume that your $GOPATH is $HOME/go and that $GOPATH/bin is on your $PATH .

  • get gocode itself:
    go get github.com/nsf/gocode

    To work in GNU Emacs, gocode needs an auto-completion package;it recommends auto-complete , sothat'


Why we wind up deleting user accounts

In a comment on my entry on optimizing finding unownedfiles , Paul Tötterman asked a good question:

I'm surprised that you actually remove users instead of just disablingthem. Care to expand on that?

At one level, the answer is that we remove users when accountsponsors tell us to. How our account management works is that(almost) every user account is sponsored by some professor;if the account's sponsor removes that sponsorship, we deletethe account (unless the person can find another


Optimizing finding unowned files on our ZFS fileservers

One of the things we do every weekend is look for files on ourfileservers that have wound up being owned bypeople who don't exist (or, more commonly, who no longer exist). For along time this was done with the obvious approach using find , whichwas basically this:

SFS=$(... generate FS list ...)gfind -H $SFS -mount '('  -nogroup -o -nouser ')' -printf ...

The problem with


Why we aren't tempted to use ACLs on our Unix machines

One of the things our users would really like to have is some easyway to do ad-hoc sharing of files with random collections of people.In theory this is a great fit for ACLs, since ACLs allow usersthemselves to extend various sorts of permissions to random people.Despite this appeal of ACLs, we have no interest in supporting themon our machines; in fact, we go somewhat out of our way to specificallyblock any chance that they might be available.

The core problem is that in practice today


Consistency and durability in the context of filesystems

Here's something that I've seen trip people up more than once whenthey talk about filesystems. When we talk about what guarantees afilesystem provides to programs that write data to it, we can talkabout two things and the difference between them can be important.

Durability is when you write something or change the filesystemand it's still there after the system crashes or loses powerunexpectedly. Durability is what you need at a high level to say'your email has been received' or 'your file


How I've decided to coordinate multiple git repos for a single project

I'm increasingly using git for my own projects (partly because Ikeep putting them on Github ),and this has brought up a problem. On the one hand, I like linearVCS histories (even if they're lies); I don't plan on having branchesbe visible in the history of my own repos unless it's clearlynecessary. On the other hand, I routinely have multiple copies ofmy repos spread across multiple machines. In theory I always keepall repos synchronized with each


Thinking about the different models of supplying computing

It's the time of year when new graduate students show up here , so one of the things on my mind hasbeen the various ways that computers can be supplied to people inan environment like ours. There are at least three that come tomind.

First is the 'bring your own device' model where every incominggraduate student (or professor) is expected to bring their owncomputer (probably a laptop) and, as a corollary, to look after it.Perhaps we'd supply some niceties


CGo's Go string functions explained

As plenty of its documentation will tell you, cgo provides four functions toconvert between Go and C types by making copies of the data. Theyare tersely explained in the CGo documentation; too tersely, in myopinion, because the documentation only covers certain things byimplication and omits two very important glaring cautions. BecauseI made some mistakes here I'm going to write out a longer explanation.

The four functions are:

func C.CString(string) *C.charfunc C.GoString(*C

Turning, well copying blobs of memory into Go structures

As before, suppose ( not entirely hypothetically ) that you're writing apackage to connect Go up to something that will provide it withblobs of memory that are actually C structs; these might be mmap()'dfiles, information from a library, or whatever. Once you have acompatible Go struct , you still have toget the data from a C struct (or raw memory) to the Go struct.

One way to do this is to manually write your own struct copy functionthat does it


Getting C-compatible structs in Go with and for cgo

Suppose, not entirely hypothetically , that you're writing apackage to connect Go up to something that will provide it blobsof memory that are C structs. These structs might be the resultsof making system calls or they might be just informational thingsthat a library provides you. In either case you'd like to pass thesestructs on to users of your package so they can do things with them.Within your package you can use the cgo provided C. types directly. But this is a