Skip to content

Instantly share code, notes, and snippets.

@emmanuelbernard
emmanuelbernard / build.sh
Created January 20, 2011 09:28
build your project in the background while you can work on the next bug
#!/bin/bash
# Clones your existing repo and run the maven tests off this clone
# Tests are run on the the current branch at the time of cloning
#
# Note that you can work on the next bug while this is going on as
# tests are run off a cloned repo.
#
# $ build.sh
# runs 'maven clean install'
#
@emmanuelbernard
emmanuelbernard / remote.sh
Created September 15, 2011 08:24
Run the command on a git clone (using current branch)
#!/bin/bash
# Clones your existing repo and run the subsequent command off this clone
# Tests are run on the the current branch at the time of cloning
#
# Note that you can work on the next bug while this is going on as
# tests are run off a cloned repo.
#
# $ remote.sh mvn clean install
# runs 'mvn clean install'
#
@typeoneerror
typeoneerror / Bash.sublime-build
Created January 11, 2012 20:18
Bash build system for running currently open script in Sublime Text 2
{
"cmd" : ["$file"],
"selector" : "source.shell",
"shell" : "bash"
}
@vincentbernat
vincentbernat / harmony.xml
Created April 22, 2012 18:38
XBMC configuration with Logitech Harmony Remote and iMON
<keymap>
<global>
<keyboard>
<end>XBMC.ShutDown()</end>
<f1>XBMC.ActivateWindow(MusicLibrary)</f1>
<f2>XBMC.ActivateWindow(Videos,TvShowTitles)</f2>
<f3>XBMC.ActivateWindow(Videos,MovieTitles)</f3>
<f4>XBMC.ActivateWindow(Weather)</f4>
<f5>XBMC.PlayerControl(Partymode)</f5>
<two>JumpSMS2</two>
@bhang
bhang / install_graphite_statsd_ubuntu_precise.sh
Created May 15, 2012 17:41
Install Graphite and statsd on Ubuntu 12.04 LTS (Precise Pangolin)
#!/bin/bash
# node.js using PPA (for statsd)
sudo apt-get install python-software-properties
sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm
# Install git to get statsd
sudo apt-get install git
@jboner
jboner / latency.txt
Last active May 23, 2024 06:51
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
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

#!/bin/bash
# Script to loop on local and remote branches, to delete all those which are
# already merged in master.
# Assumes "$USER" as your remote repository and "master" as your main branch.
# Careful if you use branches as tags!
#
# Inspired from http://devblog.springest.com/a-script-to-remove-old-git-branches
# Released under the WTFPL license version 2 http://sam.zoy.org/wtfpl/
# Copyright (c) 2012 Sanne Grinovero
# Copyright (c) 2012 Emmanuel Bernard - made remote repo parameterized
#!/bin/bash
# ------------------------------------------------------------------------------
# Grid Engine Submit Parameters
# ------------------------------------------------------------------------------
#$ -N extract-split-tar-gz
#$ -S /bin/bash
#$ -pe smp 2-
#$ -l h_rt=120:00:00
@spheromak
spheromak / attributes.rb
Last active August 29, 2015 14:01
Using attribute mode to drive dhcp_cookbook
default[:dhcp][:failover] = nil
default[:dhcp][:allows] = [ "booting", "bootp", "unknown-clients" ]
default[:dhcp][:hosts] = []
default[:dhcp][:groups] = []
default[:dhcp][:networks] = []
default[:dhcp][:interfaces] = []
default[:dhcp][:hosts_bag] = "dhcp_hosts"
default[:dhcp][:networks_bag] = "dhcp_networks"