This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: hang test | |
hosts: "{{ hosts }}" | |
tasks: | |
- name: hang test 1 | |
local_action: command ssh {{ inventory_hostname }} ls | |
when: task_to_run == "1" | |
- name: hang test 2 | |
local_action: shell ssh {{ inventory_hostname }} ls 2>/dev/null | |
when: task_to_run == "2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: rsync set default value for copy_dest | |
set_fact: copy_dest={{ dest }} | |
when: copy_dest is not defined | |
- name: rsync src={{ src }} dest={{ dest }} copy_dest={{ copy_dest }} | |
local_action: > | |
rsync --archive --compress --copy-unsafe-links --checksum --itemize-changes --exclude=.git | |
--exclude=.vagrant --copy-dest={{ copy_dest }} {{ src }} {{ inventory_hostname }}:{{ dest }} | |
register: rsync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The machines: | |
# Mac OS (MBP Retina): | |
$ sysctl -n machdep.cpu.brand_string | |
Intel(R) Core(TM) i5-3230M CPU @ 2.60GHz | |
$ go version | |
go version go1.2 darwin/amd64 | |
# Linux desktop (Ubuntu 13.10): | |
$ go version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ubuntu 13.10, cpu is Intel Core i5-2500K | |
$ go version | |
go version go1.2 linux/amd64 | |
$ ./client 1 100000 | |
Sent 100000 in 428.895171ms for a rate of 233157/second | |
$ ./client 4 100000 | |
Sent 400000 in 1.79000027s for a rate of 223463/second | |
$ GOMAXPROCS=4 ./client 1 100000 | |
Sent 100000 in 454.46171ms for a rate of 220040/second | |
$ GOMAXPROCS=4 ./client 4 100000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
version_parts = RUBY_VERSION.split(".").map(&:to_i) | |
if version_parts[0] < 2 && version_parts[1] < 9 | |
abort "Ruby >= 1.9 required." | |
end | |
require "set" | |
if ARGV.size != 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu | |
# Make sure the package repository is up to date. | |
RUN echo "deb http://us.archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list | |
RUN apt-get update | |
# Install necessary packages. Vim is for convenience when I'm poking around in the container. | |
RUN apt-get install -y build-essential git bzr mercurial vim | |
# Download and install Go for cross-compilation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"io" | |
"log" | |
"net/http" | |
"os" | |
"time" | |
"code.google.com/p/go.net/websocket" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"strconv" | |
"syscall" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"os/signal" | |
) | |
// Wait for a signal (any signal), print it out, and quit. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure("2") do |config| | |
config.vm.box = "quantal64" | |
config.vm.hostname = "give-this-a-name" | |
config.vm.box_url = "http://cloud-images.ubuntu.com/quantal/current/quantal-server-cloudimg-vagrant-amd64-disk1.box" | |
config.vm.provision :shell, :inline => | |
"sudo mkdir -p /root/.ssh && sudo cp /home/vagrant/.ssh/authorized_keys /root/.ssh/" | |
# config.vm.network :forwarded_port, guest: 80, host: 8080 | |
# config.vm.synced_folder "../data", "/vagrant_data" |