Skip to content

Instantly share code, notes, and snippets.

View lukas-buergi's full-sized avatar

Lukas Bürgi lukas-buergi

View GitHub Profile
pnd:~$ milky -vAp milkyh 80
::REPO_API
LANG: en_US
Root: /media/UPND
Repositories:
libpndman repository
http://repo.openpandora.org/client/masterlist
pnd:~$ milky -Apv
::REPO_API
LANG: en_US
Root: /media/UPND
Repositories:
libpndman repository
http://repo.openpandora.org/client/masterlist
pnd:~$ milky -Ap
-!- usage: <repository> <username> <api key>
pnd:~$ milky -Ad
-!- usage: <repository> <username> <api key>
pnd:~$ milky -A
-!- usage: <repository> <username> <api key>
pnd:~$ milky -Ap milkyh 50
-!- usage: <repository> <username> <api key>
@lukas-buergi
lukas-buergi / getTorrents.sh
Created June 8, 2012 16:07
Get your HIB torrents
#!/bin/sh
#The following downloads the links to the torrent files and saves a list in "downloadlinks.lst".
wget -i mykeys.txt -O - | grep -roe 'http://torrents.humblebundle.com/.*\.torrent' > downloadlinks.lst
#This checks whether anything is in this list - if nothing is in it something went wrong.
if ! test -s downloadlinks.lst ; then
echo "Doesn't seem to have worked. Probably your keys weren't valid."
fi
#This downloads the torrent files loading the urls of the files from the previously made list.
wget -Ni downloadlinks.lst
#This remove the list of the urls for the torrent files. As you have downloaded the torrent files
@lukas-buergi
lukas-buergi / age.sh
Created June 7, 2012 20:21
Display your age in seconds
#!/bin/sh
if test -r .dateofbirth; then
echo "You are $( echo "($(date '+%s')+sqrt($(cat .dateofbirth)^2)) - ($(cat .dateofbirth))+sqrt($(cat .dateofbirth)^2)" | bc) seconds old."
else
echo "Enter your date of birth before I can tell you how old you are."
echo "One of the accepted formats is \"YYYY-MM-DD HH:MM\"."
echo -n "Your date of birth is "
read dob
date --date="$dob" '+%s' > .dateofbirth
$0
@lukas-buergi
lukas-buergi / pwgen.sh
Created June 7, 2012 20:16
Password generating script
#!/bin/sh
#Generates passwords which should be secure enough
#no matter how paranoid you are using "pwgen"
length=64
number=1
n=1024
salt="FG3OHsU~\-Y?D),"`eRG7}Z]<W9l*YCCr%'8b|K\o@hD>JwRwX:Xy#vC/s@JF,Y&" # CHANGE THIS!
if test -n "$(echo $1 | grep -oe '^[0-9][0-9]*$')"; then
echo "Setting length to $1"
length=$1