Random UO anecdote #2

“When you rode a horse, we simply put the horse inside the player, and spawned a pair of pants that looked like your horse, which you then equipped and wore.

When we first did this, however, we forgot to make the horse stop acting like a horse. Pretty soon there was a rash of server crashes because the horse inside the player was wandering around, picking up the stuff it found inside the player, rifling through the player’s backpack and eating things it thought were edible”


Dossier” is an open-source proof-of-concept of an idea I have been exploring recently, best described as “structured notes” or “database meets wiki”.

At the moment what I have is about two hours worth of hurriedly slapped-together PHP, but I think it demonstrates that the idea has some merit.

The idea is to take a loosely structure database containing records with arbitrary key-value pairs (like this) and present it in an intelligently interlinked way (like this).

Conceptually, it’s similar to a relational database, except each record can have any number of fields, and they do not have to be the same fields from record to record. You can even repeat fields on a single record. (Say, for a example if you have a record of a person who has been married multiple times, you could just repeat the “Spouse” property on that record.)

Like a wiki, you do not have to worry about manually creating links between records. Those will be discovered for you automatically based on properties and property values.

I doubt that the idea is completely original, but after much searching, I’ve not found anything that implements it this particular way, and certainly not so simply.

I hope it is interesting to other info-nerds. There are plenty of feature possibilities up for grabs if you want to fork and contribute such as: user accounts, authentication, write access to the database, improved design, and so on.

LifeLock CEO’s Identity Stolen 13 Times

“LifeLock CEO Todd Davis, whose [social security] number is displayed in the company’s ubiquitous advertisements, has [...] been a victim of identity theft at least 13 times, according to the Phoenix New Times.”

Over the course of a weekend, DashCon 2014 descended into chaos

“Over the course of one weekend, the organizers took $17,000 from conventiongoers as part of an emergency fundraising drive, failed to pay any of their high-profile guests, and attempted to compensate disappointed ticket-holders by offering them an ‘extra’ hour in a children’s ball pit.”

Busy NYC Restaurant Solves Major Mystery by Reviewing Old Surveillance

“One of the most common complaints on review sites against us and many restaurants in the area is that the service was slow and or they needed to wait a bit long for a table.


Given in most cases the customers are constantly busy on their phones it took an average of 20 minutes more from when they were done eating until they requested a check. Furthermore once the check was delivered it took 15 minutes longer than 10 years ago for them to pay and leave.”

(Take this with a grain of salt, since the source is an anonymous Craigslist posting, and the “finding a surveillance tape from 2005″ strains belief.)

Setting up Rails + Postgresql + Heroku on Mavericks

I spent hours today trying different ways of quickly and reproducibly provisioning a Mac for Rails + Postgresql development that could be deployed to Heroku.  What follows is, believe it or not, the easiest method I came up with.

This is a cheatsheet, not a tutorial.  I’m not going into much depth on what each command does, but if you’re just looking for a list of commands to get running quickly, you’re at the right place.

I tested these instructions against a stock installation of OS X Mavericks 10.9 in VMWare Fusion that had been patched up to 10.9.4 with Software Update.  Mavericks 10.9.4 ships with ruby 2.0.0p451.

This cheatsheet was compiled with information from https://devcenter.heroku.com/articles/getting-started-with-rails4 and other sources.

• First, create an account on Heroku, if you don’t have one already.

• Trigger the OS to install Developer Tools if you don’t already have them:

$ git
(Click Install)
(Agree to license agreement)

Installing just the Developer Tools is faster than installing Xcode if you don’t have/need it.

• Visit this page in Safari:


• Click “Download Heroku Toolbelt for Mac OS X” and run the installer pkg file that it downloads.

• Install Homebrew:

$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
$ brew doctor

• Log in to Heroku:

$ heroku login
(Enter Heroku email)
(Enter Heroku password)

• Install postgresql:

$ brew install postgresql

• Install pg (postgresql) gem:

$ sudo ARCHFLAGS="-arch x86_64" gem install pg

• Start postgresql:

$ postgres -D /usr/local/var/postgres &

• Install Bundler:

$ sudo gem install bundler

• Install Rails:

$ sudo gem install rails --no-ri --no-rdoc
(When warned about conflicting rails executable, allow overwrite)

• Create a new postgresql-backed Rails app:

$ rails new myapp -d postgresql

• Create a barebones ‘welcome’ route in the app:

$ cd myapp
$ rails generate controller welcome

• Create app/views/welcome/index.html/erb with the editor of your choice, and insert the following content:

<h2>Hello World</h2>
The time is now: <%= Time.now %>

• Edit config/routes.rb and uncomment this line:

root 'welcome#index'

• Add this line to the end of Gemfile:

gem 'rails_12factor', group: :production

• Run Bundler to get the rails_12factor gem installed (required by Heroku):

$ bundle install

• Create a default database named after your username (a convenience for if you want to use a postgresql GUI like PG Commander later):

$ createdb

• Create dev and test databases for the Rails app:

$ createdb myapp_development
$ createdb myapp_test

• Edit config/database.yml and change the “production” section at the bottom to read like this:

  url: <%= ENV['DATABASE_URL'] %>

Delete the database, username, and password lines from this section.  You can delete the line that begins with << too.

• At this point you should be able to run the app locally on the built-in server:

$ rails server
(visit url http://localhost:3000/)
(^C to stop the server)

• Create a git repo for the project:

$ git init
$ git add .
$ git commit -m "init"

• Create a Heroku app:

$ heroku create

Heroku will automatically assign your app a name consisting of a couple of words and a number.

• If you already have an SSH keypair, you can upload the public key through the Heroku dashboard, then, on your Mac, use ssh-add to make the private key available to ssh-agent.

If you don’t already have an SSH keypair, or would rather use a new one, let Heroku generate one:

$ heroku keys:add
(it asks if you want to generate one, say yes)

• Push git repository to Heroku:

$ git push heroku master
(if you get a warning that the authenticity of the host cannot be established, enter yes to continue)

• Confirm your app is now running on Heroku:

$ heroku open

At this point, Heroku is running the app on webrick, which is not suitable for production.

• To switch to the unicorn web server, add this line to the end of Gemfile:

gem 'unicorn'

• Then:

$ bundle install

• Create config/unicorn.rb with the following content (watch out for word-wrapping on the blog here):

worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3)
timeout 15
preload_app true

before_fork do |server, worker|
  Signal.trap 'TERM' do
    puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
    Process.kill 'QUIT', Process.pid

  defined?(ActiveRecord::Base) and

  after_fork do |server, worker|
    Signal.trap 'TERM' do
      puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT'

    defined?(ActiveRecord::Base) and

• Inform Heroku that you wish to use unicorn by creating a file called Procfile with this content:

web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb

• To test with the unicorn server locally, install Foreman:

$ sudo gem install foreman
(answer yes if it asks if you want to overwrite the existing executable)

• You can now start the unicorn web server with:

$ foreman start

Note that unicorn runs by default on port 5000 instead of webrick’s port 3000, so to test, visit http://localhost:5000/

• Stop unicorn with ^C.

• Commit changes to git repo:

$ git add .
$ git commit -m "added unicorn"

• Deploy to Heroku again:

$ git push heroku master

• Verify that Heroku is still serving a working app:

$ heroku open

• If you’d like extra confirmation that the app is now running atop unicorn, the server log should show something that looks like unicorn output:

$ heroku logs

And it’s just THAT EASY.  ;)

Pentagon preparing for mass civil breakdown

“Among the projects awarded for the period 2014-2017 is a Cornell University-led study managed by the US Air Force Office of Scientific Research which aims to develop an empirical model ‘of the dynamics of social movement mobilisation and contagions.’


Twitter posts and conversations will be examined ‘to identify individuals mobilised in a social contagion and when they become mobilised.’”

Facebook tinkered with users' feeds for a massive psychology experiment

“… Facebook data scientists tweaked the algorithm that determines which posts appear on users’ news feeds—specifically, researchers skewed the number of positive or negative terms seen by randomly selected users. Facebook then analyzed the future postings of those users over the course of a week to see if people responded with increased positivity or negativity of their own, thus answering the question of whether emotional states can be transmitted across a social network. Result: They can!”

The Laundry Quarters Delivery Startup Is Dead

“Some things are too precious to last in this brutal world, and Washboard, a startup that mailed you quarters to do your laundry, is one of them. It is, against all odds and after only a week in business, shutting down.”

“Reviewer’s Lament” mugs and shirts

I know some of you already own my harsh indictment of the CSS box model in mug or t-shirt form:


Today I’m adding a brand new design to my Zazzle store, which I call “Reviewer’s Lament”:

I'd give it zero stars if I could

Featuring the oft-heard existential refrain “I’d give it zero stars if I could” and a soothing rainbow, the new design is available on mugs, t-shirts, and posters. Please enjoy it, if you can.