More tools and improvements

Signed-off-by: Jacob Kiers <kiers@comandi.nl>
This commit is contained in:
Jacob Kiers
2017-12-08 18:36:39 +01:00
parent 4b36c35285
commit 2755650734
12 changed files with 334 additions and 12 deletions

View File

@ -15,8 +15,16 @@ alias t="tmux"
alias x+="chmod +x"
alias +x="chmod +x"
# Devstack
alias comup='pushd ~/src/comandi/dashboard; vagrant up; popd'
alias comdown='pushd ~/src/comandi/dashboard; vagrant halt; popd'
if [ `uname` == 'Linux' ]; then
alias open='xdg-open'
fi
# Remove all local branches already merged in master.
alias gitclean='git branch --merged master | grep -v "\smaster$" | grep -v "*" | xargs git branch -d'
alias gitclean='git branch --merged master | grep -v "\smaster$" | grep -v "*" | xargs --no-run-if-empty git branch -d'
alias gist='gist -c'
# Detect which `ls` flavor is in use
@ -77,7 +85,7 @@ alias get="curl -O"
alias dos2unix="perl -pi -e 's/\r\n?/\n/g'"
# Password generator
password() { cat /dev/urandom | tr -dc A-Za-z0-9_ | head -c ${1:-10}; }
password() { cat /dev/urandom 2>/dev/null | tr -dc A-Za-z0-9_ 2>/dev/null | head --bytes=${1:-10}; }
# Show $PATH in a readable way
alias path='echo -e ${PATH//:/\\n}'

View File

@ -179,3 +179,8 @@ function git-private()
for cmd in password hex2hsl hex2rgb escape codepoint ssh-key myip; do
eval "function $cmd+() { $cmd \$@ | c; }"
done
function jira()
{
open "https://comandi.atlassian.net/browse/CMD-${1}"
}

11
includes/bash_ssh.bash Normal file
View File

@ -0,0 +1,11 @@
#!/bin/bash
if [ -z "$SSH_AUTH_SOCK" ] ; then
eval `ssh-agent -s`
fi
KEY="$HOME/.ssh/work"
[ -f $KEY ] || return;
ssh-add -l | grep $KEY > /dev/null || ssh-add $KEY