Skip to content

Instantly share code, notes, and snippets.

View lukas-buergi's full-sized avatar

Lukas Bürgi lukas-buergi

View GitHub Profile
@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
@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 / 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
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>
pnd:~$ milky -Apv
::REPO_API
LANG: en_US
Root: /media/UPND
Repositories:
libpndman repository
http://repo.openpandora.org/client/masterlist
pnd:~$ milky -vAp milkyh 80
::REPO_API
LANG: en_US
Root: /media/UPND
Repositories:
libpndman repository
http://repo.openpandora.org/client/masterlist
$wgCaptchaQuestions[] = array( 'question' => "Wie lange dauert es traditionsgemäss, bis eine bestellte Pandora ankommt?<br/>(Hinweis: In Monaten anzugeben, à la \"x Monate\", Neuzugänge finden im Forum oder im IRC channel sicher Hilfe)<br/>", 'answer' => "2 Monate" );
$wgCaptchaQuestions[] = array( 'question' => "Wie heisst EvilDragon wirklich?<br/>(Hinweis: Sucht ein bisschen, er betreibt auch den shop.gp2x.de, im Wiki findet sich die Information auch)<br/>", 'answer' => "Michael Mrozek" );
$wgCaptchaQuestions[] = array( 'question' => "Was ist die Bildschirmauflösung der Pandora?<br/>(Hinweis: Anzugeben nach dem Schema \"xauflösung x yauflösung\". Findet sich im Wiki schon irgendwo...)<br/>", 'answer' => "800 x 480" );
@lukas-buergi
lukas-buergi / checkSession.php
Created June 26, 2012 13:18
Check whether sessions work in php
<?php
error_reporting( E_ALL );
ini_set( 'display_errors', 1);
if(!isset($_GET['action'])){
die('Param is missing. Look at the <a href="https://gist.github.com/2995743">source</a>.');
}
switch($_GET['action']) {
$ prgm/overgrowth/Overgrowth/overgrowth.bin.x86_64
prgm/overgrowth/Overgrowth/overgrowth.bin.x86_64: /usr/lib/libjpeg.so.62: no version information available (required by prgm/overgrowth/Overgrowth/overgrowth.bin.x86_64)
RGBA bits, depth: 8 8 8 8, 24
Anti-aliasing samples: 4
32 texture units supported.
GL_MAX_VERTEX_UNIFORM_COMPONENTS: 4096
0 SDL joysticks found
Hardware threads: 2
*****************
Calculating detail textures
t4b@t4b-desktop:~$ gdb prgm/overgrowth/Overgrowth/overgrowth.bin.x86_64
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...