Archive for June 2015

Use Docker Machine to setup Docker environments

Docker Machine is a command-line tool to help you create Docker environments on your computers or cloud providers.

ref:
https://docs.docker.com/machine/

Installatino on Mac

$ curl -L https://github.com/docker/machine/releases/download/v0.3.0/docker-machine_darwin-amd64 > /usr/local/bin/docker-machine
$ chmod +x /usr/local/bin/docker-machine

Usage

$ docker-machine ls

$ docker-machine create --driver virtualbox dev

# list arguments for creating a VirtualBox VM
$ docker-machine create -d virtualbox

# see how to connect Docker to this machine
$ docker-machine env dev

# run this command to configure your shell
$ eval "$(docker-machine env dev)"

# then
$ docker info

Issues

Error response from daemon: client and server don't have same version (client : 1.19, server: 1.18)

$ docker-machine upgrade dev

Setup Hubot with Slack

Hubot is an extensible chat bot written in CoffeeScript.

ref:
https://hubot.github.com/

Installation

$ npm install -g yo generator-hubot

$ mkdir codebaku-hubot
$ cd codebaku-hubot
$ yo hubot

a list of adapters
https://hubot.github.com/docs/adapters/

You need to create a Hubot integration on your Slack to request an API token.

Local Development

Writing your own script
https://hubot.github.com/docs/scripting/

./bin/hubot --name hubot

# or

HUBOT_SLACK_TOKEN=YOUR_SLACK_TOKEN ./bin/hubot --adapter slack

I fork a script named hubot-reload-scripts to help you reload yours scripts when developing them.
https://github.com/vinta/hubot-reload-scripts

Debugging

Debugging Hubot Scripts using Node Inspector
https://gist.github.com/ejhayes/2879225
https://github.com/github/hubot/issues/648

$ npm install -g node-inspector coffee-script

$ node-inspector --no-preload --web-port 8123

# generate source map
$ coffee -m scripts/*.coffee
$ coffee --nodejs --debug node_modules/.bin/hubot --name hubot
$ coffee --nodejs --debug node_modules/.bin/hubot --adapter slack

$ boot2docker ip
$ open http://192.168.59.103:8123/?port=5858

Computer names for Sci-Fi maniac developers

科幻迷的 hostname 列表

  • ADA (Anubis Zone of the Enders)
  • Asurada (Future GPX Cyber Formula)
  • Deep Thought (The Hitchhiker's Guide to the Galaxy)
  • EDI (Mass Effect)
  • EVA-00 (Neon Genesis Evangelion)
  • EVA-01 (Neon Genesis Evangelion)
  • EVA-02 (Neon Genesis Evangelion)
  • GERTY (Moon)
  • GLaDOS (Portal)
  • HAL 9000 (2001: A Space Odyssey)
  • Jane (Ender's Game)
  • JARVIS (Iron Man)
  • KOS-MOS (Xenosaga)
  • MAGI (Neon Genesis Evangelion)
  • Melchizedek (Gunnm Last Order)
  • Mike (The Moon Is a Harsh Mistress)
  • Pip-Boy 3000 (Fallout)
  • Project 2501 (Ghost in the Shell)
  • Skynet (The Terminator)
  • Tachikoma (Ghost in the Shell)
  • TARS (Interstellar)
  • TechnoCore (Hyperion)
  • VIKI (I, Robot)
  • Wheatley (Portal)

ref:
https://www.wikiwand.com/en/List_of_fictional_computers
https://www.wikiwand.com/en/Artificial_intelligence_in_fiction