start new:
tmux
start new with session name:
tmux new -s myname
package main | |
import ( | |
"fmt" | |
"io" | |
"log" | |
"net/http" | |
"os" | |
) |
os | |
from flask_extended import Flask | |
app = Flask(__name__) | |
app.config.from_yaml(os.join(app.root_path, 'config.yml')) |
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 |
#!/usr/bin/env python | |
""" | |
Produces load on all available CPU cores | |
""" | |
from multiprocessing import Pool | |
from multiprocessing import cpu_count | |
def f(x): | |
while True: |
package main | |
import ( | |
"fmt" | |
"os" | |
"io/ioutil" | |
"strings" | |
"time" | |
"encoding/json" | |
) |
#!/usr/bin/env ruby | |
# | |
# Nagios/PuppetDB config generator | |
# | |
# Based on concept from puppetdb-external-naginator | |
# https://github.com/favoretti/puppetdb-external-naginator | |
# | |
# Generates nagios configs from puppet(db) exported resources. | |
# | |
require 'rubygems' |
// program | |
package main | |
import "os/signal" | |
import "os" | |
import "fmt" | |
import "syscall" | |
import "time" | |
Get EC2 CloudWatch stats and graph them in Dashing.
vagrant@ubuntu-12:/docker-pub/redis$ cat base/2.8.1/Dockerfile | |
FROM ubuntu:12.10 | |
MAINTAINER James McKernan [email protected] | |
RUN apt-get update | |
RUN apt-get install -y build-essential | |
ADD redis-2.8.1.tar.gz redis-2.8.1.tar.gz | |
RUN tar xvfz redis-2.8.1.tar.gz | |
RUN cd redis-2.8.1 && make | |
RUN cd redis-2.8.1 && make install |