From 9120b0d3119ca5f59f699e17c18a352d6efc8a1f Mon Sep 17 00:00:00 2001 From: Artem Sapegin Date: Thu, 14 Mar 2013 23:22:32 +0400 Subject: [PATCH] Bash: few tweaks. --- includes/bash_aliases.bash | 3 +++ includes/bash_functions.bash | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/bash_aliases.bash b/includes/bash_aliases.bash index bdb09fb..ba56fd6 100644 --- a/includes/bash_aliases.bash +++ b/includes/bash_aliases.bash @@ -102,6 +102,9 @@ gi() { grunt-init $@; } alias venv='test -d ENV && source ./ENV/bin/activate || echo "No Virtualenv in the current folder."' alias venv-init='test -d ENV && echo "Virtualenv already exists." || virtualenv --no-site-packages ENV; venv' +# Restart Linux service +rstr() { sudo service $@ restart } + # Magic Project Opener function proj { cd "$("$HOME/dotfiles/bin/opener.py" "$HOME/Dropbox/Projects" $1 -w project $2)"; } function repo { cd "$("$HOME/dotfiles/bin/opener.py" "$HOME/Dropbox/Projects" $1 -w repo $2)"; } diff --git a/includes/bash_functions.bash b/includes/bash_functions.bash index 70098ac..71c8133 100644 --- a/includes/bash_functions.bash +++ b/includes/bash_functions.bash @@ -111,8 +111,7 @@ ssh-key() { ssh-keygen -t rsa fi - cat "$file" | c - echo "Your public key copied to clipboard." + cat "$file" } # Create an SSH key and uploads it to the given host @@ -297,6 +296,6 @@ function sayit() { } # Add special aliases that will copy result to clipboard (escape → escape+) -for cmd in password hex2hsl hex2rgb escape codepoint; do +for cmd in password hex2hsl hex2rgb escape codepoint ssh-key; do eval "function $cmd+() { $cmd \$@ | c; }" done