View show_uptime.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function show_ut { | |
last -F $USER | | |
grep ":0 .* :0" | | |
sed 's/\s\s*/ /g' | | |
cut -d" " -f4-15 | | |
grep $(LANG=en_US date "+%b") | | |
grep -v "(00:00)" | |
asd=$(last -F $USER | | |
grep ":0 .* :0" | |
View copylinks.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var script = document.createElement('script'); | |
script.src = 'http://code.jquery.com/jquery-1.10.1.min.js'; | |
script.type = 'text/javascript'; | |
document.getElementsByTagName('head')[0].appendChild(script); | |
text = '' | |
$('a[href$=".pdf"]').each(function() {text = text + this.href + '\n'}) | |
$('body').append('<textarea style="position:absolute;right:0px;top:5%;width:40%;height:10%;" onclick="this.focus();this.select()">' + text + '</textarea>') |
View slapsens.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
level=$1 | |
i=0 | |
while true; | |
do | |
l_value=$(rec -n stat trim 0 .5 2>&1 | awk '/^RMS amplitude/ { printf $3 }';) | |
is_loud=$(echo $l_value | awk -v lev="$level" '{ if ($0 >= lev) printf "1"; else printf "0" }') |
View fickr.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyquery import PyQuery as pq | |
import sys, os, re, unicodedata | |
def slugify(value): | |
value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore').decode('ascii') | |
value = re.sub('[^\w\s-]', '', value).strip().lower() | |
return re.sub('[-\s]+', '-', value) | |
url = u'http://www.flickr.com/photos/' |
View mover.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mvr() { | |
spath="/MEDIASHARE/Serien/" | |
select d in $spath*/; do | |
test -n "$d" && break; | |
echo ">>> Invalid Selection"; | |
done | |
mv "$@" "$d" | |
ls | |
} |
View last.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import commands | |
import datetime | |
import time | |
import sys | |
user = commands.getoutput('echo $USER') | |
last = commands.getoutput('last -F $USER | grep ":0 .* :0" | sed "s/\s\s*/ /g" | grep -v "(00:00)"').split('\n') | |
last = [x.replace('%s :0 :0 ' % user, '') for x in last] |
View django_list_to_queryset.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def list_to_queryset(model_list): | |
if len(model_list) > 0: | |
return model_list[0].__class__.objects.filter( | |
pk__in=[obj.pk for obj in model_list]) | |
else: | |
return [] |
View droppi2.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dropbox import client, rest, session | |
import os,sys | |
#Const | |
APP_KEY = '' | |
APP_SECRET = '' | |
ACC_KEY = '' | |
ACC_SECRET = '' | |
ACCESS_TYPE = 'dropbox' | |
folder_to_sync = '/' |
View link_parser.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyquery import PyQuery as pq | |
import sys | |
doc = pq(url=sys.argv[1]) | |
links = doc(sys.argv[2]) | |
for link in links: | |
print(link.get('href')) |
View picraf.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ "$1" == "" ]]; then | |
to=1440 | |
else | |
to=$1 | |
fi | |
if [[ "$2" == "" ]]; then | |
waitsek=60 | |
else |
OlderNewer