URI: 
       tUpdate scripts - scripts - random scripts
  HTML git clone git://parazyd.org/scripts.git
   DIR Log
   DIR Files
   DIR Refs
       ---
   DIR commit f962c7f6a41d68e890bd5e290c88346f475e706d
   DIR parent 1df7990d32656860dd6d464a9b3d6bed8e29861b
  HTML Author: parazyd <parazyd@dyne.org>
       Date:   Tue, 25 Dec 2018 10:48:07 -0500
       
       Update scripts
       
       Diffstat:
         M autoup                              |      75 ++++++++++++++++---------------
         M chandl                              |      34 ++++++++++++++++----------------
         M chrono                              |       5 +----
         M chronoclock                         |       5 +----
         M dict                                |      34 +++++++++++++------------------
         D elem                                |       2 --
         M emerupd                             |      30 ++++++++++++++++++++++--------
         A eth0                                |       2 ++
         M extmon                              |       2 +-
         M ff                                  |       3 ++-
         M gopherholes                         |       5 +----
         M gw                                  |      18 ++++++++----------
         T imgur                               |       0 
         M irssi                               |       8 +-------
         A macspoof                            |      20 ++++++++++++++++++++
         D macspoof.sh                         |      20 --------------------
         M magnet2torrent                      |       1 -
         M ncmpcpp                             |       4 +++-
         R lmgtfy -> notinpath/obsolete/lmgtfy |       0 
         R portscan.py -> notinpath/obsolete/… |       0 
         M notinpath/obsolete/urban            |       3 +++
         A openssl-newcert                     |       3 +++
         M ptpb                                |      33 +++++++++++++++++++------------
         M qemu-kvm                            |      25 ++++++++++++-------------
         M radio                               |       8 +++++++-
         D susp                                |       9 ---------
         A theo                                |       3 +++
         A troll                               |       2 ++
         M volume                              |      36 ++++++++++++++++----------------
         D wd                                  |       3 ---
         D wifi                                |      34 -------------------------------
         A wlan0                               |      34 +++++++++++++++++++++++++++++++
       
       32 files changed, 233 insertions(+), 228 deletions(-)
       ---
   DIR diff --git a/autoup b/autoup
       t@@ -4,48 +4,49 @@ webroot=/home/parazyd/public_html/parazyd.org/pub
        webdir=dev/random
        
        case "$1" in
       -        -p)
       -                shift
       -                webdir=tmp/priv
       -                ;;
       -        -n)
       -                shift
       -                webdir=dev/null
       -                ;;
       -        -f)
       -                shift
       -                webdir=tmp/photo
       -                ;;
       +-p)
       +        shift
       +        webdir=tmp/priv
       +        ;;
       +-n)
       +        shift
       +        webdir=dev/null
       +        ;;
       +-f)
       +        shift
       +        webdir=tmp/photo
       +        ;;
        esac
        
        
       -test -z "$1" && exit 1 || filename=$(basename $1)
       +test -z "$1" && exit 1
       +filename=$(basename $1)
        
        case "$filename" in
       -        *_scrot.*|mpv-shot*.*)
       -                webdir=tmp/screenshots
       -                num=$(echo $(lynx -dump https://$server/pub/tmp/screenshots \
       -                        | tail -n1 | tr -d '[a-z]./:' | awk '{print $2}') + 1 | bc)
       -                if [ "$num" -lt 100 ]; then
       -                        num="00$num"
       -                elif [ "$num" -lt 1000 ]; then
       -                        num="0$num"
       -                fi
       -                filename="screenshot${num}.${filename##*.}"
       -                goph=I
       -                ;;
       -        *.png|*.jpg|*.jpeg|.JPG|.JPEG)
       -                goph=I
       -                ;;
       -        *.txt|*.html|*.css|*.sh)
       -                goph=0
       -                ;;
       -        *.gif)
       -                goph=g
       -                ;;
       -        *)
       -                goph=9
       -                ;;
       +*_scrot.*|mpv-shot*.*)
       +        webdir=tmp/screenshots
       +        num=$(echo $(lynx -dump https://$server/pub/tmp/screenshots \
       +                | tail -n1 | tr -d '[a-z]./:' | awk '{print $2}') + 1 | bc)
       +        if [ "$num" -lt 100 ]; then
       +                num="00$num"
       +        elif [ "$num" -lt 1000 ]; then
       +                num="0$num"
       +        fi
       +        filename="screenshot${num}.${filename##*.}"
       +        goph=I
       +        ;;
       +*.png|*.jpg|*.jpeg|*.JPG|*.JPEG)
       +        goph=I
       +        ;;
       +*.txt|*.html|*.css|*.sh|*.c)
       +        goph=0
       +        ;;
       +*.gif)
       +        goph=g
       +        ;;
       +*)
       +        goph=9
       +        ;;
        esac
        
        scp "$1" "${server}:${webroot}/${webdir}/${filename}" || exit 1
   DIR diff --git a/chandl b/chandl
       t@@ -1,23 +1,23 @@
        #!/bin/sh
        
        case "$1" in
       -        *boards.4chan.org*)
       -                imgs='i.4cdn.org'
       -                ;;
       -        *8ch.net*)
       -                imgs='media.8ch.net'
       -                ;;
       -        *lainchan.org*)
       -                imgs='.* https:\/\/lainchan.org\/.*\/src\/'
       -                ;;
       -        *arisuchan.jp*)
       -                imgs='.* https:\/\/arisuchan.jp\/.*/src\/'
       -                ;;
       -        *)
       -                echo 'Unsupported URL.'
       -                exit 1
       -                ;;
       +*boards.4chan.org*)
       +        imgs='i.4cdn.org'
       +        ;;
       +*8ch.net*)
       +        imgs='media.8ch.net'
       +        ;;
       +*lainchan.org*)
       +        imgs='.* https:\/\/lainchan.org\/.*\/src\/'
       +        ;;
       +*arisuchan.jp*)
       +        imgs='.* https:\/\/arisuchan.jp\/.*/src\/'
       +        ;;
       +*)
       +        echo 'Unsupported URL.'
       +        exit 1
       +        ;;
        esac
        
        lynx -dump "$1" | awk '/^References/,EOF' | awk '/'"$imgs"'/ {print $2}' |
       -        sort | uniq | while read foo ; do wget -c $foo ; done
       +        sort | uniq | while read foo ; do wget -c "$foo" ; done
   DIR diff --git a/chrono b/chrono
       t@@ -1,10 +1,7 @@
        #!/bin/sh
       -#
       -# parazyd - (c) wtfpl 2016
        # fonts: xsansb future smblock univers
        
       -FONT=$1
       -: ${FONT:="future"}
       +FONT=${1:-future}
        
        for m in $(seq 0 59); do
            for s in $(seq 0 59); do
   DIR diff --git a/chronoclock b/chronoclock
       t@@ -1,10 +1,7 @@
        #!/bin/sh
       -#
       -# parazyd - (c) wtfpl 2016
        # fonts: xsansb future smblock univers
        
       -FONT=$1
       -: ${FONT:="future"}
       +FONT=${FONT:-future}
        
        while true; do
                clear
   DIR diff --git a/dict b/dict
       t@@ -1,23 +1,17 @@
        #!/bin/sh
       -
        case "$(basename $0)" in
       -
       -        cheat)
       -                curl -s http://cheat.sh/$1
       -                ;;
       -
       -        dict)
       -                term="$*"
       -                curl -s dict://dict.org/d:"'$term'"
       -                ;;
       -
       -        urban)
       -                term="$*"
       -                curl -s dict://parazyd.org/d:"'$term'"
       -                ;;
       -
       -        wttr)
       -                curl -s http://wttr.in/$1
       -                ;;
       -
       +cheat)
       +        curl -s "http://cheat.sh/$1"
       +        ;;
       +dict)
       +        term="$*"
       +        curl -s dict://dict.org/d:"'$term'"
       +        ;;
       +urban)
       +        term="$*"
       +        curl -s dict://parazyd.org/d:"'$term'"
       +        ;;
       +wttr)
       +        curl -s "http://wttr.in/$1"
       +        ;;
        esac
   DIR diff --git a/elem b/elem
       t@@ -1 +0,0 @@
       -wd
       -\ No newline at end of file
   DIR diff --git a/emerupd b/emerupd
       t@@ -18,12 +18,26 @@ EOM
        }
        
        case "x$1" in
       -        x1|x-1) sudo eix-sync -a;;
       -        x2|x-2) sudo emerge -av --verbose-conflicts --with-bdeps=y --update --newuse --deep @world && \
       -                        sudo emerge -av @smart-live-rebuild ;;
       -        x3|x-3) sudo glsa-check -t all ;;
       -        x4|x-4) sudo emerge -av --depclean ;;
       -        x5|x-5) sudo emerge -av @preserved-rebuild ;;
       -        x6|x-6) sudo revdep-rebuild.sh -v ;;
       -        *) usage ;;
       +x1)
       +        sudo eix-sync -a
       +        ;;
       +x2)
       +        sudo emerge -avuDN --verbose-conflicts --with-bdeps=y @world && \
       +        sudo emerge -av @smart-live-rebuild
       +        ;;
       +x3)
       +        sudo glsa-check -t all
       +        ;;
       +x4)
       +        sudo emerge -av --depclean
       +        ;;
       +x5)
       +        sudo emerge -av @preserved-rebuild
       +        ;;
       +x6)
       +        sudo revdep-rebuild.sh -v
       +        ;;
       +*)
       +        usage
       +        ;;
        esac
   DIR diff --git a/eth0 b/eth0
       t@@ -0,0 +1 @@
       +wlan0
       +\ No newline at end of file
   DIR diff --git a/extmon b/extmon
       t@@ -3,7 +3,7 @@
        # parazyd - (c) wtfpl 2017
        # skreenz
        
       - IN="${IN:-eDP-1}"
       +IN="${IN:-eDP-1}"
        EXT="${EXT:-HDMI-2}"
        
        
   DIR diff --git a/ff b/ff
       t@@ -1,2 +1,3 @@
        #!/bin/sh
       -xhost si:localuser:ff && exec sudo -u ff firefox -no-remote -ProfileManager "$@"
       +xhost si:localuser:ff && \
       +        exec sudo -u ff firefox -no-remote -ProfileManager "$@"
   DIR diff --git a/gopherholes b/gopherholes
       t@@ -1,7 +1,4 @@
        #!/bin/sh
       -
        hole="$(cat ~/gopherholes | dmenu -l 20 | awk '{print $1}')"
       -
        [ -n "$hole" ] || exit 1
       -
       -printf "gopher://%s" "${hole}" | plumb
       +printf "gopher://%s" "${hole}" | p
   DIR diff --git a/gw b/gw
       t@@ -1,12 +1,10 @@
       -#!/bin/dash
       -
       -#This prints random words from the linux dictionary.
       -
       +#!/bin/sh
       +# This prints random words from the linux dictionary.
        case "$1" in
       -        h)
       -                echo "$(shuf -n 32 ~/HappyWords.TXT --random-source=/dev/urandom | tr '\n' ' ')"
       -                ;;
       -        *)
       -                echo "$(shuf -n 32 /usr/share/dict/words --random-source=/dev/urandom | tr '\n' ' ')"
       -                ;;
       +h)
       +        echo "$(shuf -n 32 ~/HappyWords.TXT --random-source=/dev/urandom | tr '\n' ' ')"
       +        ;;
       +*)
       +        echo "$(shuf -n 32 /usr/share/dict/words --random-source=/dev/urandom | tr '\n' ' ')"
       +        ;;
        esac
   DIR diff --git a/imgur b/imgur
   DIR diff --git a/irssi b/irssi
       t@@ -1,8 +1,2 @@
        #!/bin/sh
       -
       -abduco -a irssi || {
       -        gpg --decrypt ~/.irssi/config.gpg > ~/.irssi/config && \
       -        abduco -c irssi /usr/bin/irssi
       -}
       -
       -rm -f ~/.irssi/config
       +abduco -a irssi || abduco -c irssi /usr/bin/irssi
   DIR diff --git a/macspoof b/macspoof
       t@@ -0,0 +1,20 @@
       +#!/bin/sh
       +#
       +# parazyd - (c) wtfpl 2017
       +# spoof or restore mac
       +
       +case "$1" in
       +-p)
       +        sup net "$2" stop
       +        sudo macchanger -A "$2"
       +        sup net "$2" start
       +        ;;
       +-r)
       +        sup net "$2" stop
       +        sudo macchanger -p "$2"
       +        sup net "$2" start
       +        ;;
       +*)
       +        printf "usage: %s {-p [orig]|-r [random]} netdev\n" "$(basename $0)"
       +        ;;
       +esac
   DIR diff --git a/macspoof.sh b/macspoof.sh
       t@@ -1,20 +0,0 @@
       -#!/bin/sh
       -#
       -# parazyd - (c) wtfpl 2017
       -# spoof or restore mac
       -
       -case "$1" in
       -        -p)
       -                sup net "$2" stop
       -                sudo macchanger -A "$2"
       -                sup net "$2" start
       -                ;;
       -        -r)
       -                sup net "$2" stop
       -                sudo macchanger -p "$2"
       -                sup net "$2" start
       -                ;;
       -        *)
       -                printf "usage: %s {-p [orig]|-r [random]} netdev\n" "$(basename $0)"
       -                ;;
       -esac
   DIR diff --git a/magnet2torrent b/magnet2torrent
       t@@ -1,4 +1,3 @@
        #!/bin/bash
       -
        [[ "$1" =~ xt=urn:btih:([^&/]+) ]] || exit 1
        echo "d10:magnet-uri${#1}:${1}e" > "meta-${BASH_REMATCH[1]}.torrent"
   DIR diff --git a/ncmpcpp b/ncmpcpp
       t@@ -1,4 +1,6 @@
        #!/bin/sh
        
       -pgrep -F ~/.config/mpd/pid || mpd ~/.config/mpd/mpd.conf
       +if [ -z "$MPD_HOST" ]; then
       +        pgrep -F ~/.config/mpd/pid || mpd ~/.config/mpd/mpd.conf
       +fi
        exec /usr/bin/ncmpcpp "$@"
   DIR diff --git a/lmgtfy b/notinpath/obsolete/lmgtfy
   DIR diff --git a/portscan.py b/notinpath/obsolete/portscan.py
   DIR diff --git a/notinpath/obsolete/urban b/notinpath/obsolete/urban
       t@@ -13,6 +13,9 @@ term="$(echo $term | sed 's/ /%20/g')"
        
        data="$(curl -s "${api}${term}" | jq '.list')"
        
       +echo "$data" | jq '.[0]'
       +exit 0
       +
        for i in $(seq 1 3); do
                def="$(echo "$data" | jq '.['$i'].definition')"
                [ "$def" = null ] && break
   DIR diff --git a/openssl-newcert b/openssl-newcert
       t@@ -0,0 +1,3 @@
       +#!/bin/sh
       +
       +openssl req -x509 -newkey rsa:4096 -keyout server-key.pem -out server.pem -days 10000 -nodes
   DIR diff --git a/ptpb b/ptpb
       t@@ -1,16 +1,23 @@
        #!/bin/sh
       -
        case "$(basename $0)" in
       -        ptpb)
       -                curl -F c=@- https://ptpb.pw/?u=1
       -                ;;
       -        ixio)
       -                curl -F 'f:1=<-' http://ix.io
       -                ;;
       -        sprunge)
       -                curl -F 'sprunge=<-' http://sprunge.us
       -                ;;
       -        blck)
       -                curl -F "url=$1" https://blck.cf
       -                ;;
       +ptpb)
       +        curl -F c=@- 'https://ptpb.pw/?u=1'
       +        ;;
       +ixio)
       +        curl -F 'f:1=<-' 'http://ix.io'
       +        ;;
       +sprunge)
       +        curl -F 'sprunge=<-' 'http://sprunge.us'
       +        ;;
       +blck)
       +        curl -F "url=$1" 'https://blck.cf'
       +        ;;
       +imgur)
       +        # clientid: 0017a6971e629f3
       +        # clientsecret: d23454369327aed1943aac01bec1921bf6a53c1c
       +        curl -s -H "Authorization: Client-ID 0017a6971e629f3" \
       +                -H "Expect: " -F "image=@$1" \
       +                https://api.imgur.com/3/image.json \
       +                | jq -sr '.[]data.link'
       +        ;;
        esac
   DIR diff --git a/qemu-kvm b/qemu-kvm
       t@@ -1,15 +1,14 @@
       -#!/bin/dash
       -
       +#!/bin/sh
        case "$1" in
       -        amd*)
       -                shift
       -                exec qemu-system-x86_64 -enable-kvm "$@"
       -                ;;
       -        i386)
       -                shift
       -                exec qemu-system-i386 -enable-kvm "$@"
       -                ;;
       -        *)
       -                exec qemu-system-x86_64 -enable-kvm "$@"
       -                ;;
       +amd*)
       +        shift
       +        exec qemu-system-x86_64 -enable-kvm "$@"
       +        ;;
       +i386)
       +        shift
       +        exec qemu-system-i386 -enable-kvm "$@"
       +        ;;
       +*)
       +        exec qemu-system-x86_64 -enable-kvm "$@"
       +        ;;
        esac
   DIR diff --git a/radio b/radio
       t@@ -15,11 +15,13 @@ list of radios:
            8. NOPE
            9. Radio Paradise
           10. Bitreich radio
       +   11. Radio 101
        EOM
            exit 1
        }
        
        play() {
       +    #/usr/bin/mpv --audio-device=alsa/hdmi:CARD=PCH,DEV=0 --no-video "$@"
            /usr/bin/mpv --no-video "$@"
        }
        
       t@@ -32,8 +34,12 @@ case "$1" in
            6|yammat)     play "http://yammat.fm/yammat.pls" ;;
            7|klfm)       play "http://klfm.streamradio.com.hr:2199/tunein/klfm1.pls" ;;
            8|nope)       play "http://radionope.streamguys1.com/listen.pls" ;;
       -    9|paradise)   play "http://stream-eu1.radioparadise.com:80/mp3-128" ;;
       +    9|paradise)   play "https://www.radioparadise.com/m3u/mp3-192.m3u" ;;
           10|bitreich)   play "http://bitreich.org:3232/live.m3u" ;;
       +   11|101|radio101)   play "http://s8.iqstreaming.com:8006/stream" ;;
       +   12|radio101rock) play "http://s8.iqstreaming.com:8018/stream" ;;
       +   13|057)        play "http://streaming.radio057.hr:8000/radio057.m3u";;
       +
        
            *) usage ;;
        esac
   DIR diff --git a/susp b/susp
       t@@ -1,9 +0,0 @@
       -#!/bin/sh
       -#
       -# parazyd - (c) wtfpl 2016
       -
       -case "$1" in
       -         on) /bin/sed -i '26,31s/#//'  /etc/acpi/default.sh ;;
       -        off) /bin/sed -i '26,31s/^/#/' /etc/acpi/default.sh ;;
       -          *) printf mem > /sys/power/state ;;
       -esac
   DIR diff --git a/theo b/theo
       t@@ -0,0 +1,3 @@
       +#!/bin/sh
       +
       +shuf -n1 ~/$(basename $0)
   DIR diff --git a/troll b/troll
       t@@ -0,0 +1 @@
       +theo
       +\ No newline at end of file
   DIR diff --git a/volume b/volume
       t@@ -5,36 +5,36 @@
        CHANNEL=$(amixer | sed "1s/^.*'\(.*\)'.*$/\1/p;d")
        
        usage () {
       -    cat <<EOF
       +        cat <<EOF
        usage: $(basename $0) [-hsla] [-+!]
       -    -h : print help
       -    -s : print on/off
       -    -l : print the current volume percentage (default)
       -    -a : print both level and state
       -     + : volume +5%
       -     - : volume -5%
       -     ! : toggle mute
       +        -h : print help
       +        -s : print on/off
       +        -l : print the current volume percentage (default)
       +        -a : print both level and state
       +        +  : volume +5%
       +        -  : volume -5%
       +        !  : toggle mute
        EOF
        }
        
        level() {
       -    amixer get $CHANNEL | sed -n 's/^.*\[\([0-9]\+\)%.*$/\1/p' | uniq
       +        amixer get $CHANNEL | sed -n 's/^.*\[\([0-9]\+\)%.*$/\1/p' | uniq
        }
        
        state() {
       -    amixer get $CHANNEL | sed -n 's/^.*\[\(o[nf]\+\)]$/\1/p' | uniq
       +        amixer get $CHANNEL | sed -n 's/^.*\[\(o[nf]\+\)]$/\1/p' | uniq
        }
        
        # print out level and state if no argument is given
        test $# -eq 0 && echo "`level`" && exit 0
        
        case $1 in
       -    -h)        usage ;;
       -    -s)        state ;;
       -    -l)        level ;;
       -     up|+)     amixer set $CHANNEL 5%+ >/dev/null;;
       -     down|-)   amixer set $CHANNEL 5%- >/dev/null;;
       -     toggle|!) amixer set $CHANNEL toggle >/dev/null;;
       -         X)        amixer set Capture toggle >/dev/null;;
       -     *)        amixer set $CHANNEL $1 >/dev/null;;
       +        -h)       usage ;;
       +        -s)       state ;;
       +        -l)       level ;;
       +        up|+)     amixer set $CHANNEL 5%+ >/dev/null;;
       +        down|-)   amixer set $CHANNEL 5%- >/dev/null;;
       +        toggle|!) amixer set $CHANNEL toggle >/dev/null;;
       +        X)        amixer set Capture toggle >/dev/null;;
       +        *)        amixer set $CHANNEL $1 >/dev/null;;
        esac
   DIR diff --git a/wd b/wd
       t@@ -1,3 +0,0 @@
       -#!/bin/sh
       -#exec surf http://lime2/$(basename $0)
       -exec surf http://rpi/$(basename $0)
   DIR diff --git a/wifi b/wifi
       t@@ -1,34 +0,0 @@
       -#!/bin/sh
       -
       -dev=${dev:=wlan0}
       -wpasup=/etc/wpa_supplicant/wpa_supplicant.conf
       -
       -usage() {
       -        printf "usage: %s new|enable|disable|restart}\n" "$(basename $0)"
       -        exit 1
       -}
       -
       -ask() {
       -        printf "(*) choose one of these:\n"
       -        grep 'ssid="' $wpasup | sed 's/ssid=//'
       -        printf "[essid]: " ; read net
       -        [ -n "$net" ] || exit 1
       -        grep -q "$net" $wpasup || exit 1
       -}
       -
       -en() {
       -        [ -n "$net" ] || ask
       -        sudo perl -i -0pe 's/disabled=0/disabled=1/g;s/(ssid="'$net'"\n.*)disabled=1/\1disabled=0/' $wpasup
       -}
       -
       -dis() {
       -        sudo perl -i -0pe 's/disabled=0/disabled=1/g;' $wpasup
       -}
       -
       -case "$1" in
       -        en|ena|enab*) net="$2" en;;
       -        di|dis|disa*) net="$2" dis;;
       -        d|down)       sup net $dev stop;;
       -        r|restart)    sup net $dev restart;;
       -        *) usage;;
       -esac
   DIR diff --git a/wlan0 b/wlan0
       t@@ -0,0 +1,34 @@
       +#!/bin/sh
       +
       +dev="$(basename $0)"
       +wpasup=/etc/wpa_supplicant/wpa_supplicant.conf
       +
       +usage() {
       +        printf "usage: %s new|enable|disable|restart}\n" "$(basename $0)"
       +        exit 1
       +}
       +
       +ask() {
       +        printf "(*) choose one of these:\n"
       +        grep 'ssid="' $wpasup | sed 's/ssid=//'
       +        printf "[essid]: " ; read net
       +        [ -n "$net" ] || exit 1
       +        grep -q "$net" $wpasup || exit 1
       +}
       +
       +en() {
       +        [ -n "$net" ] || ask
       +        sudo perl -i -0pe 's/disabled=0/disabled=1/g;s/(ssid="'$net'"\n.*)disabled=1/\1disabled=0/' $wpasup
       +}
       +
       +dis() {
       +        sudo perl -i -0pe 's/disabled=0/disabled=1/g;' $wpasup
       +}
       +
       +case "$1" in
       +        en|ena|enab*) net="$2" en;;
       +        di|dis|disa*) net="$2" dis;;
       +        d|down)       sup net $dev stop;;
       +        r|restart)    sup net $dev restart;;
       +        *) usage;;
       +esac