Skip to content

Instantly share code, notes, and snippets.

View SEJeff's full-sized avatar

Jeff Schroeder SEJeff

View GitHub Profile
@SEJeff
SEJeff / gist:2777798
Created May 23, 2012 21:00 — forked from thatch45/gist:2484144
many state decs, one id dec
fred:
group:
- present
- gid: 2000
user:
- present
- uid: 2000
- gid: 2000
- require:
- group: fred
Host github.com
User git
HostName github.com
StrictHostKeyChecking no
IdentityFile /root/.ssh/github
@SEJeff
SEJeff / gist:2856687
Created June 2, 2012 05:09
Salt state file to add a new user and ssh key
cquinn:
group:
- present
- gid: 1500
user:
- present
- shell: /bin/bash
- uid: 1500
- gid: 1500
postgresql-install:
pkg.installed:
- names:
- postgresql-8.4
- postgresql-server-dev-8.4
- postgresql-client-8.4
- postgresql-client-common
- postgresql-common
main:
@SEJeff
SEJeff / gist:2999174
Created June 26, 2012 21:22
Sending eth0's ip as a variable to a salt template file
/var/www/myip.html:
file.managed:
- source: salt://roles/wordpress/files/myip.html.jinja
- user: root
- group: root
- mode: 640
- template: jinja
- context:
hostname: {{ grains['fqdn'] }}
ip: {{ salt['network.interfaces']()['eth0']['ipaddr'] }}
@SEJeff
SEJeff / gist:3005642
Created June 27, 2012 17:46
Adding a ppa from salt the proper way
nginx-ppa:
cmd.run:
- name: "add-apt-repository ppa:nginx/stable && apt-get update"
- unless: "[ -f /etc/apt/sources.list.d/nginx-stable-{{ grains['oscodename'] }}.list ]"
@SEJeff
SEJeff / gist:3019628
Created June 29, 2012 17:58
Create a virtualenv from git for a django app with pip
# Create a virtualenv
/srv/webapps/site2.example.com:
virtualenv.managed:
- no_site_packages: False
- clear: False
- order: 1
pip.installed:
- name: ''
- bin_env: /srv/webapps/site2.example.com
- editable: git+https://bitbucket.org/yml/django_tutorial.git#egg=django_tutorial
@SEJeff
SEJeff / gist:3252367
Created August 3, 2012 22:56 — forked from avimar/gist:3092732
install node.js from source with salt
nodejs-deps:
pkg.installed:
- names:
- g++
- curl
- libssl-dev
- apache2-utils
require:
- pkg: git
@SEJeff
SEJeff / latency.txt
Created September 13, 2012 18:42 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms
@SEJeff
SEJeff / the-case-for-go.txt
Created September 20, 2012 00:33
The case for Go #golang
Go at Heroku
http://blog.golang.org/2011/04/go-at-heroku.html
Rob Pike on how Go fits into today's computing environment
http://radar.oreilly.com/2012/09/golang.html
Why you PHP guys should learn Golang
http://www.mikespook.com/2012/08/why-you-php-guys-should-learn-golang/
Why I went from python to go and not node js