Remove useless utils
Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
This commit is contained in:
parent
468c281b18
commit
5ab37b92ce
17 changed files with 0 additions and 4103 deletions
|
@ -1,32 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
file=/dev/shm/btc_stats
|
||||
fileURL=http://api.bitcoincharts.com/v1/weighted_prices.json
|
||||
|
||||
function update_file {
|
||||
wget --quiet $fileURL -O $file
|
||||
#echo WILL_WGET
|
||||
}
|
||||
|
||||
if [ -s $file ]; then
|
||||
#update if older than 1h
|
||||
age=`stat -c %Y $file`;
|
||||
now=`date +%s`;
|
||||
diff=$(($now - $age));
|
||||
if [ $diff -gt 3600 ]; then
|
||||
update_file & #Do not hang the result
|
||||
fi;
|
||||
|
||||
#Fucking ugly, but works
|
||||
content=`cat $file | python -mjson.tool | grep -A3 EUR | tail -n3 | cut -d':' -f2 | cut -d'"' -f2`;
|
||||
|
||||
p24h=`echo "$content" | sed -n 1p | cut -d. -f1`
|
||||
p7d=`echo "$content" | sed -n 3p`
|
||||
p30d=`echo "$content" | sed -n 2p`
|
||||
|
||||
graph=`sparklines $p30d $p7d $p24h`
|
||||
echo $graph [$p24h€] #dont want sparklines newline
|
||||
else
|
||||
update_file & #Will surely wait for iface
|
||||
fi
|
||||
|
Binary file not shown.
Binary file not shown.
|
@ -1,13 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo on > /proc/acpi/ibm/light
|
||||
sleep 0.2
|
||||
echo off > /proc/acpi/ibm/light
|
||||
sleep 0.2
|
||||
echo on > /proc/acpi/ibm/light
|
||||
sleep 0.2
|
||||
echo off > /proc/acpi/ibm/light
|
||||
sleep 0.2
|
||||
echo on > /proc/acpi/ibm/light
|
||||
sleep 0.2
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
window=$(xdotool getactivewindow)
|
||||
|
||||
pushd "$(dirname "$0")"
|
||||
|
||||
#set -- junk $(cat kaomoji | cut -d '|' -f 1 | dmenu -p emoji)
|
||||
set -- junk $(cat kaomoji | rofi -dmenu -i | cut -d'|' -f1)
|
||||
|
||||
shift
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
emoji=$(cat kaomoji | grep "^$(echo $@)|" | cut -d '|' -f 2 | tr -s '\r')
|
||||
|
||||
#echo "$emoji" | xclip -selection clipboard
|
||||
|
||||
xdotool windowactivate $window
|
||||
echo -n "$emoji" | xclip -sel clip
|
||||
xdotool type "$emoji"
|
|
@ -1,211 +0,0 @@
|
|||
#!/usr/bin/env python2
|
||||
# coding: utf-8
|
||||
#
|
||||
# Name : fix-htmldoc-utf8
|
||||
# Summary: Program to fix UTF-8 characters that HTMLDOC has messed
|
||||
# Author : Aurelio Jargas www.aurelio.net/soft
|
||||
# License: BSD
|
||||
# Release: April, 2008
|
||||
#
|
||||
# HTMLDOC has no Unicode support, so when you try to use it in a UTF-8 file,
|
||||
# all the special characters (not ASCII) will be incorrect in the resulting HTML.
|
||||
# This program fixes this, restoring the original UTF-8 characters.
|
||||
#
|
||||
# Just use it as a filter (reads STDIN, results to STDOUT) or use the -w option
|
||||
# fix the file in place.
|
||||
#
|
||||
# Examples:
|
||||
# cat myfile.html | fix-htmldoc-utf8 > myfile-ok.html
|
||||
# fix-htmldoc-utf8 myfile.html > myfile-ok.html
|
||||
# fix-htmldoc-utf8 -w myfile.html
|
||||
#
|
||||
|
||||
import sys
|
||||
|
||||
# You can add new chars to this mapping, if needed.
|
||||
# The first set are the ISO-8859-1 extended chars.
|
||||
# The second set are the Unicode chars I've found on my keyboard.
|
||||
#
|
||||
mapping = """
|
||||
¡ ¡
|
||||
¢ ¢
|
||||
£ £
|
||||
¤ ¤
|
||||
¥ Â¥
|
||||
¦ ¦
|
||||
§ §
|
||||
¨ ¨
|
||||
© ©
|
||||
ª ª
|
||||
« «
|
||||
¬ ¬
|
||||
® ®
|
||||
¯ ¯
|
||||
° °
|
||||
± ±
|
||||
² ²
|
||||
³ ³
|
||||
´ ´
|
||||
µ Âμ
|
||||
¶ ¶
|
||||
· ·
|
||||
¸ ¸
|
||||
¹ ¹
|
||||
º º
|
||||
» »
|
||||
¼ ¼
|
||||
½ ½
|
||||
¾ ¾
|
||||
¿ ¿
|
||||
À Ã\x80
|
||||
Á Ã\x81
|
||||
 Ã\x82
|
||||
à Ã\x83
|
||||
Ä Ã\x84
|
||||
Å Ã\x85
|
||||
Æ Ã\x86
|
||||
Ç Ã\x87
|
||||
È Ã\x88
|
||||
É Ã\x89
|
||||
Ê Ã\x8a
|
||||
Ë Ã\x8b
|
||||
Ì Ã\x8c
|
||||
Í Ã\x8d
|
||||
Î Ã\x8e
|
||||
Ï Ã\x8f
|
||||
Ð Ã\x90
|
||||
Ñ Ã\x91
|
||||
Ò Ã\x92
|
||||
Ó Ã\x93
|
||||
Ô Ã\x94
|
||||
Õ Ã\x95
|
||||
Ö Ã\x96
|
||||
× Ã\x97
|
||||
Ø Ã\x98
|
||||
Ù Ã\x99
|
||||
Ú Ã\x9a
|
||||
Û Ã\x9b
|
||||
Ü Ã\x9c
|
||||
Ý Ã\x9d
|
||||
Þ Ã\x9e
|
||||
ß Ã\x9f
|
||||
à Ã
|
||||
á á
|
||||
â â
|
||||
ã ã
|
||||
ä ä
|
||||
å Ã¥
|
||||
æ æ
|
||||
ç ç
|
||||
è è
|
||||
é é
|
||||
ê ê
|
||||
ë ë
|
||||
ì ì
|
||||
í í
|
||||
î î
|
||||
ï ï
|
||||
ð ð
|
||||
ñ ñ
|
||||
ò ò
|
||||
ó ó
|
||||
ô ô
|
||||
õ Ãμ
|
||||
ö ö
|
||||
÷ ÷
|
||||
ø ø
|
||||
ù ù
|
||||
ú ú
|
||||
û û
|
||||
ü ü
|
||||
ý ý
|
||||
þ þ
|
||||
ÿ ÿ
|
||||
|
||||

|
||||
™ â\x84¢
|
||||
€ â\x82¬
|
||||
æ æ
|
||||
Œ Å\x92
|
||||
≤ â\x89¤
|
||||
≠ â\x89
|
||||
≥ â\x89¥
|
||||
fi ï¬\x81
|
||||
fl ï¬\x82
|
||||
∞ â\x88\x9e
|
||||
• â\x80¢
|
||||
⁄ â\x81\x84
|
||||
≈ â\x89\x88
|
||||
◊ â\x97\x8a
|
||||
∑ â\x88\x91
|
||||
∏ â\x88\x8f
|
||||
π Ï\x80
|
||||
∂ â\x88\x82
|
||||
∆ â\x88\x86
|
||||
ƒ Æ\x92
|
||||
Ω Î©
|
||||
√ â\x88\x9a
|
||||
∫ â\x88«
|
||||
† â\x80
|
||||
‡ â\x80¡
|
||||
ı ı
|
||||
› â\x80º
|
||||
˚ Ë\x9a
|
||||
˙ Ë\x99
|
||||
ˇ Ë\x87
|
||||
˝ Ë\x9d
|
||||
˛ Ë\x9b
|
||||
‘ â\x80\x98
|
||||
’ â\x80\x99
|
||||
‚ â\x80\x9a
|
||||
“ â\x80\x9c
|
||||
” â\x80\x9d
|
||||
„ â\x80\x9e
|
||||
… â\x80¦
|
||||
— â\x80\x94
|
||||
– â\x80\x93
|
||||
|
||||
CHARSET=utf-8 CHARSET=iso-8859-1
|
||||
CHARSET=utf-8 CHARSET=iso-iso-8859-1
|
||||
"""
|
||||
|
||||
# Just a standard search & replace
|
||||
def fixit(text):
|
||||
for pair in mapping.split('\n'):
|
||||
if not pair: continue
|
||||
repl, patt = pair.split('\t')
|
||||
text = text.replace(patt.strip(), repl.strip())
|
||||
return text
|
||||
|
||||
# User wants to save the file in place or not?
|
||||
write_file = False
|
||||
if len(sys.argv) > 1 and sys.argv[1] == '-w':
|
||||
write_file = True
|
||||
sys.argv.pop(1)
|
||||
|
||||
# The input files (if any)
|
||||
files = sys.argv[1:]
|
||||
|
||||
if files:
|
||||
# Fix input files one by one
|
||||
for this_file in files:
|
||||
try:
|
||||
# Read and fix
|
||||
f = open(this_file, 'r')
|
||||
fixed = fixit(f.read())
|
||||
f.close()
|
||||
|
||||
# Save the file or show on STDOUT
|
||||
if write_file:
|
||||
f = open(this_file, 'w')
|
||||
f.write(fixed)
|
||||
f.close()
|
||||
print "Fixed", this_file
|
||||
else:
|
||||
print fixed,
|
||||
except:
|
||||
print "Error fixing", this_file
|
||||
sys.exit(1)
|
||||
else:
|
||||
# No input file, read from STDIN and send results to STDOUT
|
||||
print fixit(sys.stdin.read()),
|
|
@ -1 +0,0 @@
|
|||
while true; do xbacklight -set 0 -time 0 -steps 1; sleep 0.01; xbacklight -set 100 -time 0 -steps 1; sleep 0.01; done;
|
|
@ -1,63 +0,0 @@
|
|||
#!/bin/bash
|
||||
#ftpfct : Fucking ThinkPad FanConTrol
|
||||
# Yep, fancontrol works shit on my machine (kernel fault I think), so let's use
|
||||
# ACPI and "kernel controls" (from TP_smapi).
|
||||
|
||||
FANFILE=/proc/acpi/ibm/fan
|
||||
|
||||
ACPI='acpi -V'
|
||||
|
||||
REFRESH=10
|
||||
|
||||
function set_fan
|
||||
{
|
||||
echo "level $1" | sudo tee $FANFILE
|
||||
}
|
||||
|
||||
function finish
|
||||
{
|
||||
set_fan full-speed
|
||||
}
|
||||
|
||||
trap finish EXIT
|
||||
|
||||
while true; do
|
||||
|
||||
TEMP=$($ACPI | grep degrees | grep -v critical | cut -d' ' -f4)
|
||||
TEMP=$(echo $TEMP | cut -d. -f1)
|
||||
echo $TEMP °C
|
||||
|
||||
#TODO: hysteresis if it becomes fucking annoying jumping around
|
||||
|
||||
if [ $TEMP -lt 10 ]; then
|
||||
xsetroot PROC PROBLEM
|
||||
set_fan full_speed
|
||||
echo "full speed"
|
||||
REFRESH=10
|
||||
elif [ $TEMP -lt 48 ]; then
|
||||
set_fan 0
|
||||
echo "lt 46"
|
||||
REFRESH=10
|
||||
elif [ $TEMP -lt 56 ]; then
|
||||
set_fan 2
|
||||
echo "lt 56"
|
||||
REFRESH=5
|
||||
elif [ $TEMP -lt 66 ]; then
|
||||
set_fan 4
|
||||
echo "lt 66"
|
||||
REFRESH=4
|
||||
elif [ $TEMP -lt 70 ]; then
|
||||
set_fan 5
|
||||
echo "lt 66"
|
||||
REFRESH=3
|
||||
else
|
||||
set_fan full-speed
|
||||
echo "full speed"
|
||||
REFRESH=2
|
||||
fi;
|
||||
|
||||
sleep $REFRESH
|
||||
|
||||
done
|
||||
|
||||
|
3570
Utils/kaomoji
3570
Utils/kaomoji
File diff suppressed because it is too large
Load diff
|
@ -1,19 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
test #$ -gt 1 || exit 1
|
||||
|
||||
tmp=tmp$$
|
||||
file=/dev/shm/$tmp
|
||||
result=$(echo $1 | rev | cut -d. -f2- | rev).pdf
|
||||
|
||||
sed 's/oeil/\\oe{}il/g;
|
||||
s/oeuvre/\\oe{}uvre/g;
|
||||
s/soeur/s\\oe{}ur/g;
|
||||
s/noeud/n\\oe{}ud/g;
|
||||
s/oeuf/\\oe{}uf/g;
|
||||
s/boeuf/b\\oe{}uf/g
|
||||
' $1 > $file
|
||||
|
||||
pdflatex $file
|
||||
mv $tmp.pdf $result
|
||||
rm -f $tmp*
|
|
@ -1,14 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
for i in *.mp3; do
|
||||
|
||||
newFile=`echo $i | sed 's/ - /@/g'`
|
||||
author=`echo $newFile | cut -d@ -f1 | sed 's/ *$//'`
|
||||
name=`echo $newFile | cut -d@ -f2 | sed -e 's/ *$//' -e 's/^ *//' -e 's/.mp3//'`
|
||||
|
||||
echo "I have >>$author<< and >>$name<<"
|
||||
|
||||
id3 -a "$author" -t "$name" "$i"
|
||||
|
||||
done
|
||||
|
73
Utils/nsh
73
Utils/nsh
|
@ -1,73 +0,0 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# This is a nsh script compatible wrapper written uin bash + curl
|
||||
# Status: Prototype
|
||||
#
|
||||
# It is supposed to be fully compatible inside script.
|
||||
#
|
||||
# Not working: long option format ex: --clientid
|
||||
|
||||
exec_curl() {
|
||||
local server=$1
|
||||
local method=$2
|
||||
shift 2
|
||||
|
||||
# -k disable SSL validation h2-master cert seems invalid
|
||||
# curl: (60) SSL certificate problem: unable to get local issuer certificate
|
||||
# was a bad certif on h2-master, changed by Rene.
|
||||
local curlcmd="curl -k -s -H 'Expect:' -F \"apikey=$H2_APIKEY\""
|
||||
|
||||
local a v curl_arg
|
||||
local i=1
|
||||
local argc=$#
|
||||
while [[ $i -le $argc ]]
|
||||
do
|
||||
# this is index syntax for $@[i]
|
||||
a=${@:i:1}
|
||||
# remove dash -a => a
|
||||
a=${a#-}
|
||||
v=${@:i+1:1}
|
||||
|
||||
if [[ -n $v ]] ; then
|
||||
curl_arg="-F '$a=$v'"
|
||||
elif [[ -z $v && $a == 'h' ]] ; then
|
||||
# help force bool true
|
||||
# https://gitlab.infomaniak.ch/production/h2-daemon-core/blob/master/nsh/cmdline.c#L62
|
||||
curl_arg="-F '$a=1'"
|
||||
else
|
||||
curl_arg="-F '$a'"
|
||||
fi
|
||||
|
||||
if [[ $v == '-' ]]; then
|
||||
# file
|
||||
curl_arg="-F '$a=@-; filename=$a'"
|
||||
stdin=1
|
||||
fi
|
||||
|
||||
curlcmd+=" $curl_arg"
|
||||
i=$((i + 2))
|
||||
done
|
||||
|
||||
#local url="https://$server.infomaniak.ch:888/$method"
|
||||
if [ -z $NSH_PORT ]; then
|
||||
NSH_PORT=888
|
||||
fi
|
||||
|
||||
if [ -z $NSH_HTTP ]; then
|
||||
NSH_PROTO=https
|
||||
else
|
||||
NSH_PROTO=http
|
||||
fi
|
||||
|
||||
local url="$NSH_PROTO://$server:$NSH_PORT/$method"
|
||||
curlcmd+=" $url"
|
||||
|
||||
if [[ -d ~/tmp/ ]]; then
|
||||
# debug logging
|
||||
echo "$(date "+%y%m%d_%H%M%S") $curlcmd" >> ~/tmp/nsh.log
|
||||
fi
|
||||
eval "$curlcmd"
|
||||
}
|
||||
|
||||
exec_curl "$@"
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# sldm - Super Lightweight Device Mounter
|
||||
|
||||
#TODO: FIXME and make me nicer
|
||||
|
||||
|
||||
devices=(/dev/sd??)
|
||||
dontwant=sda
|
||||
tomount=/media
|
||||
for device in ${devices[@]}; do
|
||||
|
||||
last=$(echo $device | awk -F/ '{print $NF}')
|
||||
|
||||
if [ "${device#*$dontwant}" == "$device" ]; then
|
||||
echo $device
|
||||
mount | grep $device > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "yop"
|
||||
pa=$tomount/$last
|
||||
mkdir -p $pa > /dev/null
|
||||
|
||||
mount $device $pa
|
||||
fi;
|
||||
echo $device
|
||||
fi;
|
||||
done;
|
|
@ -1,21 +0,0 @@
|
|||
#!/bin/bash
|
||||
FILE=/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/brightness
|
||||
INC=1
|
||||
VAL=255
|
||||
while true; do
|
||||
VAL=$(($VAL + $INC))
|
||||
echo $VAL > $FILE
|
||||
if [ $VAL -lt 1 ]; then
|
||||
INC=1
|
||||
fi;
|
||||
|
||||
if [ $VAL -gt 4434 ]; then
|
||||
INC=-1
|
||||
fi;
|
||||
|
||||
echo $INC
|
||||
echo $VAL
|
||||
|
||||
|
||||
done
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
#!/bin/bash
|
||||
RSLT=$(wget http://track.villaro-dixon.eu/ --quiet -O -)
|
||||
RSLT2=$(echo $RSLT | sed 's/rm//g')
|
||||
echo $RSLT2 | bash
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
#BEFORE=`xbacklight`
|
||||
#xbacklight -set 0 -time 0 -steps 1
|
||||
#sleep 0.1
|
||||
#xbacklight -set $BEFORE -time 0 -steps 1
|
||||
|
||||
#exit
|
||||
LIGHT=/sys/class/leds/tpacpi\:\:thinklight/brightness
|
||||
STATE=`cat $LIGHT`
|
||||
INVERSE=`echo 255-$STATE | bc -l`
|
||||
|
||||
echo $INVERSE | sudo tee $LIGHT
|
||||
sleep .1
|
||||
echo $STATE | sudo tee $LIGHT
|
||||
sleep .1
|
||||
#echo $INVERSE | sudo tee $LIGHT
|
||||
#sleep .1
|
||||
#echo $STATE | sudo tee $LIGHT
|
|
@ -1,13 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
youtube-dl -o '%(title)s.%(ext)s' --extract-audio --audio-format=mp3 "$1"
|
||||
|
||||
|
||||
#x=~/.youtube-dl-$RANDOM-$RANDOM.flv
|
||||
#youtube-dl --output=$x --format=18 "$1"
|
||||
#ffmpeg -i $x -f ogg -acodec copy -ac 2 -ab 128k -vn -y "$2"
|
||||
#ffmpeg -threads 4 -i $x -f mp3 -vn -acodec copy "$2"
|
||||
#ffmpeg -i $x -acodec libmp3lame -ac 2 -ab 128k -vn -y "$2"
|
||||
#avconv -i $x -vn -ac 2 "$2"
|
||||
#ffmpeg -i $x -acodec libmp3lame "$2" -threads 4
|
||||
#rm $x
|
Loading…
Reference in a new issue