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/ruby | |
require 'date' | |
class Resource | |
def initialize(hash = {}) | |
hash.each { |k, v| send("#{k}=", v) if respond_to?("#{k}=") } | |
end | |
class << self |
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
$ bundle exec bin/run | |
dyld: lazy symbol binding failed: Symbol not found: _rb_str_new_static | |
Referenced from: /Users/nickcharlton/.gem/ruby/2.2.2/gems/json-1.8.3/lib/json/ext/parser.bundle | |
Expected in: flat namespace | |
dyld: Symbol not found: _rb_str_new_static | |
Referenced from: /Users/nickcharlton/.gem/ruby/2.2.2/gems/json-1.8.3/lib/json/ext/parser.bundle | |
Expected in: flat namespace | |
[1] 72256 trace trap bundle exec bin/run |
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 provision | |
The following berks command failed to execute: | |
/Users/nickcharlton/.gem/ruby/2.2.2/bin/berks --version --format json | |
The stdout and stderr are shown below: | |
stdout: | |
stderr: /Users/nickcharlton/.rubies/ruby-2.2.2/lib/ruby/2.2.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'berkshelf' (>= 0) among 84 total gem(s) (Gem::LoadError) | |
Checked in 'GEM_PATH=/Users/nickcharlton/.vagrant.d/gems:/opt/vagrant/bin/../embedded/gems', execute `gem env` for more information |
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
source "https://rubygems.org" | |
gem "atlas" | |
gem "table_print" |
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 | |
apt-get install -qy postgresql postgresql-contrib libpq-dev postgresql-9.3-postgis-scripts | |
# allow connections on the local network | |
cat << 'EOF' >> /etc/postgresql/9.3/main/pg_hba.conf | |
# Allow connections on the 192.168.*.* local/VM network | |
host all all 192.168.0.0/16 md5 | |
host all all 172.16.0.0/12 md5 | |
EOF |
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
namespace :db do | |
desc "Import a given file into the database" | |
task :import, [:path] => :environment do |_t, args| | |
dump_path = args.path | |
connection_config = ActiveRecord::Base.connection_config | |
case connection_config[:adapter] | |
when "postgresql" | |
system("pg_restore --verbose --clean --no-acl --no-owner " \ | |
"-d #{connection_config[:database]} #{dump_path}") |
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 | |
# set a root password of "vagrant" | |
debconf-set-selections <<< "mysql-server mysql-server/root_password password vagrant" | |
debconf-set-selections <<< "mysql-server mysql-server/root_password_again password vagrant" | |
apt-get install -qy libmysqlclient-dev mysql-server-5.5 | |
# enable listening on all addresses | |
sed -i.bak "s/bind-address\s*= 127.0.0.1/bind-address = 0.0.0.0/g" /etc/mysql/my.cnf |
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
require "octokit" | |
require "csv" | |
Octokit.configure do |c| | |
c.login = "nickcharlton" | |
c.password = ENV["HOMEBREW_GITHUB_API_TOKEN"] | |
end | |
Octokit.auto_paginate = true |
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 | |
set -e | |
plugin_dir=~/.jenkins/plugins | |
installed=() | |
discovered_dependencies=() | |
dependencies_to_install=() | |
mkdir -p $plugin_dir |
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
# | |
# Based upon: https://help.ubuntu.com/12.04/installation-guide/example-preseed.txt | |
# | |
# localisation | |
d-i debian-installer/locale string en_US.utf8 | |
d-i console-keymaps-at/keymap select us | |
# networking | |
d-i netcfg/choose_interface select auto |