URI: 
       tadd catfact, wave - scripts - random scripts
  HTML git clone git://parazyd.org/scripts.git
   DIR Log
   DIR Files
   DIR Refs
       ---
   DIR commit af0cba2eea03d9778f7f9b7b369b526835196150
   DIR parent 9480a6661d33eee0c6fe9d753fd18d12ec6ccca0
  HTML Author: parazyd <parazyd@dyne.org>
       Date:   Wed, 14 Sep 2016 16:56:11 +0200
       
       add catfact, wave
       
       Diffstat:
         A catfact.py                          |       5 +++++
         M disco                               |       2 +-
         M dn                                  |       2 ++
         A wave.lua                            |      26 ++++++++++++++++++++++++++
       
       4 files changed, 34 insertions(+), 1 deletion(-)
       ---
   DIR diff --git a/catfact.py b/catfact.py
       t@@ -0,0 +1,5 @@
       +#!/usr/bin/env python2
       +
       +import urllib, json
       +info = json.load(urllib.urlopen("http://catfacts-api.appspot.com/api/facts"))
       +print (info['facts'])
   DIR diff --git a/disco b/disco
       t@@ -3,7 +3,7 @@
        # parazyd - (c) wtfpl 2016
        # party mode
        
       -timeout=0.2
       +timeout=0.4
        while true; do
            echo 255 > /sys/devices/platform/thinkpad_acpi/leds/tpacpi::thinklight/brightness
            sleep $timeout
   DIR diff --git a/dn b/dn
       t@@ -39,6 +39,8 @@ case $1 in
                me)
                        stopd
                        chattr off && echo "nameserver `ip route get 8.8.8.8 | awk '{print $NF; exit}'`" > /etc/resolv.conf && chattr on;;
       +        edit)
       +                chattr off && vim /etc/resolv.conf && chattr on;;
                *)
                        echo "current set as: `awk '{print $4}' /etc/resolv.conf`"
                        echo "usage: `basename $0` {home|out}"
   DIR diff --git a/wave.lua b/wave.lua
       t@@ -0,0 +1,26 @@
       +#!/usr/bin/env lua
       +
       +local clock = os.clock
       +
       +function sleep(n) -- seconds
       +        local t0 = clock()
       +        while clock() - t0 <= n do end
       +end
       +
       +wave = 0
       +t = {"*","*","*","*","*"," ","+","+","+"," "}
       +
       +while true do
       +        print("")
       +        for j = 1, math.floor(math.sin(wave)*20+20) do
       +                io.write(" ")
       +        end
       +        for i = 1, 10 do
       +                io.write(t[i])
       +        end
       +        temp = t[1]
       +        table.remove(t, 1)
       +        table.insert(t, temp)
       +        wave = wave + 0.1
       +        sleep(0.025)
       +end