Skip to content

Instantly share code, notes, and snippets.

@macek
macek / advanced_output
Created September 24, 2010 20:44
Output Buffering with Ruby
A contents <<<
send this to a
this goes to a
a, I forgot to add this
<<<
B contents <<<
this goes to b
b, please
<<<
@fishnix
fishnix / 20120205
Last active October 1, 2015 02:38
Bootstrapping chef nodes in ec2 and rackspace with knife
knife ec2 server create -I ami-41814f28 -d fedora13-gems -f m1.large -Z us-east-1a -x ec2-user
knife rackspace server create -S s2.example.com -N s2.example.com -f 1 -I 118 -d centos6-fishnix -r "role[generic],role[lamp],recipe[users::sysadmins]"
@jboner
jboner / latency.txt
Last active November 18, 2024 08:23
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
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 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@fishnix
fishnix / README.txt
Created June 21, 2012 19:35
jboss local dev box with vagrant
## What you Get
- A working linux box
- Java JDK 1.6.0_xx
- JBoss 5.x.x
- Jenkins with Yale-Maven-Application-Installer
## The deets
- JBoss:
-- Installed JBOSS_HOME=/usr/local/jboss-eap-.....
-- Apps/Nodes = /usr/local/jboss-apps
@fishnix
fishnix / README.txt
Created June 26, 2012 18:04
jboss eap 5.1.2 + jenkins vagrantfile
## What you Get
- A working linux box
- Java JDK 1.6.0_xx
- JBoss 5.x.x
- Jenkins with Yale-Maven-Application-Installer
## The deets
- JBoss:
-- Installed JBOSS_HOME=/usr/local/jboss-eap-.....
-- Apps/Nodes = /usr/local/jboss-apps
@fishnix
fishnix / README.txt
Created June 27, 2012 20:34
cfengine localDev bootrap with chef solo vagrantfile
-- Install vagrant
-- Setup box
cd ~/tmp/vagrant_projects
git clone git://gist.github.com/3006712.git cfe3-vagrant
cd cfe3-vagrant
-- get local copy of cfe3 masterfiles
svn co https://cf3svn.its.yale.edu/repos/cf3dcsunix/trunk cfengine3
@christiannelson
christiannelson / haproxy-ssl.cfg
Created October 16, 2012 17:35
HAProxy Configurations
# References:
# http://blog.mixu.net/2011/08/13/nginx-websockets-ssl-and-socket-io-deployment/
# http://blog.exceliance.fr/2012/09/10/how-to-get-ssl-with-haproxy-getting-rid-of-stunnel-stud-nginx-or-pound/
#
global
nbproc 2
maxconn 16384
defaults
@garlandkr
garlandkr / gist:5438129
Created April 22, 2013 20:16
grok pattern for varnish ncsa logs
VARNISHNCSALOG %{IPORHOST:remoteip} - - \[%{HTTPDATE:timestamp}\] "%{WORD:verb} %{NOTSPACE:request} HTTP/%{NUMBER:httpversion}" (?:%{NUMBER:status}|\(null\)) (?:%{NUMBER:bytes}|-) "(?:%{NOTSPACE:referrer}|-)" %{QUOTEDSTRING:agent}
@twtw
twtw / backup-ror.service
Last active April 12, 2017 14:34
using rvm and create ruby app startup script at systemd
# create systemd service file for rails 2.3.x startup
[Unit]
Description=rails 2.3.x web server
[Service]
Type=simple
RemainAfterExit=yes
User=username
PIDFile=/home/username/WEBSERVER/tmp/pids/thin.pid
WorkingDirectory=/home/username/WEBSERVER