From 756b45f57d19dc06deefa848bd4efbed7151fe55 Mon Sep 17 00:00:00 2001 From: "Skylar \"The Cobra\" Widulski" Date: Sun, 6 Nov 2022 08:21:14 -0500 Subject: [PATCH] Update Signed-off-by: Skylar "The Cobra" Widulski --- .bashrc | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/.bashrc b/.bashrc index 8e9f3c9..7d778a9 100644 --- a/.bashrc +++ b/.bashrc @@ -12,22 +12,23 @@ export HISTFILESIZE=1000 export HISTSIZE=1000 export GPG_TTY=$(tty) + +clear() { + printf '\033c' # faster than ncurses clear by a lot +} + # 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 | xargs' alias curl='curl -L' alias prof='profanity' @@ -152,13 +153,36 @@ playcd() { mpv --start=00:00:00.0000000 av://libcdio:/dev/cdrom --cache=yes } +playdvd() { + mpv --start=00:00:00.0000000 dvd:///dev/sr0 --cache=yes +} + gpginfo() { gpg --with-colons --import-options show-only --import } -baseto() { - local i="$1" - local o="$2" - shift 2 - bc <<< "obase=$o;$(($i#$*))" +lc() { + fc -nl $HISTCMD | sed 's/^\s*//' +} + +baseto() { + if [ $# -ge 3 ]; then + local i="$1" + local o="$2" + shift 2 + bc <<< "obase=$o;$(($i#$*))" + else + local line i o n + while read -r line; do + read -r i o n <<< "$line" + bc <<< "obase=$o;$(($i#$n))" + done + fi +} + +rebash() { . ~/.bashrc; } +bashrc() { "$EDITOR" ~/.bashrc && rebash; } + +curplot() { + ssh typhoon "~/gnuplot/gnuplot.sh; cat ~/gnuplot/$(date -I).svg" > $(date -I).svg }