Skip to content

Instantly share code, notes, and snippets.

667502
929516
1074767
1283874
1355645
1392601
1395956
1444385
1660139
1687681
@lchi
lchi / gist:7549ece5bcafae323d57648c14c09c4b
Last active June 24, 2016 21:24
Adding softlayer hosts to ssh config
slcli server list | awk '{ print "Host " $2 }
{print " HostName " $3}' >> ~/.ssh/config
slcli virtual list | awk '{ print "Host " $2 }
{print " HostName " $3}' >> ~/.ssh/config
@lchi
lchi / memcached_stats.rb
Created May 15, 2014 21:43
memcache stats
#!/usr/bin/env ruby
stats_prev = {}
loop do
stats = {}
stats_output = `echo 'stats' | nc localhost 11211 | sed 's/STAT //g' | grep -v END`
stats_output.split("\n").each do |line|
k, v = line.split(" ")
stats[k] = v.to_i
@lchi
lchi / keybase.md
Created May 9, 2014 15:34
keybase.md

Keybase proof

I hereby claim:

  • I am lchi on github.
  • I am lchi (https://keybase.io/lchi) on keybase.
  • I have a public key whose fingerprint is E33E 6A90 5860 8005 91AB 7C45 9458 DEE6 9A48 87E0

To claim this, I am signing this object:

@lchi
lchi / projects
Created November 12, 2013 16:36
Project ideas!
YAML Parser
Nicer Nagios display using Nagios API
Better blog thing
Hacking XXX API using Wireshark
@lchi
lchi / .gitconfig
Last active December 20, 2015 02:29
Git setup on a new machine
[color]
ui = true
[alias]
c = commit
co = checkout
s = status
d = diff
ds = diff --staged
b = branch
[user]
@lchi
lchi / gist:2996251
Created June 26, 2012 14:55
my git aliases
git config --global alias.d diff
git config --global alias.ds 'diff --staged'
git config --global alias.a add
git config --global alias.s status
git config --global alias.co checkout
git config --global alias.c commit
git config --glboal d diff
@lchi
lchi / .bashrc
Created May 30, 2012 02:12
laptop bashrc
export EDITOR='/usr/bin/vim'
alias ll='ls -l'
alias ws='cd ~/workspace'
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
@lchi
lchi / jsonize_fs.py
Created March 18, 2012 19:49
Jsonizing your fs
import json
import os
import sys
def makeTree(path):
t = {path:{}}
tree(path, t[path])
return t
def tree(path, t):