Author Archives: bhyde

1-900-COM-PLAIN

For at least a decade, maybe longer, I have entertained myself at parties and other gatherings by pitching this idea for a start-up: 1-900-COM-PLAIN.  This service would help you complain about  – ah – whatever.

Part of my pitch is that you would have lots of up-selling opportunities.  For example for 5$ extra you get extra letters sent to regulators, the owners mother, etc.  For 3$ we would write the letter in a folksy style suggesting you are a good egg.

There is part of the plan that involves acquiring certain firms that have gone bankrupt just to get our hands on their files of complaint letters.

A key risk in this business – obviously – is that you’d be training your employees to become expert complainers.  I’ve yet to figure out a good, and ethical, way to temper that risk.

So.

Today I’m delighted to find this web site: Planet Feedback, which provides an analogous.  For example here is the page where they show the last few dozen letters.

Docker, part 2

The San Francisco Hook

I played with Docker some more.  It’s still in beta so, unsurprisingly, I ran into some problems.   It’s cool, none the less.

I made a repository for running OpenMCL, aka ccl, inside a container.   I set this up so the Lisp process expects to be managed using slime/swank.  So it exports port where swank listens for clients to connect.  When you run it you export that port, i.e. “-p 1234:4005” in the example below.

Docker shines at making it easy to try things like this.  Fire it up: “docker run –name=my_ccl -i -d -p 1234:4005 bhyde/crate-of-ccl”.   Docker will spontaneously fetch the everything you need.   Then you M-x slime-connect to :1234 and you are all set.  Well, almost, the hard part is  .

I have run this in two ways, on my Mac, and on DigitalOcean.  On the Mac you need to have a virtual machine running linux that will hold your containers – the usual way to do that is the boot2docker package.  On Digital Ocean you can either run a Linux droplet and then installed Docker, or you can use the application which bundles that for you.

I ran into lots of challenges getting access to the exported port.  In the end I settled on using good old ssh LocalForward statements in my ~/.ssh/config to bring the exported port back to my workstation.  Something like “LocalForward 91234 172.17.42.1:1234” where that IP address that of an interface (docker0 for example) on the machine where the container is running.  Lots of other things look like they will work, but didn’t.

Docker consists of a client and a server (i.e. daemon).  Both are implemented in the same executable.  The client chats with the server using HTTP (approximately).  This usually happens over a Unix socket.  But you can ask the daemon to listen on a TCP port, and if you LocalForward that back to your workstation you can manage everything from there.  This is nice since you can avoid cluttering you container hosting machine with source files.  I have bash functions like this one “dfc () { docker -H tcp://localhost:2376 $@ ; }” which provides a for chatting with the docker daemon on my Digital Ocean machine.

OpenMCL/ccl doesn’t really like to be run as a server.   People work around by running it under something like screen (or tmux, detachtty, etc.).  Docker bundles this functionality, that’s what the -i switch (for interactive) requests in that docker run command.  Having done that you can then uses “docker log my_ccl” or “docker attach my_ccl” to dump the output or open a connection to Lisp process’ REPL.   You exit a docker attach session using control-C.  That can be difficult if you are inside of an Emacs comint session, in which case M-x comint-kill-subjob is sometimes helpful.

For reasons beyond my keen doing “echo ‘(print :hi)’ | docker attach my_ccl” get’s slightly different results depending on Digital Ocean v.s. boot2docker.  Still you can use that to do assorted simple things.   UIOP is included in the image along with Quicklisp, so you can do uiop:runprogram calls … for example to apt-get etc.

Of course if you really want to do apt-get, install a bundle of Lisp code, etc. you ought to create a new container built on this one.  That kind of layering is another place where Docker shines.

So far I haven’t puzzled out how to run one liners.  Something like: “docker run –rm bhyde/crate-of-ccl ccl -e ‘(print :hi)'” doesn’t work out as I’d expect.  It appears that argument pass thru, arg. quoting, and that the plumbing of standard IO et. al. is full of personality which I haven’t comprehended.  Or maybe there are bugs.

That’s frustrating – I undermines my desire to do sterile testing.

 

Docker is interesting

Somebody mentioned Docker during a recent phone interview, so I went off to have a look.  It’s interesting.

We all love sandboxing.  Sandboxing is the idea that you could run your computations inside of a box.  The box would then protect us from whatever vile thing the computation might do.  Visa versa it might protect the computation from whatever attacks the outside world might inflict upon it.   There are many ways to build a sandbox.   Operating systems devote lots of calories to this problem.  I recall a setting in an old Univac operating system that set a limit on how many pages a user could print on the line printer.   Caja tries to wrap a box around arbitrary JavaScript so it can’t snoop on the rest of the web page.  My favorite framework thinking about this kind of thing is capabilities.  Probably because I was exposed to them back at CMU in the 1970s.

Docker is yet another scheme for running stuff in a sandbox.  They call these containers, like a standardized shipping container.  I wonder if they actually took the time to read “The Box: …“, since it’s an amazing book.

Docker is also the usual hybrid open-source/commercial/vc-funded kind of thing.  Of course it has an online hub/repository.  Sort of like the package managers do; but in this case run by the firm.  Sort of like github.  The business model is interesting, but that’s – maybe – for another post.

Docker stands on a huge amount of work done over the last decades by operating system folks on the sandboxing problem.  It’s really really hard to retrofit sandboxing into an existing operating system.   The redesigned thing is likely to have a lot of rough edges.  So – on the one hand – Docker is a system to reduce the rough edges.  Let meer mortals can play with sandboxes, finally.  But it is also trying to build a single unified API across the diversity of operating systems.  In theory that would let me make a container which I can then run “everywhere.”   “Run everywhere” is perennial eh?

Most people describe docker as an alternative to virtual hosting (ec2, vmware, etc. etc.).  And that’s true.  But it’s also an alternative to package managers (yum, apt, homebrew, etc. etc.).   For example say I want to try out “Tiny Tiny RSS,” which is a web app for reading RSS feeds.  I “just” do this:

docker run -name=my_db -d nornagon/postgres
docker run -d --link my_db:db -p 80:80 clue/ttrss
open http://localhost/

Those three lines create two containers, one for the database and one for the RSS reader.  The 2nd link links the database into the RSS container, and exposes the RSS reader’s http service on the localhost.  The database and RSS reader containers are filled in with images that are downloaded from the central repository and caches. Disposing of these applications is simple.

That all works on a sufficiently modern Linux since that’s where the sandboxing support docker depends on is found.  If your are on Windows or the Mac then you can install a virtual machine and run inside of that.  The installers will set everything up for you.

Welfare Economics

MBA types like to talk about “your business model,” and less so they like to talk about “their business model.”   I like to ask about the model’s effect on the wealth distribution.   It’s a hard question, but generally few businesses actually shift wealth and income in what I’d see as the desirable directions.

With that said here’s a cute B-School chart:

For my purposes think of these two technologies as two business models; i.e. ways of organising the world to create goods for sale to the public.  And for my purposes we can think of the two axis as being rich and poor.   It helps illustrate how the technology has consequences.

That drawing is taken from an interesting post by Steve Randy Waldman, who’s coming at the question I’m interested in from what might be a quite productive angle.  But one way or another this kind of modeling helps to illuminate what I mean when I try to highlight how your business model, standard, technology, ontology, etc. shape in interesting and oft powerful ways the resulting distribution.

Sorting Hat

I enjoyed this graphic showing the association between a person’s profession and what they studied in school.  If you click on one of the boxes on the left or right you can focus on that. Reload to return to the first view.

Where do salesmen come from?

The distributions are what I found interesting.  If you study “mass media” it is hard to predict what you’ll be doing down the road.  If you study electrical engineering it’s easier to predict.  You’d think that would be something schools ought to tell their students.  If you meet somebody who’s a lawyer, a manager, or in sales it’s hard to predict what they studied in school.  It makes me wonder if there is unmet demand for schools aligned to some of these professions.

The distributions inside of professions must say something about the dynamics for workers in the profession.  Obviously if 50% of your peers all studied the same things in school it must make it a bit tedious for the 50% who didn’t study that narrow speciality.  This kind of data lest you measure how “professionalized” a trade is.

Looking at these for a bit you start thinking that some of the categories are pretty arbitrary.  For example about a third of the salesmen in the sample above studied variations on “business.”  That just leads to wondering how much difference is there between these category names?

 

Oh the Modern World

I just looking up an esoteric fact in Google Books I found a bibliographic reference to a paper. Took a photo with my phone and Google Keep, which has OCR.   Copied the transcribed text to Google scholar.  Found the paper.  … etc. etc….

By the way, Google Keep is nice for converting the occasional business card into an entry in your contacts.

Supply chain risk in the Car Rental industry

Two points make for a pattern eh?

The car rental is unable to rent me a cargo van, apparently all their vans are over at the dealer.  GM recalled ’em and the parts aren’t available.  This is a bad time of year for their cargo vans to be out of commission.

This has happened before, sort of.  A while back the car rental in Chicago couldn’t rent me the car I wanted.  A batch of flawed gasoline had damaged the engine.

It makes you wonder how much of the risk in the car rental industry is supply chain related.

I wonder if the rental companies band together to negotiate with the suppliers for compensation.  It would be fun to know how effective they are.

Individuals are presumably lousy at this, but I wonder if the internet has enabled individuals to better form clubs to take collective action in such negotiations.  I’d assume existing conventions about class action make that a bit more complex than it would seem.

Shangri-La Diet – 3

I’m dieting again [1, 2]  So, here’s an R script to convert the log from the app I’m using to track my progress into a pretty picture.

f=list.files(path="~/Dropbox",pattern="Libra.*csv")[-1]
x=read.csv(f,sep=";",skip=3)
colnames(x)[1]="date"
x=x[1:2]
x$date=as.Date(x$date)
ggplot(data=x, aes(x=date, y=weight)) +
    geom_point(size=I(.8)) +
    geom_smooth(aes(group=1))+scale_x_date() +
    opts(axis.title.x=theme_blank())

diet_plot
I was sad to hear that Seth, who discovered this bizarre diet, passed away recently. He was a delightful character.  So much of his work is wonderfully thought provoking.  I hope someday the forces which be will around to doing a formal study of even a few of the things he seems to have discovered.

Collective action

Ah, collective action you do amuse.

A club in Norway whose members pay a monthly fee and take an oath to always avoid paying their train fares.  If they get caught the club steps up to play the fine.  A bit of questionable ethics, a touch of rebellion, a straightforward monetary benefit – all good for group cohesion.   Jerks.

Group always has an insurance component, and sometimes it is as explicit as it is in this case.

The article quotes the transit authority saying that they could build the Berlin Wall and the wouldn’t eliminate the problem.   Personally I’d prescribe public shaming and moral outrage in this case v.s. increased security.

This all reminds me of the alibi club I read about a long time ago.  Cheating men banded together to step up if wifes and girlfriends demanded proof for what ever lie they told about last night’s activities.   I’ve always thought that an alibi club would make an excellent romantic comedy.