X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=brc2;h=1add8230a8766562b053460b415ce2915afd5018;hb=5cb8fc0c2a8a3f9ffa3cb4d376075c1217eb6d8c;hp=73dc3daaed782cbffc1f3c00e6111a4adc50bb1c;hpb=9ac513d1086f22a8dede2ebe3ca0236443bdc429;p=distro-setup diff --git a/brc2 b/brc2 index 73dc3da..1add823 100644 --- a/brc2 +++ b/brc2 @@ -395,16 +395,27 @@ astudio() { # becomes # https://brains.fsf.org/wiki/sysadmin/interns/2022/nick_shrader/intro_blog_post iki() { - local url path + local url path input if [[ $1 ]]; then - path="$*" + input="$*" else - read -r -p "enter path" path + read -r -p "enter path or url" input fi - url=$(readlink -f "$path") - url="https://brains.fsf.org/wiki/${url#*brains/}" - url="${url%.mdwn}" - echo "$url" + case $input in + http*) + path="/f/brains/${input##https://brains.fsf.org/wiki/}" + if [[ $path == */ ]]; then + path=${path%/}.mdwn + fi + j printf "%s\n" "$path" + ;; + *) + url=$(readlink -f "$input") + url="https://brains.fsf.org/wiki/${url#*brains/}" + url="${url%.mdwn}/" + j echo "$url" + ;; + esac } @@ -1112,6 +1123,8 @@ beet2nav() { # pull in beets library locally beetpull() { + local sshfs_host + sshfs_host=b8.nz if [[ $HOSTNAME == kd ]]; then return 0 fi @@ -1120,7 +1133,7 @@ beetpull() { s chown iank:iank /i fi if ! mountpoint /i &>/dev/null; then - m sshfs b8.nz:/i /i + m sshfs $sshfs_host:/i /i fi } @@ -1292,7 +1305,9 @@ cheogram-get-logs() { adb pull /storage/emulated/0/Download/Cheogram/Backup sqlite3 b /b/data/daystart + else + cat /b/data/daystart + fi +} #### begin bitcoin related things btc() { @@ -2566,9 +2590,17 @@ otp() { oathtool --totp -b "$*" | xclip -selection clipboard } j() { - "$@" |& pee "xclip -r -selection clipboard" + "$@" |& pee "xclip -r -selection clipboard" cat } +# x copy +xc() { + xclip -r -selection clipboard +} +# echo copy +ec() { + pee "xclip -r -selection clipboard" cat +} pakaraoke() { # from http://askubuntu.com/questions/456021/remove-vocals-from-mp3-and-get-only-instrumentals @@ -3152,6 +3184,17 @@ fixu() { fi } +# unmute +um() { + pactl set-sink-mute @DEFAULT_SINK@ false + rm -f /tmp/ianknap +} +nap() { + pactl set-sink-mute @DEFAULT_SINK@ true + touch /tmp/ianknap +} + + # systemctl is-enabled / status / cat says nothing, instead theres # some obscure symlink. paths copied from man systemd.unit. # possibly also usefull, but incomplete, doesnt show units not loaded in memory: