We'll assume an OS X Mavericks (10.9) box here.
You'll need:
- Vagrant
- Vagrant's VMware Fusion provider
require 'base64' | |
require 'time' | |
require 'digest/sha1' | |
require 'openssl' | |
require 'net/https' | |
require 'json' | |
class Chef | |
attr_accessor :http, :path |
apt = execute "apt-get update" do | |
action :nothing | |
end | |
if 'debian' == node['platform_family'] | |
if !File.exists?('/var/lib/apt/periodic/update-success-stamp') | |
apt.run_action(:run) | |
elsif File.mtime('/var/lib/apt/periodic/update-success-stamp') < Time.now - 86400 | |
apt.run_action(:run) | |
end |
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: statsd | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the statsd node server | |
# Description: starts statsd using nodejs forever |
# Description: | |
# This script receives pages in the formats | |
# /usr/bin/curl -d host="$HOSTALIAS$" -d output="$SERVICEOUTPUT$" -d description="$SERVICEDESC$" -d type=service -d state="$SERVICESTATE$" $CONTACTADDRESS1$ | |
# /usr/bin/curl -d host="$HOSTNAME$" -d output="$HOSTOUTPUT$" -d type=host -d state="$HOSTSTATE$" $CONTACTADDRESS1$ | |
# | |
# Author: | |
# oremj | |
irc = require('irc') |
wget https://github.com/downloads/github/hubot/hubot-1.1.9.tar.gz | |
tar zxvf hubot-*.tar.gz | |
cd hubot | |
vim Procfile | |
app: bin/hubot -a gtalk -n Hubot | |
vim bin/hubot | |
#npm install | |
#heroku logs will be more silence the error if remove the npm install from bin/hubot | |
git init |
If you haven't already set your NPM author info, now you should:
npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"
npm adduser
#!/bin/sh | |
# linux firewall/forwarding | |
modprobe iptable_nat | |
echo 1 | tee /proc/sys/net/ipv4/ip_forward | |
iptables -t nat -A POSTROUTING -s 10.10.10.1/2 -o eth0 -j MASQUERADE | |
# install openvpn | |
apt-get update && apt-get install -y openvpn | |
cd /etc/openvpn/ | |
INSTANCE=$(curl http://169.254.169.254/latest/meta-data/public-hostname) | |
openvpn --genkey --secret ${INSTANCE}.key |
app = node[:rails][:app] | |
rails_base app[:name] do | |
ruby_ver app[:ruby_ver] | |
gemset app[:gemset] | |
end | |
%w{config log pids cached-copy bundle system}.each do |dir| | |
directory "#{app[:app_root]}/shared/#{dir}" do | |
owner app[:deploy_user] |
INSTALL | |
======= | |
$ gem install rspec | |
RSPEC-RAILS | |
=========== | |
RAILS-3 | |
======= |