scripts

random scripts
git clone git://parazyd.org/scripts.git
Log | Files | Refs

commit af0cba2eea03d9778f7f9b7b369b526835196150
parent 9480a6661d33eee0c6fe9d753fd18d12ec6ccca0
Author: parazyd <parazyd@dyne.org>
Date:   Wed, 14 Sep 2016 16:56:11 +0200

add catfact, wave

Diffstat:
Acatfact.py | 5+++++
Mdisco | 2+-
Mdn | 2++
Awave.lua | 26++++++++++++++++++++++++++
4 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/catfact.py b/catfact.py @@ -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']) diff --git a/disco b/disco @@ -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 diff --git a/dn b/dn @@ -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}" diff --git a/wave.lua b/wave.lua @@ -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