aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mkshrc47
1 files changed, 33 insertions, 14 deletions
diff --git a/mkshrc b/mkshrc
index 4483370..843a5e2 100644
--- a/mkshrc
+++ b/mkshrc
@@ -126,19 +126,23 @@ fi
setaliases() {
alias ls="ls -F";
- alias l="ls -lhF";
+ alias lt="ls -tF";
alias ll="ls -lhF";
+ alias llt="ls -tlhF";
alias g="grep";
- alias m="$PAGER";
+ alias m="more";
alias j="jobs";
alias p="pwd";
- alias gdb='gdb -q'
- alias bc='bc -q'
+ alias c="column"
+ alias ct="column -t"
alias eg='egrep'
- alias search='egrep -rniI'
+ alias search='grep -niRIE'
alias rot13="tr 'A-Za-z' 'N-ZA-Mn-za-m'"
alias setxkbmap-list="man xkeyboard-config"
- alias showsshhosts="awk '/^host /{print \$2}' ~/.ssh/config"
+ alias showsshhosts="awk '/^[hH]ost /{print \$2}' ~/.ssh/config"
+ alias xa='xargs -d'\n' -I{}'
+ alias gdb='gdb -q'
+ alias bc='bc -q'
}
setcoloraliases() {
@@ -373,20 +377,35 @@ pulldotfile() {
file="$1"
pull -u "${UPDATE_URL}${file}" -f "$HOME/.${file}"
}
-pullkeys() {
- _timestamp="$(timestamp)"
- file="keys/$1"
+_make_ssh_dir_if_not_exists() {
auth_keys="$HOME/.ssh/authorized_keys"
- set -x
if ! [ -d $HOME/.ssh ] ; then mkdir $HOME/.ssh ; fi
chmod 700 $HOME/.ssh
chmod 600 $auth_keys
+}
+_pullkeys() {
+ url="$1"; shift
+ _timestamp="$(timestamp)"
+ _make_ssh_dir_if_not_exists
+ auth_keys="$HOME/.ssh/authorized_keys"
mv "$auth_keys" "${auth_keys}.${_timestamp}" || \
- echo "Authorized Keys do not exist"
- pull -u "${UPDATE_URL}${file}" -f "$auth_keys"
- ssh-keygen -lf "$auth_keys" || mv "${auth_keys}.${_timestamp}" "$auth_keys"
+ echo "Authorized Keys do not currently exist"
+ pull -u "$url" -f "$auth_keys" || \
+ mv "${auth_keys}.${_timestamp}" "$auth_keys"
+ ssh-keygen -lf "$auth_keys" || \
+ mv "${auth_keys}.${_timestamp}" "$auth_keys"
+
chmod 600 $auth_keys
- set +x
+}
+pullkeys() {
+ file="keys/$1"; shift;
+ url="${UPDATE_URL}${file}"
+ _pullkeys "$url"
+}
+pullkeys_github() {
+ _username="$1"; shift;
+ url="https://github.com/${_username}.keys"
+ _pullkeys "$url"
}
updatetmuxconf() {
pulldotfile "tmux.conf"