tupdates - scripts - random scripts
 (HTM) git clone git://parazyd.org/scripts.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
       ---
 (DIR) commit 275ad683c9a7f263d2613164747540169a40f62c
 (DIR) parent ed45c7bd3f18d1e9236d0bcc3d94b56c57f76128
 (HTM) Author: parazyd <parazyd@dyne.org>
       Date:   Tue, 24 Oct 2017 02:17:16 +0200
       
       updates
       
       Diffstat:
         M autoup                              |      23 ++++++++++++++++++-----
         A bible                               |      13 +++++++++++++
         M catfact                             |       3 +--
         M gw                                  |      10 ++++++++--
         A qq                                  |      10 ++++++++++
         M radio                               |       2 +-
         M susp                                |       4 ++--
         M wd                                  |       2 +-
       
       8 files changed, 54 insertions(+), 13 deletions(-)
       ---
 (DIR) diff --git a/autoup b/autoup
       t@@ -6,17 +6,30 @@ server=pub.parazyd.cf
        webroot=/home/parazyd/public_html/pub.parazyd.cf
        webdir=dev/random
        
       -test "$1" = -n && {
       -        shift
       -        webdir=dev/null
       -}
       +case "$1" in
       +        -p)
       +                shift
       +                webdir=tmp/priv
       +                ;;
       +        -n)
       +                shift
       +                webdir=dev/null
       +esac
       +
        
        test -z "$1" && exit 1 || filename=$(basename $1)
        
        case "$filename" in
                *_scrot.png)
                        webdir=tmp/screenshots
       -                filename="screenshot$(( $(basename $(lynx -dump https://pub.parazyd.cf/tmp/screenshots | tail -n1 | tr -d '[a-z]./:' | awk '{print $2}')) + 1 )).png"
       +                num=$(echo $(lynx -dump https://pub.parazyd.cf/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}.png"
                ;;
        esac
        
 (DIR) diff --git a/bible b/bible
       t@@ -0,0 +1,13 @@
       +#!/usr/bin/env python3
       +
       +from random import randint
       +
       +
       +bible = open('/home/parazyd/Bible.TXT').read()
       +bible = bible.split('\n\n')
       +rand = randint(0, len(bible))
       +
       +print('line: %d\n' % rand)
       +
       +for i in range(4):
       +        print(bible[rand+i]+'\n')
 (DIR) diff --git a/catfact b/catfact
       t@@ -2,5 +2,4 @@
        
        [ -n "$TORIFY" ] && proxy="--socks4a 127.0.0.1:9050"
        
       -curl -s ${proxy} http://catfacts-api.appspot.com/api/facts | jq -r '.facts[]' |
       -tee -a ~/catfact.txt
       +curl -s ${proxy} http://catfacts-api.appspot.com/api/facts | jq -r '.facts[]'
 (DIR) diff --git a/gw b/gw
       t@@ -2,5 +2,11 @@
        
        #This prints random words from the linux dictionary.
        
       -echo "$(shuf -n 32 /usr/share/dict/words --random-source=/dev/urandom | tr '\n' ' ')"
       -
       +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' ' ')"
       +                ;;
       +esac
 (DIR) diff --git a/qq b/qq
       t@@ -0,0 +1,10 @@
       +#!/usr/bin/env python3
       +
       +from random import randint
       +
       +
       +bible = open('/home/parazyd/quotes').read()
       +bible = bible.split('\n\n')
       +rand = randint(0, len(bible)-1)
       +
       +print(bible[rand])
 (DIR) diff --git a/radio b/radio
       t@@ -29,7 +29,7 @@ case "$1" in
            3|blurfm)     play "http://radio.dyne.org/blurfm02.m3u" ;;
            4|auroville)  play "http://radio.dyne.org/auroville.mp3.m3u" ;;
            5|2f30)       play "http://radio.2f30.org:8000/live.mp3" ;;
       -    6|yammat)     play "http://192.240.102.133:12430/" ;;
       +    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" ;;
 (DIR) diff --git a/susp b/susp
       t@@ -3,7 +3,7 @@
        # parazyd - (c) wtfpl 2016
        
        case "$1" in
       -         on) /bin/sed -i '26,32s/#//'  /etc/acpi/default.sh ;;
       -        off) /bin/sed -i '26,32s/^/#/' /etc/acpi/default.sh ;;
       +         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/wd b/wd
       t@@ -1,3 +1,3 @@
        #!/bin/sh
       +#exec surf http://lime2/$(basename $0)
        exec surf http://rpi/$(basename $0)
       -#exec surf http://rpi:8000/$(basename $0)