Skip to content

Instantly share code, notes, and snippets.

deploy@foxtrot:~$ uname -a
Linux XXXXXXX 2.6.35.4-rscloud #8 SMP Mon Sep 20 15:54:
33 UTC 2010 x86_64 GNU/Linux
deploy@foxtrot:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.04.3 LTS
Release: 10.04
Codename: lucid
@rdj
rdj / update-ip
Created November 6, 2012 06:34
Bash script to use from cron to dynamically update IP on Amazon route 53
#!/bin/bash
source ~/.rvm/environments/default
DNS_ZONE=yourdomain.com
DNS_RECORD=yourhost.yourdomain.com.
IP_CACHE_FILE="$(dirname $0)/update-ip.cache"
if [[ -r "$IP_CACHE_FILE" ]]; then
@rdj
rdj / private.xml
Created October 2, 2012 02:04
KeyRemap4MacBook configuration
<?xml version="1.0"?>
<root>
<item>
<name>RDJ’s Customizations</name>
<item>
<name>Pseudo-collapse ⎋ and `</name>
<item>
<name>⌘⎋ to ⌘`</name>
<identifier>private.cmd_esc_to_cmd_backtick</identifier>
<autogen>
Begin: Running /scripts/init-bottom ... done.
init: ureadahead main process (342) terminated with status 5
init: console-setup main process (2044) terminated with status 1
45) killed by SEGV signal
init: plymouth-splash main process (2196) terminated with status 2
mountall: Plymouth command failed
mountall: Disconnected from Plymouth
fsck from util-linux-ng 2.17.2
/dev/sda1 has gone 336 days without being checked, check
startup_message off
defscrollback 3000
bind s # remove the flow control garbage
msgwait 1
escape ^Jj
term screen-256color
bindkey -d -k kb stuff "\010"
@rdj
rdj / .bashrc
Created November 20, 2011 19:32
# grep recursive, skipping source control
function g {
find . -name .svn -prune -and -false -o -name .git -prune -and -false -o -type f -and -print0 | xargs -0 egrep --color=auto "$@"
}
$ brew edit pianobar
diff --git a/Library/Formula/pianobar.rb b/Library/Formula/pianobar.rb
index cae4571..e32a4e5 100644
--- a/Library/Formula/pianobar.rb
+++ b/Library/Formula/pianobar.rb
@@ -6,7 +6,7 @@ class Pianobar < Formula
homepage 'https://github.com/PromyLOPh/pianobar/'
md5 ''
- head 'https://github.com/PromyLOPh/pianobar.git'
@rdj
rdj / update-ip
Created October 24, 2011 22:47
Dynamic DNS with Zerigo and a cron job
#!/bin/bash
# Run `crontab -e` and add this line:
# */1 * * * * /Users/youraccount/bin/update-ip
# Enable API access under Zerigo's DNS / Preferences / API Access and Dynamic Updates
# Then get your API key from that same page after you save the form.
ZERIGO_HOSTNAME=host.example.com
ZERIGO_USERNAME=email%40gmail.com
@rdj
rdj / .bashrc
Created October 15, 2011 20:05
function xo {
rm -rf ~/Library/Saved\ Application\ State/com.apple.dt.Xcode.savedState
TERMCAP= open -a `xcode-select -print-path`/Applications/Xcode.app *.xcodeproj
}
[alias]
st = status -s
log1 = log --format=oneline
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
d = diff --color-words
sh = show --color-words
up = "!rdj_git_up() { if [[ -z `git status --porcelain` ]]; then local back=$(git name-rev --name-only HEAD); echo ======== fetch origin ========; git fetch origin && git remote prune origin && for r in devel master; do echo ======== fast-forward $r ========; git checkout $r && git merge --ff-only origin/$r; done && now=$(git name-rev --name-only HEAD); [[ $now != $back ]] && echo ======== checkout $back ======== && git checkout $back; else echo Repo is not clean; fi }; rdj_git_up"