Skip to content

Instantly share code, notes, and snippets.

@mperlet
mperlet / mover.sh
Created March 16, 2014 16:33
moves files //> mvr *
function mvr() {
spath="/MEDIASHARE/Serien/"
select d in $spath*/; do
test -n "$d" && break;
echo ">>> Invalid Selection";
done
mv "$@" "$d"
ls
}
@mperlet
mperlet / last.py
Last active August 29, 2015 14:02
last.py
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]
from dropbox import client, rest, session
import os,sys
#Const
APP_KEY = ''
APP_SECRET = ''
ACC_KEY = ''
ACC_SECRET = ''
ACCESS_TYPE = 'dropbox'
folder_to_sync = '/'
@mperlet
mperlet / link_parser.py
Created July 18, 2014 08:53
>python link_parser.py <url> <jquery_selector>
@mperlet
mperlet / picraf.sh
Created August 28, 2014 06:36
Picraf ist ein kleines Shell-Script welches mit 2 optionalen Parametern ein Zeitraffer Video erstellt. Verwendet wird fswebcam und ffmpeg.
#!/bin/bash
if [[ "$1" == "" ]]; then
to=1440
else
to=$1
fi
if [[ "$2" == "" ]]; then
waitsek=60
else
@mperlet
mperlet / flickrstats.sh
Last active August 29, 2015 14:07
Twitter Bot for Flickr User Stats
#!/bin/bash
# Requires: curl, jq, xargs, sed, bc, convert and t
# Flickr + Twitter User
FUSER='mperlet'
TUSER='@mperlet_'
# User Info URL
DATA=$(curl http://flickrit.pboehm.org/photos/$FUSER)
@mperlet
mperlet / pdfsites
Created December 12, 2014 10:01
PDF Site info (number of pages + color pages)
function pdfsites() {
echo "Seitenanzahl: " $(pdfinfo $1 | grep Pages: | cut -d":" -f2 | awk '{$1=$1}{ print }')
echo "Farbseiten: " $(ghostscript -o - -sDEVICE=inkcov $1 | grep -v "^ 0.00000 0.00000 0.00000" | grep "^ " | wc -l)
}
@mperlet
mperlet / mary_tts_wav_2_mp3_webservice
Created January 20, 2015 10:56
FlaskApp, TTS-mp3 (localhost:5000/Ich+bin+kein+Mensch)
from flask import Flask
from flask import send_file
from urllib.request import urlopen
import random, string
import os, glob
app = Flask(__name__)
@app.route("/<tts>")
def hello(tts):
@mperlet
mperlet / random 9gag
Created January 27, 2015 12:12
fire key "r", every 3sec (random 9gag page)
while :
do
xdotool key "r"
sleep 3
done
Es ist 12:30Uhr. Draussen sind es 8 grad. Es regnet nicht äüöäüö