Skip to content

Instantly share code, notes, and snippets.

View todgru's full-sized avatar

todgru

  • Portland, OR
View GitHub Profile

List sessions:

<leader> s

Example response

(0) + 2: 4 windows (attached)
(1) + 4: 3 windows
@todgru
todgru / rebase-branch.md
Last active August 29, 2015 13:57
determine branch sha rebase from that point forward

produces commits since branch creation.

$ git reflog show --no-abbrev <branch name>

Find the sha to rebase from, then:

$ git rebase -i

wget https://github.com/downloads/libevent/libevent/libevent-2.0.18-stable.tar.gz
tar zxf libevent-2.0.18-stable.tar.gz
cd libevent-2.0.18-stable
sudo ./configure
sudo ./make
DIR="/home/ec2-user/downloads/libevent-2.0.18-stable"
wget http://downloads.sourceforge.net/tmux/tmux-1.9.tar.gz
tar zxf tmux-1.9.tar.gz
cd tmux-1.9
@todgru
todgru / redis-copy-keys-to-server.md
Last active August 29, 2015 14:02
ruby hack to copy a subset of redis keys from an old server to a new server

Redis Key Copy

require "redis"

# old redis server with keys we want to copy
old = Redis.new(:url => "redis://:password@url:6379/0")

# new server address
new = Redis.new(:url =&gt; "redis://127.0.0.1:6379/0")
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@todgru
todgru / bash-case.sh
Created September 7, 2014 02:29
bash case statement function, Example how to use case statments in bash, functions, https://github.com/revans/bash-it/blob/master/install.sh
#!/usr/bin/env bash
BASH_IT="$HOME/.bash_it"
test -w $HOME/.bash_profile &&
cp $HOME/.bash_profile $HOME/.bash_profile.bak &&
echo "Your original .bash_profile has been backed up to .bash_profile.bak"
cp $HOME/.bash_it/template/bash_profile.template.bash $HOME/.bash_profile
echo "Copied the template .bash_profile into ~/.bash_profile, edit this file to customize bash-it"
#!/usr/bin/env ruby
# Complete rake tasks script for bash
# Save it somewhere and then add
# complete -C path/to/script -o default rake
# to your ~/.bashrc
# Xavier Shay (http://rhnh.net), combining work from
# Francis Hwang ( http://fhwang.net/ ) - http://fhwang.net/rb/rake-complete.rb
# Nicholas Seckar <nseckar@gmail.com> - http://www.webtypes.com/2006/03/31/rake-completion-script-that-handles-namespaces
# Saimon Moore <saimon@webtypes.com>
@todgru
todgru / rake.sh
Last active August 29, 2015 14:06 — forked from felixhummel/rake.sh
# bash completion for rake
#
# some code from on Jonathan Palardy's http://technotales.wordpress.com/2009/09/18/rake-completion-cache/
# and http://pastie.org/217324 found http://ragonrails.com/post/38905212/rake-bash-completion-ftw
#
# For details and discussion
# http://turadg.aleahmad.net/2011/02/bash-completion-for-rake-tasks/
#
# INSTALL
#
@todgru
todgru / 216-loowit-trail.md
Created October 9, 2014 04:22
Loowit Trail Info

Water map:

@todgru
todgru / setup.md
Last active August 29, 2015 14:17
Raspberry pi setup for TNC Baypac Model BP-2M MultiMode