sudo apt-get install libpq-dev
gem install pg -v '0.18.4'
# add gem 'pg' to Gemfile
bundle install
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
#! /bin/sh | |
### Must have Gcloud sdk installed and configured | |
###Create a micro instance as ansible master | |
gcloud compute --project $PROJECT_NAME instances create "ansible" --zone "us-central1-b" --machine-type "f1-micro" --network "default" --maintenance-policy "MIGRATE" --scopes "https://www.googleapis.com/auth/userinfo.email" "https://www.googleapis.com/auth/compute" "https://www.googleapis.com/auth/devstorage.full_control" --tags "http-server" "https-server" --no-boot-disk-auto-delete | |
###or a centos like in the tutorial | |
gcloud compute --project $PROJECT_NAME instances create "ansible-master" --zone "us-central1-b" --machine-type "g1-small" --network "default" --maintenance-policy "MIGRATE" --scopes "https://www.googleapis.com/auth/userinfo.email" "https://www.googleapis.com/auth/compute" "https://www.googleapis.com/auth/devstorage.full_control" --tags "http-server" "https-server" --image "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-7-v20140926" --no-boot-disk-auto-de |
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
#!/bin/bash | |
help_info() { | |
echo "Usage : $0 file"; exit 0 | |
} | |
if [ $# -lt 1 ]; then | |
help_info | |
else | |
if [ -f "$1" ]; then |
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
IO.foreach("./test.csv") do |line| | |
# Remove trailing whitespace. | |
line.chomp! | |
# Split on comma. | |
values = line.split(",") | |
# Write results. | |
IO.write("/tmp/testfile", values.join("+") << "... " << String(values.length) << "\n", mode: 'a') |
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
#!/bin/bash | |
# https://github.com/moovweb/gvm/issues/155 | |
gvm install go1.4 | |
gvm use go1.4 | |
export GOROOT_BOOTSTRAP=$GOROOT | |
gvm install go1.5 |
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
#cloud-config | |
hostname: yourcorename | |
coreos: | |
etcd: | |
addr: $public_ipv4:4001 | |
peer-addr: $private_ipv4:7001 | |
units: | |
- name: etcd.service |
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
// npm install --save split-file | |
// https://github.com/tomvlk/node-split-file | |
var sf = require('split-file'); | |
sf.splitFile('unicorn.png', 10, function(err, names) { | |
if(err) return console.log(err); | |
console.log(names); | |
sf.mergeFiles(names, 'unicorn.merge.png', function(err, outputFile) { | |
if(err) return console.log(err); |