Skip to content

Instantly share code, notes, and snippets.

View sholloway's full-sized avatar
🐧
Coding, coding, coding

Samuel Holloway sholloway

🐧
Coding, coding, coding
View GitHub Profile
@sholloway
sholloway / sshd-setup.sh
Created April 13, 2012 21:03
Setting up sshd on Ubuntu
#create a gist
#setting up sshd on Ubuntu 10.10
sudo apt-get install openssh-client openssh-server
# create the keys
sudo ssh-keygen -b 1024 -t rsa1 -f /etc/ssh/ssh_host_rsa_key -N ""
sudo ssh-keygen -b 1024 -t dsa -f /etc/ssh/ssh_host_dsa_key -N ""
sudo ssh-keygen -b 521 -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N ""
#give permissions to the key files
@sholloway
sholloway / gist:2551976
Created April 29, 2012 17:08
Find what process is bound to a port
sudo netstat -lnp --inet
@sholloway
sholloway / .tmux.conf
Created April 29, 2012 19:54
My tmux config file
# some help
# http://www.linuxized.com/2010/05/switching-from-gnu-screen-to-tmux/
# http://blog.hawkhost.com/2010/07/02/tmux-–-the-terminal-multiplexer-part-2/#modifying-tab-color
# Set the prefix key to Cntrl+a
unbind C-b
set-option -g prefix "C-a"
bind-key "C-a" send-prefix
# Set status bar
@sholloway
sholloway / gist:2586961
Created May 3, 2012 16:23
List all packages installed on ubuntu
sudo dpkg --get-selections
# dpkg --list
# dpkg --info packageName
# apt-get remove packageName
@sholloway
sholloway / gist:2596813
Created May 4, 2012 18:36
My .vimrc file
"Set up searching
set incsearch
set ignorecase
set smartcase
"Always have some padding on scrolling
set scrolloff=2
"turn on sytnax highlighing by default
syntax on
@sholloway
sholloway / gist:2597185
Created May 4, 2012 19:29
Use native pyOpenSSL in a virtualenv
ln -sf /usr/lib/python2.7/dist-packages/OpenSSL lib/python2.7
@sholloway
sholloway / Maven 3 install script
Created May 26, 2012 14:51
Install Maven 3 from a deb on Ubuntu
sudo apt-get install python-software-properties
sudo add-apt-repository "deb http://build.discursive.com/apt/ lucid main"
sudo apt-get update
sudo apt-get install maven
@sholloway
sholloway / latency.txt
Created June 2, 2012 14:16 — forked from jboner/latency.txt
Latency numbers every programmer should know
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
@sholloway
sholloway / list_core_image_filters.rb
Created July 8, 2012 16:11
List out all Core Image filters with macruby
framework "Quartz"
# Available Categories:
=begin
KCICategoryDistortionEffect - Distortion effects, such as bump, twirl, hole
KCICategoryGeometryAdjustment - Geometry adjustment, such as affine transform, crop, perspective transform
KCICategoryCompositeOperation - Compositing, such as source over, minimum, source atop, color dodge blend mode
KCICategoryHalftoneEffect - Halftone effects, such as screen, line screen, hatched
KCICategoryColorAdjustment - Color adjustment, such as gamma adjust, white point adjust, exposure
KCICategoryColorEffect - Color effect, such as hue adjust, posterize
@sholloway
sholloway / list_image_io.rb
Created July 8, 2012 16:12
List avaible Image I/O inputs and outputs with macruby
framework "Quartz"
puts "Image I/O Input Formats:"
can_read_from = CGImageSourceCopyTypeIdentifiers()
CFShow(can_read_from)
puts " "
puts "Image I/O Output Formats:"
can_write_to = CGImageDestinationCopyTypeIdentifiers()
CFShow(can_write_to)