Skip to content

Instantly share code, notes, and snippets.

View rottmanj's full-sized avatar

Jeremy Rottman rottmanj

  • Amazon
  • Seattle, WA
View GitHub Profile
@rottmanj
rottmanj / server.js
Created February 23, 2012 21:46
Simple node/faye remote server
var http = require('http'),
faye = require('faye');
var bayeux = new faye.NodeAdapter({mount: '/bayeux', timeout: 20}),
port = process.argv[2] || '8000'
var server = require('http').createServer(function(req, res){
res.writeHead(200, {'Content-Type':'text/html'});
res.end();
});
+---------------+------------+---------+-----------+--------------+------------+-----------+------------+-----------------+---------+------------+-------------+
| Name | InstanceID | State | Flavor | Image | AZ | Public IP | Private IP | Created At | Volumes | Elastic IP | launchable? |
+---------------+------------+---------+-----------+--------------+------------+-----------+------------+-----------------+---------+------------+-------------+
| node-simple-0 | i-9b59eaff | pending | c1.medium | ami-e358958a | us-east-1d | | | 20120309-232032 | | | - |
+---------------+------------+---------+-----------+--------------+------------+-----------+------------+-----------------+---------+------------+-------------+
Waiting for servers:
0/1 | | 0:51 node-simple-0: Syncing to cloud
node-simple-0: attaching volumes
node-simple-0: labeling
@rottmanj
rottmanj / gist:2024816
Created March 12, 2012 21:32
stupid recipe
bash "install npm packages" do
user "root"
code <<-EOH
cd /
mkdir -p /data
EOH
user "root"
cwd "/data"
code <<-EOH
echo "INSTALL NODE PACKAGES"
@rottmanj
rottmanj / gist:2229745
Created March 28, 2012 19:37
Lighthouse to Assembla Stuff
require "uri"
require "net/http"
require 'mime/types'
require 'crack/xml' # for just xml
class ImportsController < ApplicationController
$settings = {:username => '',
:password => '',
:space_url => '',
:file_path=>"#{File.expand_path(Rails.root)}/data/sweetyhigh_files/sweetyhigh/projects/87977-sweetyhightheg/tickets"}
@rottmanj
rottmanj / node.rb
Created April 19, 2012 20:01
node recipe
app = node.run_state[:current_app]
directory app['deploy_to'] do
owner app['owner']
group app['group']
mode '0755'
recursive true
end
@rottmanj
rottmanj / node_app.json
Created April 19, 2012 20:03
node data bag
{
"id": "node_app",
"server_roles": [
"node_app"
],
"type": {
"node_app": [
"node"
]
},
[global]
dns proxy = No
log file = /var/log/samba/%m.log
load printers = No
smb ports = 139
server string = Dev Server
unix password sync = yes
workgroup = WORKGROUP
domain master = Yes
encrypt passwords = true
@rottmanj
rottmanj / smb.conf
Created July 19, 2012 00:21
smb conf
[global]
dns proxy = No
log file = /var/log/samba/%m.log
load printers = No
smb ports = 139
server string = Dev Server
unix password sync = yes
workgroup = WORKGROUP
domain master = Yes
encrypt passwords = true
@rottmanj
rottmanj / gist:3374893
Created August 17, 2012 00:48
shipment_method response
=> #<HTTParty::Response:0x7fb5b9a2a708 @parsed_response="{\"order\":{\"shipping_methods\":[{\"shipping_method\":{\"id\":1,\"name\":\"No Shipping\",\"cost\":\"0.0\"}}],\"id\":42,\"number\":\"R161885070\",\"item_total\":\"0.0\",\"total\":\"0.0\",\"state\":\"delivery\",\"adjustment_total\":\"0.0\",\"credit_total\":\"0.0\",\"user_id\":1,\"created_at\":\"2012-08-17T00:47:58Z\",\"updated_at\":\"2012-08-17T00:48:09Z\",\"completed_at\":null,\"payment_total\":\"0.0\",\"shipment_state\":null,\"payment_state\":\"paid\",\"email\":\"test@test.com\",\"special_instructions\":null,\"bill_address\":{\"id\":11,\"firstname\":\"test\",\"lastname\":\"test\",\"address1\":\"644 s saltair ave\",\"address2\":null,\"city\":\"Los Angeles\",\"zipcode\":\"90049\",\"phone\":\"555-555-5555\",\"company\":null,\"alternative_phone\":null,\"country_id\":214,\"state_id\":276110813,\"state_name\":null,\"country\":{\"id\":214,\"iso_name\":\"UNITED STATES\",\"iso\":\"US\",\"iso3\":\"USA\",\"name\":\"United States\",\"numcode\":840},\"state\":{\"a
@rottmanj
rottmanj / gist:3428098
Created August 22, 2012 18:17
nginx + unicorn
upstream unicorn-staging {
server unix:/data/appname/staging/current/tmp/sockets/unicorn-staging.sock fail_timeout=0;
}
server {
listen 80 deferred;
listen 443;
ssl on;
root /data/appname/staging/current/public;
server_name foo;