# Source other files [ -r ~/.prompt ] && . ~/.prompt [ -r ~/.devspec ] && . ~/.devspec [ -r ~/.config/isotope.dark ] && . ~/.config/isotope.dark # History stuff export HISTCONTROL=ignoredups:erasedups export HISTFILESIZE=1000 export HISTSIZE=1000 export GPG_TTY=$(tty) # We hate sudo here alias sudo='sh -c "exit 1"' # Other aliases alias clear="printf '\033c'" # faster than ncurses clear by a lot alias c='clear' alias ls='ls --color=auto -FAh' alias ll='ls -l' alias rebash='. ~/.bashrc' alias bashrc="$EDITOR ~/.bashrc && rebash" alias nf='neofetch' alias sshd='boas /usr/sbin/sshd' alias ga='git add' alias gc='git commit -sS' alias gp='git push' alias wv='mpv $($PASTE_COMMAND)' alias lc='fc -nl $HISTCMD' alias curl='curl -L' # Completions for elevation program (https://codeberg.org/Bowuigi/Unit21 in management/boas) complete -cf boas # Random string (passwords) randstr() { tr -cd '[:graph:]' >($COPY_COMMAND) } # URL-encode stdin urlencode() { LC_COLLATE_OLD=$LC_COLLATE LC_COLLATE=C local TEXT="$( /dev/null \;; } fixdh() { diffhome | while read -r _ SRC _ DEST _; do cp $SRC $DEST; done; } strlen() { N=$(wc -c <<< "$*") ((N--)) printf '%u\n' "$N" } uppweb() { pushd ~/git/cobra.vern.cc local DIR="/home/cobra/git/cobra.vern.cc" rsync -rtvzP --exclude ".git" --exclude ".gitignore" --exclude 'README.md' --exclude 'LICENSE' $DIR/* vern.cc:~/public_html/ popd } upvweb() { pushd ~/git/website rsync --rsh='ssh -p1813' -rtvzP --exclude '.git' --exclude 'LICENSE' /home/cobra/git/website/ root@vern.cc:/var/www/website popd } upvgem() { pushd ~/git/gemini rsync --rsh='ssh -p1813' -rtvzP --exclude '.git' --exclude 'LICENSE' /home/cobra/git/gemini/ root@vern.cc:/home/gemini/gemini/vern.cc popd } pubdate() { date +'%a, %d %b %Y %T %z' }