Skip to content

Instantly share code, notes, and snippets.

todgru

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
View tmux.md

List sessions:

<leader> s

Example response

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

produces commits since branch creation.

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

Find the sha to rebase from, then:

$ git rebase -i <sha>

View TMUXonEC2.sh
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 Aug 29, 2015
ruby hack to copy a subset of redis keys from an old server to a new server
View redis-copy-keys-to-server.md

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 => "redis://127.0.0.1:6379/0")
View .htaccess
#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 Sep 7, 2014
bash case statement function, Example how to use case statments in bash, functions, https://github.com/revans/bash-it/blob/master/install.sh
View bash-case.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"
View 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
#
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 (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>
View keybase.md

Keybase proof

I hereby claim:

  • I am todgru on github.
  • I am todgru (https://keybase.io/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.