Skip to content

Instantly share code, notes, and snippets.

View peterk143's full-sized avatar

Peter Kirkpatrick peterk143

  • Red Hat
  • Raleigh, NC
View GitHub Profile
while ( true ); do
conn=$(netstat -nat |grep :22 |grep -i established)
if [ $(#conn) gt 0 ]; then
ping -I eth2 www.google.com
end
done
git ls-remote git://github.com/nyxcharon/Test.git | cut -f1 | sed 's/.\{32\}$//'
@peterk143
peterk143 / preview man page
Created June 13, 2013 05:14
make sure everything is formatted correctly
groff -Tascii -man coffee.man | more
@peterk143
peterk143 / ssh tunneling
Last active December 18, 2015 10:19
scp through ssh tunnel
ssh -fnL 9999:localhost:9999 host1 ssh -L 9999:localhost:22 -N host2
scp -P 9999 filename localhost:
#!/bin/sh
git filter-branch --env-filter '
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"
if [ "$GIT_COMMITTER_EMAIL" = "your@email.to.match" ]
@peterk143
peterk143 / revert to last commit
Last active December 18, 2015 09:09
..by one commit
## dca75718 is the hash for the commit you want to remove
git push origin +dca75718^:master
@peterk143
peterk143 / remove specific tags
Last active December 18, 2015 09:09
If you have a remote tag named '12345' then you would just do this:
git tag -d 12345
git push origin :refs/tags/12345