Skip to content

Instantly share code, notes, and snippets.

@quentindecock
Created January 25, 2013 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save quentindecock/4635082 to your computer and use it in GitHub Desktop.
Save quentindecock/4635082 to your computer and use it in GitHub Desktop.
pairme
#!/bin/bash
echo "REMEMBER: tmux -2 -S /tmp/tmux -attach; chmod aog+rwx /tmp/tmux"
ssh ci 'awk !/:1026/ ~/.ssh/known_hosts > ~/.ssh/known_hosts.new'
ssh ci 'mv ~/.ssh/known_hosts ~/.ssh/known_hosts.bak'
ssh ci 'mv ~/.ssh/known_hosts.new ~/.ssh/known_hosts'
ssh -v -N -R 1026:localhost:22 pairing@ci.crowdtap.com >> /tmp/ssh_tunnel.out &
/usr/local/bin/tmux -2 -S /tmp/tmux
@jwoodlee
Copy link

Those first 3 lines are about removing your old host.. maybe this would be cleaner

Remove the line containing the string "awk":

sed '/awk/d' filename.txt

@jico
Copy link

jico commented Jan 25, 2013

I think we can replace lines 4-6 with:

ssh ci "sed '/:1026/d' filename.txt"

and make a backup beforehand

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment