rsync -aPh --delete --filter=":- .gitignore" ./ dest/
git ls-files -ci --exclude-standard -z | xargs -0 git rm --cached
parent_git_branch() {
current_branch=$(git rev-parse --abbrev-ref HEAD)
git show-branch -a 2>/dev/null | ack '\*' | ack -v "$current_branch" | head -n1 | sed 's/.*\[\(.*\)\].*/\1/' | sed 's/[\^~].*//'
}
der2pem() {
TMPFILE="/tmp/cert"
rm -f $TMPFILE
openssl x509 -inform der -in "$1" -out $TMPFILE
cat $TMPFILE
rm -f $TMPFILE
}
der2pemescaped() {
TMPFILE="/tmp/cert"
rm -f $TMPFILE
openssl x509 -inform der -in "$1" -out $TMPFILE
cat $TMPFILE | awk 1 ORS='\\n'
rm -f $TMPFILE
}
pem2der() {
openssl x509 -outform der -in "$1" -out "${1}.crt"
}
This is useful to inspect the SSL certificate chain sent by the server.
openssl_connect() {
openssl s_client -showcerts -connect ${1}:443
}
svnaddall() {
svn st | grep '^!' | awk -F'[[:space:]][[:space:]]+' '{print $2}' | xargs -I{} svn delete {}
svn st | grep '^?' | awk -F'[[:space:]][[:space:]]+' '{print $2}' | xargs -I{} svn add {}
}