From a28487fe6fbac72c7b1a752acab42dcc6ab46476 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Wed, 28 May 2025 14:24:58 -0400 Subject: Post server fs corruption --- scripts/battery | 6 ----- scripts/cpu-vulns | 2 -- scripts/dbus-sway-environment | 5 ---- scripts/desktop/7z-password | 2 ++ scripts/desktop/battery | 6 +++++ scripts/desktop/cpu-vulns | 2 ++ scripts/desktop/dbus-sway-environment | 5 ++++ scripts/desktop/discord-wayland | 2 ++ scripts/desktop/dmenu-emoji | 2 ++ scripts/desktop/dmenu-path | 3 +++ scripts/desktop/dmenu-path0 | 3 +++ scripts/desktop/gpg-pubkey | 2 ++ scripts/desktop/img-fstype | 2 ++ scripts/desktop/install-as-needed | 5 ++++ scripts/desktop/looking-glass | 2 ++ scripts/desktop/moonrune-charset-utf8 | 6 +++++ scripts/desktop/mount-nfs | 2 ++ scripts/desktop/rewrite-git | 8 ++++++ scripts/desktop/screenshot | 48 +++++++++++++++++++++++++++++++++++ scripts/desktop/shift-jis-zip | 2 ++ scripts/desktop/sp | 6 +++++ scripts/desktop/term-font-size | 20 +++++++++++++++ scripts/desktop/ts-date | 2 ++ scripts/desktop/wlsunset-toggle | 10 ++++++++ scripts/desktop/xbox360-ffmpeg-enc | 2 ++ scripts/discord-wayland | 2 -- scripts/dmenu-emoji | 2 -- scripts/dmenu-path | 3 --- scripts/dmenu-path0 | 3 --- scripts/gpg-pubkey | 2 -- scripts/img-fstype | 2 -- scripts/install-as-needed | 5 ---- scripts/looking-glass | 2 -- scripts/moonrune-charset-utf8 | 6 ----- scripts/mount-nfs | 2 -- scripts/rewrite-git | 8 ------ scripts/screenshot | 48 ----------------------------------- scripts/shift-jis-zip | 2 -- scripts/sp | 6 ----- scripts/sync/diff.sh | 8 ++++++ scripts/sync/pull.sh | 34 +++++++++++++++++++++++++ scripts/sync/push.sh | 34 +++++++++++++++++++++++++ scripts/term-font-size | 20 --------------- scripts/ts-date | 2 -- scripts/wlsunset-toggle | 10 -------- scripts/xbox360-ffmpeg-enc | 2 -- 46 files changed, 218 insertions(+), 140 deletions(-) delete mode 100755 scripts/battery delete mode 100755 scripts/cpu-vulns delete mode 100755 scripts/dbus-sway-environment create mode 100755 scripts/desktop/7z-password create mode 100755 scripts/desktop/battery create mode 100755 scripts/desktop/cpu-vulns create mode 100755 scripts/desktop/dbus-sway-environment create mode 100755 scripts/desktop/discord-wayland create mode 100755 scripts/desktop/dmenu-emoji create mode 100755 scripts/desktop/dmenu-path create mode 100755 scripts/desktop/dmenu-path0 create mode 100755 scripts/desktop/gpg-pubkey create mode 100755 scripts/desktop/img-fstype create mode 100755 scripts/desktop/install-as-needed create mode 100755 scripts/desktop/looking-glass create mode 100755 scripts/desktop/moonrune-charset-utf8 create mode 100755 scripts/desktop/mount-nfs create mode 100755 scripts/desktop/rewrite-git create mode 100755 scripts/desktop/screenshot create mode 100755 scripts/desktop/shift-jis-zip create mode 100755 scripts/desktop/sp create mode 100755 scripts/desktop/term-font-size create mode 100755 scripts/desktop/ts-date create mode 100755 scripts/desktop/wlsunset-toggle create mode 100755 scripts/desktop/xbox360-ffmpeg-enc delete mode 100755 scripts/discord-wayland delete mode 100755 scripts/dmenu-emoji delete mode 100755 scripts/dmenu-path delete mode 100755 scripts/dmenu-path0 delete mode 100755 scripts/gpg-pubkey delete mode 100755 scripts/img-fstype delete mode 100755 scripts/install-as-needed delete mode 100755 scripts/looking-glass delete mode 100755 scripts/moonrune-charset-utf8 delete mode 100755 scripts/mount-nfs delete mode 100755 scripts/rewrite-git delete mode 100755 scripts/screenshot delete mode 100755 scripts/shift-jis-zip delete mode 100755 scripts/sp create mode 100755 scripts/sync/diff.sh create mode 100755 scripts/sync/pull.sh create mode 100755 scripts/sync/push.sh delete mode 100755 scripts/term-font-size delete mode 100755 scripts/ts-date delete mode 100755 scripts/wlsunset-toggle delete mode 100755 scripts/xbox360-ffmpeg-enc (limited to 'scripts') diff --git a/scripts/battery b/scripts/battery deleted file mode 100755 index c09992a..0000000 --- a/scripts/battery +++ /dev/null @@ -1,6 +0,0 @@ -#! /usr/bin/env sh -shopt -s nullglob -for bat in /sys/class/power_supply/BAT* -do -cat $bat/{capacity,status} -done diff --git a/scripts/cpu-vulns b/scripts/cpu-vulns deleted file mode 100755 index e55ad9c..0000000 --- a/scripts/cpu-vulns +++ /dev/null @@ -1,2 +0,0 @@ -#! /usr/bin/env sh -tail -n +1 /sys/devices/system/cpu/vulnerabilities/* diff --git a/scripts/dbus-sway-environment b/scripts/dbus-sway-environment deleted file mode 100755 index 249d610..0000000 --- a/scripts/dbus-sway-environment +++ /dev/null @@ -1,5 +0,0 @@ -#! /usr/bin/env sh - -dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK -systemctl --user stop pipewire{,-pulse}.{socket,service} xdg-desktop-portal xdg-desktop-portal-wlr -systemctl --user start pipewire{,-pulse}.{socket,service} xdg-desktop-portal xdg-desktop-portal-wlr diff --git a/scripts/desktop/7z-password b/scripts/desktop/7z-password new file mode 100755 index 0000000..72e90f9 --- /dev/null +++ b/scripts/desktop/7z-password @@ -0,0 +1,2 @@ +#! /usr/bin/env sh +7z a -p -mhe=on $1 $2 diff --git a/scripts/desktop/battery b/scripts/desktop/battery new file mode 100755 index 0000000..c09992a --- /dev/null +++ b/scripts/desktop/battery @@ -0,0 +1,6 @@ +#! /usr/bin/env sh +shopt -s nullglob +for bat in /sys/class/power_supply/BAT* +do +cat $bat/{capacity,status} +done diff --git a/scripts/desktop/cpu-vulns b/scripts/desktop/cpu-vulns new file mode 100755 index 0000000..e55ad9c --- /dev/null +++ b/scripts/desktop/cpu-vulns @@ -0,0 +1,2 @@ +#! /usr/bin/env sh +tail -n +1 /sys/devices/system/cpu/vulnerabilities/* diff --git a/scripts/desktop/dbus-sway-environment b/scripts/desktop/dbus-sway-environment new file mode 100755 index 0000000..249d610 --- /dev/null +++ b/scripts/desktop/dbus-sway-environment @@ -0,0 +1,5 @@ +#! /usr/bin/env sh + +dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK +systemctl --user stop pipewire{,-pulse}.{socket,service} xdg-desktop-portal xdg-desktop-portal-wlr +systemctl --user start pipewire{,-pulse}.{socket,service} xdg-desktop-portal xdg-desktop-portal-wlr diff --git a/scripts/desktop/discord-wayland b/scripts/desktop/discord-wayland new file mode 100755 index 0000000..ec8a106 --- /dev/null +++ b/scripts/desktop/discord-wayland @@ -0,0 +1,2 @@ +#! /usr/bin/env sh +discord --ignore-gpu-blocklist --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-features=VaapiVideoDecoder --use-gl=desktop --enable-gpu-rasterization --enable-zero-copy diff --git a/scripts/desktop/dmenu-emoji b/scripts/desktop/dmenu-emoji new file mode 100755 index 0000000..07c1900 --- /dev/null +++ b/scripts/desktop/dmenu-emoji @@ -0,0 +1,2 @@ +#! /usr/bin/env sh +jq -r ".[] | .emoji + \" \" + (.aliases[0])" /etc/emoji.json diff --git a/scripts/desktop/dmenu-path b/scripts/desktop/dmenu-path new file mode 100755 index 0000000..9c8122a --- /dev/null +++ b/scripts/desktop/dmenu-path @@ -0,0 +1,3 @@ +#! /usr/bin/env sh +# https://github.com/ema/dotfiles/blob/fb7f5cab530daba74edefb9cecb401262db063a9/bin/dmenu_path +printf $PATH -print0 | tr ':' '\0' | uniq -z | xargs -0 ls -Llu --time-style=+%s | awk '/^(-|l)/ { printf $6" "$7"\n" }' | sort -rn | cut -d' ' -f 2 diff --git a/scripts/desktop/dmenu-path0 b/scripts/desktop/dmenu-path0 new file mode 100755 index 0000000..593ecf6 --- /dev/null +++ b/scripts/desktop/dmenu-path0 @@ -0,0 +1,3 @@ +#! /usr/bin/env sh +# https://github.com/ema/dotfiles/blob/fb7f5cab530daba74edefb9cecb401262db063a9/bin/dmenu_path +printf $PATH -print0 | tr ':' '\0' | uniq -z | xargs -0 ls -Llu --time-style=+%s | awk '/^(-|l)/ { printf $6" "$7"\0" }' | sort -zrn | cut -z -d' ' -f 2 diff --git a/scripts/desktop/gpg-pubkey b/scripts/desktop/gpg-pubkey new file mode 100755 index 0000000..5353972 --- /dev/null +++ b/scripts/desktop/gpg-pubkey @@ -0,0 +1,2 @@ +#! /usr/bin/env sh +gpg --export -a "Andrew Opalach " diff --git a/scripts/desktop/img-fstype b/scripts/desktop/img-fstype new file mode 100755 index 0000000..82df6b8 --- /dev/null +++ b/scripts/desktop/img-fstype @@ -0,0 +1,2 @@ +#! /usr/bin/env sh +blkid -o value -s TYPE $1 diff --git a/scripts/desktop/install-as-needed b/scripts/desktop/install-as-needed new file mode 100755 index 0000000..9db4ff1 --- /dev/null +++ b/scripts/desktop/install-as-needed @@ -0,0 +1,5 @@ +#! /usr/bin/env sh +export NIXPKGS_ALLOW_UNFREE=1 +PKG=$1 +shift +nix shell --impure --expr "with (import (builtins.getFlake ''nixpkgs'') {});$PKG" --command "$@" diff --git a/scripts/desktop/looking-glass b/scripts/desktop/looking-glass new file mode 100755 index 0000000..5ce9cf4 --- /dev/null +++ b/scripts/desktop/looking-glass @@ -0,0 +1,2 @@ +#! /usr/bin/env sh +looking-glass-client -c 192.168.1.192 -f /dev/shm2/looking-glass win:dontUpscale diff --git a/scripts/desktop/moonrune-charset-utf8 b/scripts/desktop/moonrune-charset-utf8 new file mode 100755 index 0000000..d3e8343 --- /dev/null +++ b/scripts/desktop/moonrune-charset-utf8 @@ -0,0 +1,6 @@ +#! /usr/bin/env bash +if [[ "$1" == "china"]]; then + iconv -f GBK -t UTF8 "$2" -o "$3" +elif [[ "$1" == "jp"]]; then + iconv -f SHIFT-JIS -t UTF8 "$2" -o "$3" +fi diff --git a/scripts/desktop/mount-nfs b/scripts/desktop/mount-nfs new file mode 100755 index 0000000..a07f4cf --- /dev/null +++ b/scripts/desktop/mount-nfs @@ -0,0 +1,2 @@ +#! /usr/bin/env sh +sudo mount -t nfs4 -o noatime,nodiratime,rw,hard,fsc,proto=tcp,timeo=600,retrans=2,nfsvers=4,minorversion=2 moyo:$1 $2 diff --git a/scripts/desktop/rewrite-git b/scripts/desktop/rewrite-git new file mode 100755 index 0000000..b48ba4d --- /dev/null +++ b/scripts/desktop/rewrite-git @@ -0,0 +1,8 @@ +#! /usr/bin/env sh +git filter-branch --commit-filter ' + GIT_AUTHOR_NAME="Andrew Opalach"; + GIT_AUTHOR_EMAIL="andrew@akon.city"; + GIT_COMMITTER_NAME="Andrew Opalach"; + GIT_COMMITTER_EMAIL="andrew@akon.city"; + git commit-tree -S "$@"; +' HEAD diff --git a/scripts/desktop/screenshot b/scripts/desktop/screenshot new file mode 100755 index 0000000..ddeb73a --- /dev/null +++ b/scripts/desktop/screenshot @@ -0,0 +1,48 @@ +#! /usr/bin/env bash + +if [[ $1 == "qrcode" || $1 == "color" ]]; then + mime_type="text/plain" +else + dir="$HOME/pics/screenshots/`date +'%m-%Y'`" + if [ ! -d $dir ]; then mkdir -p $dir; fi + while : ; do + filename="screenshot-`date +'%m-%d-%y'`-`hexdump -n 3 -e '1/4 "%02X"' /dev/random`" + [ -e $dir/$filename.* ] || break + done + if [[ $1 == "video" ]]; then + output="$dir/$filename"".mkv" + mime_type="video/x-matroska" + else + output="$dir/$filename"".png" + mime_type="image/png" + fi +fi + +parseqr () { zbarimg -q1 - | cut -d ':' -f 2-; } +parsecolor () { magick - -format '%[pixel:p{0,0}]' txt:- | awk 'END {printf $3}'; } + +if [[ $XDG_SESSION_TYPE == "wayland" ]]; then + copy="wl-copy -t $mime_type" + case $1 in + "qrcode") grim -t png -g "$(slurp)" - | parseqr | $copy ;; + "color") grim -t ppm -g "$(slurp -p)" - | parsecolor | $copy ;; + "video") wf-recorder -a -g "$(slurp)" -f $output ;; + "main") grim -t png -o DP-1 $output ;; + "full") grim -t png $output ;; + "output") grim -t png -g "$(slurp -o)" $output ;; + *) grim -t png -g "$(slurp)" $output ;; + esac +else + copy="xclip -selection clipboard -target $mime_type -i" + case $1 in + "full") import -window root $output ;; + *) + area=$(slop -f "%g") || exit 1 + read -r G < <(echo $area) + import -window root -crop $G $output ;; + esac +fi + +if [[ $1 != "qrcode" && $1 != "color" && $1 != "video" && -f $output ]]; then + cat $output | $copy; +fi diff --git a/scripts/desktop/shift-jis-zip b/scripts/desktop/shift-jis-zip new file mode 100755 index 0000000..30dab2e --- /dev/null +++ b/scripts/desktop/shift-jis-zip @@ -0,0 +1,2 @@ +#! /usr/bin/env sh +unzip -O shift-jis "$1" diff --git a/scripts/desktop/sp b/scripts/desktop/sp new file mode 100755 index 0000000..19d38a1 --- /dev/null +++ b/scripts/desktop/sp @@ -0,0 +1,6 @@ +#! /usr/bin/env sh +if [ $# -eq 0 ]; then + wl-paste | aspell -a +else + echo "$@" | aspell -a +fi diff --git a/scripts/desktop/term-font-size b/scripts/desktop/term-font-size new file mode 100755 index 0000000..0637b12 --- /dev/null +++ b/scripts/desktop/term-font-size @@ -0,0 +1,20 @@ +#! /usr/bin/env python3 + +import array +import fcntl +import termios +import os + +def get_term_res(): + buf = array.array('H', [0, 0, 0, 0]) + fcntl.ioctl(1, termios.TIOCGWINSZ, buf) + return buf[2], buf[3] + +def get_term_dimensions(): + return os.get_terminal_size() + +x_px, y_px = get_term_res() +size = get_term_dimensions() +x_cell, y_cell = size.columns, size.lines + +print('width : {}, height: {}'.format(x_px / float(x_cell), y_px / float(y_cell))) diff --git a/scripts/desktop/ts-date b/scripts/desktop/ts-date new file mode 100755 index 0000000..f16517f --- /dev/null +++ b/scripts/desktop/ts-date @@ -0,0 +1,2 @@ +#! /usr/bin/env sh +date -d @$1 diff --git a/scripts/desktop/wlsunset-toggle b/scripts/desktop/wlsunset-toggle new file mode 100755 index 0000000..7dcd06e --- /dev/null +++ b/scripts/desktop/wlsunset-toggle @@ -0,0 +1,10 @@ +#! /usr/bin/env sh +# | +CORDS=$(cat $HOME/.config/home-cords || echo '') +LAT=$(echo $CORDS | cut -d '|' -f 1) +LONG=$(echo $CORDS | cut -d '|' -f 2) +if pidof wlsunset; then + pkill wlsunset +else + wlsunset -l $LAT -L $LONG & +fi diff --git a/scripts/desktop/xbox360-ffmpeg-enc b/scripts/desktop/xbox360-ffmpeg-enc new file mode 100755 index 0000000..aab754f --- /dev/null +++ b/scripts/desktop/xbox360-ffmpeg-enc @@ -0,0 +1,2 @@ +#! /usr/bin/env sh +ffmpeg -i "$1" -c:a aac -strict experimental -ac 2 -c:v libx264 -profile:v high -crf 23 "$2" diff --git a/scripts/discord-wayland b/scripts/discord-wayland deleted file mode 100755 index ec8a106..0000000 --- a/scripts/discord-wayland +++ /dev/null @@ -1,2 +0,0 @@ -#! /usr/bin/env sh -discord --ignore-gpu-blocklist --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-features=VaapiVideoDecoder --use-gl=desktop --enable-gpu-rasterization --enable-zero-copy diff --git a/scripts/dmenu-emoji b/scripts/dmenu-emoji deleted file mode 100755 index 07c1900..0000000 --- a/scripts/dmenu-emoji +++ /dev/null @@ -1,2 +0,0 @@ -#! /usr/bin/env sh -jq -r ".[] | .emoji + \" \" + (.aliases[0])" /etc/emoji.json diff --git a/scripts/dmenu-path b/scripts/dmenu-path deleted file mode 100755 index 9c8122a..0000000 --- a/scripts/dmenu-path +++ /dev/null @@ -1,3 +0,0 @@ -#! /usr/bin/env sh -# https://github.com/ema/dotfiles/blob/fb7f5cab530daba74edefb9cecb401262db063a9/bin/dmenu_path -printf $PATH -print0 | tr ':' '\0' | uniq -z | xargs -0 ls -Llu --time-style=+%s | awk '/^(-|l)/ { printf $6" "$7"\n" }' | sort -rn | cut -d' ' -f 2 diff --git a/scripts/dmenu-path0 b/scripts/dmenu-path0 deleted file mode 100755 index 593ecf6..0000000 --- a/scripts/dmenu-path0 +++ /dev/null @@ -1,3 +0,0 @@ -#! /usr/bin/env sh -# https://github.com/ema/dotfiles/blob/fb7f5cab530daba74edefb9cecb401262db063a9/bin/dmenu_path -printf $PATH -print0 | tr ':' '\0' | uniq -z | xargs -0 ls -Llu --time-style=+%s | awk '/^(-|l)/ { printf $6" "$7"\0" }' | sort -zrn | cut -z -d' ' -f 2 diff --git a/scripts/gpg-pubkey b/scripts/gpg-pubkey deleted file mode 100755 index 5353972..0000000 --- a/scripts/gpg-pubkey +++ /dev/null @@ -1,2 +0,0 @@ -#! /usr/bin/env sh -gpg --export -a "Andrew Opalach " diff --git a/scripts/img-fstype b/scripts/img-fstype deleted file mode 100755 index 82df6b8..0000000 --- a/scripts/img-fstype +++ /dev/null @@ -1,2 +0,0 @@ -#! /usr/bin/env sh -blkid -o value -s TYPE $1 diff --git a/scripts/install-as-needed b/scripts/install-as-needed deleted file mode 100755 index 9db4ff1..0000000 --- a/scripts/install-as-needed +++ /dev/null @@ -1,5 +0,0 @@ -#! /usr/bin/env sh -export NIXPKGS_ALLOW_UNFREE=1 -PKG=$1 -shift -nix shell --impure --expr "with (import (builtins.getFlake ''nixpkgs'') {});$PKG" --command "$@" diff --git a/scripts/looking-glass b/scripts/looking-glass deleted file mode 100755 index 5ce9cf4..0000000 --- a/scripts/looking-glass +++ /dev/null @@ -1,2 +0,0 @@ -#! /usr/bin/env sh -looking-glass-client -c 192.168.1.192 -f /dev/shm2/looking-glass win:dontUpscale diff --git a/scripts/moonrune-charset-utf8 b/scripts/moonrune-charset-utf8 deleted file mode 100755 index d3e8343..0000000 --- a/scripts/moonrune-charset-utf8 +++ /dev/null @@ -1,6 +0,0 @@ -#! /usr/bin/env bash -if [[ "$1" == "china"]]; then - iconv -f GBK -t UTF8 "$2" -o "$3" -elif [[ "$1" == "jp"]]; then - iconv -f SHIFT-JIS -t UTF8 "$2" -o "$3" -fi diff --git a/scripts/mount-nfs b/scripts/mount-nfs deleted file mode 100755 index a07f4cf..0000000 --- a/scripts/mount-nfs +++ /dev/null @@ -1,2 +0,0 @@ -#! /usr/bin/env sh -sudo mount -t nfs4 -o noatime,nodiratime,rw,hard,fsc,proto=tcp,timeo=600,retrans=2,nfsvers=4,minorversion=2 moyo:$1 $2 diff --git a/scripts/rewrite-git b/scripts/rewrite-git deleted file mode 100755 index b48ba4d..0000000 --- a/scripts/rewrite-git +++ /dev/null @@ -1,8 +0,0 @@ -#! /usr/bin/env sh -git filter-branch --commit-filter ' - GIT_AUTHOR_NAME="Andrew Opalach"; - GIT_AUTHOR_EMAIL="andrew@akon.city"; - GIT_COMMITTER_NAME="Andrew Opalach"; - GIT_COMMITTER_EMAIL="andrew@akon.city"; - git commit-tree -S "$@"; -' HEAD diff --git a/scripts/screenshot b/scripts/screenshot deleted file mode 100755 index ddeb73a..0000000 --- a/scripts/screenshot +++ /dev/null @@ -1,48 +0,0 @@ -#! /usr/bin/env bash - -if [[ $1 == "qrcode" || $1 == "color" ]]; then - mime_type="text/plain" -else - dir="$HOME/pics/screenshots/`date +'%m-%Y'`" - if [ ! -d $dir ]; then mkdir -p $dir; fi - while : ; do - filename="screenshot-`date +'%m-%d-%y'`-`hexdump -n 3 -e '1/4 "%02X"' /dev/random`" - [ -e $dir/$filename.* ] || break - done - if [[ $1 == "video" ]]; then - output="$dir/$filename"".mkv" - mime_type="video/x-matroska" - else - output="$dir/$filename"".png" - mime_type="image/png" - fi -fi - -parseqr () { zbarimg -q1 - | cut -d ':' -f 2-; } -parsecolor () { magick - -format '%[pixel:p{0,0}]' txt:- | awk 'END {printf $3}'; } - -if [[ $XDG_SESSION_TYPE == "wayland" ]]; then - copy="wl-copy -t $mime_type" - case $1 in - "qrcode") grim -t png -g "$(slurp)" - | parseqr | $copy ;; - "color") grim -t ppm -g "$(slurp -p)" - | parsecolor | $copy ;; - "video") wf-recorder -a -g "$(slurp)" -f $output ;; - "main") grim -t png -o DP-1 $output ;; - "full") grim -t png $output ;; - "output") grim -t png -g "$(slurp -o)" $output ;; - *) grim -t png -g "$(slurp)" $output ;; - esac -else - copy="xclip -selection clipboard -target $mime_type -i" - case $1 in - "full") import -window root $output ;; - *) - area=$(slop -f "%g") || exit 1 - read -r G < <(echo $area) - import -window root -crop $G $output ;; - esac -fi - -if [[ $1 != "qrcode" && $1 != "color" && $1 != "video" && -f $output ]]; then - cat $output | $copy; -fi diff --git a/scripts/shift-jis-zip b/scripts/shift-jis-zip deleted file mode 100755 index 30dab2e..0000000 --- a/scripts/shift-jis-zip +++ /dev/null @@ -1,2 +0,0 @@ -#! /usr/bin/env sh -unzip -O shift-jis "$1" diff --git a/scripts/sp b/scripts/sp deleted file mode 100755 index 19d38a1..0000000 --- a/scripts/sp +++ /dev/null @@ -1,6 +0,0 @@ -#! /usr/bin/env sh -if [ $# -eq 0 ]; then - wl-paste | aspell -a -else - echo "$@" | aspell -a -fi diff --git a/scripts/sync/diff.sh b/scripts/sync/diff.sh new file mode 100755 index 0000000..61ff628 --- /dev/null +++ b/scripts/sync/diff.sh @@ -0,0 +1,8 @@ +#! /usr/bin/env sh +set -e +REMOTE="$(cat remote)" +if [ ! -d $REMOTE ]; then + echo "Path $REMOTE does not exist." + exit 1 +fi +diff --brief --recursive --new-file --no-dereference . $REMOTE diff --git a/scripts/sync/pull.sh b/scripts/sync/pull.sh new file mode 100755 index 0000000..1bf5b48 --- /dev/null +++ b/scripts/sync/pull.sh @@ -0,0 +1,34 @@ +#! /usr/bin/env sh + +set -e + +SOURCE="$(cat remote)/" +if [ ! -d $SOURCE ]; then + echo "Path $SOURCE does not exist." + exit 1 +fi + +ARGS=() +FORCE=0 +while getopts 'cfdr' opt; do + case "$opt" in + c) # Changes + ARGS+=('--delete') + ;; + f) # Full + ARGS+=('--checksum') + ;; + d) # Dry + ARGS+=('--dry-run') + ;; + r) # Revert + FORCE=1 + ;; + esac +done + +if [ $FORCE = 0 ]; then + ARGS+=('--update') +fi + +rsync --archive --itemize-changes "${ARGS[@]}" $SOURCE . diff --git a/scripts/sync/push.sh b/scripts/sync/push.sh new file mode 100755 index 0000000..3adbd02 --- /dev/null +++ b/scripts/sync/push.sh @@ -0,0 +1,34 @@ +#! /usr/bin/env sh + +set -e + +DEST="$(cat remote)" +if [ ! -d $DEST ]; then + echo "Path $DEST does not exist." + exit 1 +fi + +ARGS=() +FORCE=0 +while getopts 'cfdr' opt; do + case "$opt" in + c) # Changes + ARGS+=('--delete') + ;; + f) # Full + ARGS+=('--checksum') + ;; + d) # Dry + ARGS+=('--dry-run') + ;; + r) # Revert + FORCE=1 + ;; + esac +done + +if [ $FORCE = 0 ]; then + ARGS+=('--update') +fi + +rsync --archive --itemize-changes "${ARGS[@]}" ./ $DEST diff --git a/scripts/term-font-size b/scripts/term-font-size deleted file mode 100755 index 0637b12..0000000 --- a/scripts/term-font-size +++ /dev/null @@ -1,20 +0,0 @@ -#! /usr/bin/env python3 - -import array -import fcntl -import termios -import os - -def get_term_res(): - buf = array.array('H', [0, 0, 0, 0]) - fcntl.ioctl(1, termios.TIOCGWINSZ, buf) - return buf[2], buf[3] - -def get_term_dimensions(): - return os.get_terminal_size() - -x_px, y_px = get_term_res() -size = get_term_dimensions() -x_cell, y_cell = size.columns, size.lines - -print('width : {}, height: {}'.format(x_px / float(x_cell), y_px / float(y_cell))) diff --git a/scripts/ts-date b/scripts/ts-date deleted file mode 100755 index f16517f..0000000 --- a/scripts/ts-date +++ /dev/null @@ -1,2 +0,0 @@ -#! /usr/bin/env sh -date -d @$1 diff --git a/scripts/wlsunset-toggle b/scripts/wlsunset-toggle deleted file mode 100755 index 7dcd06e..0000000 --- a/scripts/wlsunset-toggle +++ /dev/null @@ -1,10 +0,0 @@ -#! /usr/bin/env sh -# | -CORDS=$(cat $HOME/.config/home-cords || echo '') -LAT=$(echo $CORDS | cut -d '|' -f 1) -LONG=$(echo $CORDS | cut -d '|' -f 2) -if pidof wlsunset; then - pkill wlsunset -else - wlsunset -l $LAT -L $LONG & -fi diff --git a/scripts/xbox360-ffmpeg-enc b/scripts/xbox360-ffmpeg-enc deleted file mode 100755 index aab754f..0000000 --- a/scripts/xbox360-ffmpeg-enc +++ /dev/null @@ -1,2 +0,0 @@ -#! /usr/bin/env sh -ffmpeg -i "$1" -c:a aac -strict experimental -ac 2 -c:v libx264 -profile:v high -crf 23 "$2" -- cgit v1.2.3-101-g0448