This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
Read 1 MB sequentially from memory 250,000 ns 0.25 ms | |
Round trip within same datacenter 500,000 ns 0.5 ms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -u | |
set -e | |
# Example init script, this can be used with nginx, too, | |
# since nginx and unicorn accept the same signals | |
# Feel free to change any of the following variables for your app: | |
APP_ROOT=/home/deploy/public_html/rm/current | |
PID=$APP_ROOT/tmp/pids/unicorn.pid | |
ENV=production |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final SimpleDateFormat formatter = SimpleDateFormat.getDateInstance(DateFormat.MEDIUM, Locale.US); | |
final String pattern = formatter.toLocalizedPattern(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ksh | |
function proxy(){ | |
export http_proxy="http://localhost:8080/" | |
export https_proxy="http://localhost:8080/" | |
export ftp_proxy="http://localhost:8080/" | |
export no_proxy="localhost,127.0.0.1,localaddress" | |
echo -e "\nProxy environment variable set." | |
} | |
function proxyoff(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
encrypt: | |
tar -cj directory | openssl des3 -salt > encrypted.tarfile | |
decrypt: | |
cat encrypted.tarfile | openssl des3 -d -salt |tar -xvj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
awk '{ if ( match($0, "^pattern") ) { printf "%s\n%s\n", $0, "new TEXT" } else { print } }' input_file.text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lsof -i | grep LISTEN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'dnssd' | |
require 'timeout' | |
begin | |
timeout 3 do | |
DNSSD.browse! '_airvideoserver._tcp.', 'local' do |r| | |
puts "Found HTTP service: #{r.name}" | |
resolver = DNSSD::Service.new | |
resolver.resolve(r) do |resolved| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
num(1). | |
num(2). | |
num(3). | |
triple(X,Y,Z) :- X=\=Y,X=\=Z,Y=\=Z. | |
allnumbers(X,Y,Z) :- num(X),num(Y),num(Z). | |
ct(X,Y,Z) :- allnumbers(X,Y,Z), triple(X,Y,Z). | |
sudoko(A,B,C,D,E,F,G,H,I) :- ct(A,B,C),ct(D,E,F),ct(G,H,I),ct(A,D,G),ct(B,E,H),ct(C,F,I). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 * * * * wget 'http://update.zerigo.com/dynamic?host=example.zerigo.com&[email protected]&password=f7f9c95662ebc538' -O /dev/null |
OlderNewer