Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block todgru

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

List sessions:

<leader> s

Example response

(0) + 2: 4 windows (attached)
(1) + 4: 3 windows
todgru /
Last active Aug 29, 2015
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 <sha>

tar zxf libevent-2.0.18-stable.tar.gz
cd libevent-2.0.18-stable
sudo ./configure
sudo ./make
tar zxf tmux-1.9.tar.gz
cd tmux-1.9
todgru /
Last active Aug 29, 2015
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://:password@url:6379/0")

# new server address
new = => "redis://")
View .htaccess
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php
#Redirect an entire site:
Redirect 301 /
#Redirect an entire site to a sub folder
Redirect 301 /
todgru /
Created Sep 7, 2014
bash case statement function, Example how to use case statments in bash, functions,
#!/usr/bin/env bash
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"
# bash completion for rake
# some code from on Jonathan Palardy's
# and found
# For details and discussion
View rake_autocomplete.rb
#!/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 (, combining work from
# Francis Hwang ( ) -
# Nicholas Seckar <> -
# Saimon Moore <>

Keybase proof

I hereby claim:

  • I am todgru on github.
  • I am todgru ( on keybase.
  • I have a public key whose fingerprint is 3C81 DFC3 838F E07F 9C16 7EC1 CF87 2F8A C095 52B4

To claim this, I am signing this object:

You can’t perform that action at this time.