Skip to content

Instantly share code, notes, and snippets.

View jjasghar's full-sized avatar

JJ Asghar jjasghar

View GitHub Profile
INSTALL
=======
$ gem install rspec
RSPEC-RAILS
===========
RAILS-3
=======
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]
#!/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

Getting Started with NPM (as a developer)

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 "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

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
# 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')
#!/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
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
@jjasghar
jjasghar / chef.rb
Created January 5, 2014 17:17 — forked from jmazzi/chef.rb
require 'base64'
require 'time'
require 'digest/sha1'
require 'openssl'
require 'net/https'
require 'json'
class Chef
attr_accessor :http, :path
@jjasghar
jjasghar / README.md
Last active January 4, 2016 10:39 — forked from fnichol/README.md

Testing Mac Platforms with Test Kitchen

We'll assume an OS X Mavericks (10.9) box here.

Requirements

You'll need:

  • Vagrant
  • Vagrant's VMware Fusion provider