View rndsampling.js
const assert = require('assert');
const checks = {
/* original_post: (val, range, maxNum) => {
return val + range - (val % range) < maxNum;
},*/
traditional: (val, range, maxNum) => {
return val < Math.floor(maxNum / range) * range;
},
correct: (val, range, maxNum) => {
View keybase.md

Keybase proof

I hereby claim:

  • I am phihag on github.
  • I am phihag (https://keybase.io/phihag) on keybase.
  • I have a public key whose fingerprint is 7D33 D762 FD6C 3513 0481 347F DB4B 54CB A482 6A18

To claim this, I am signing this object:

View score.r
PROB <- 0.5
RUNS <- 10000
game_is_over <- function(p, q) {
return((
((p == 21) && (q < 20)) ||
((p > 21) && (p <= 30) && (p - 2 == q)) ||
(p == 30) && (q == 29)
) || (
((q == 21) && (p < 20)) ||
View mm.log
ModemManager[15700]: <info> [1467221984.425814] [main.c:136] main(): ModemManager (version 1.4.14) starting in system bus...
ModemManager[15700]: <debug> [1467221984.427865] [main.c:61] bus_acquired_cb(): Bus acquired, creating manager...
ModemManager[15700]: <debug> [1467221984.429776] [mm-plugin-manager.c:852] load_plugins(): Looking for plugins in '/usr/lib/x86_64-linux-gnu/ModemManager'
ModemManager[15700]: <debug> [1467221984.430104] [mm-plugin-manager.c:877] load_plugins(): Loaded plugin 'Motorola'
ModemManager[15700]: <debug> [1467221984.430255] [mm-plugin-manager.c:877] load_plugins(): Loaded plugin 'Longcheer'
ModemManager[15700]: <debug> [1467221984.430376] [mm-plugin-manager.c:877] load_plugins(): Loaded plugin 'Option High-Speed'
ModemManager[15700]: <debug> [1467221984.430491] [mm-plugin-manager.c:877] load_plugins(): Loaded plugin 'Gobi'
ModemManager[15700]: <debug> [1467221984.430608] [mm-plugin-manager.c:877] load_plugins(): Loaded plugin 'Nokia (Icera)'
ModemManager[15700]: <debug> [14672219
View log file
--> WvDial: Internet dialer version 1.61
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: AT+CFUN=1
AT+CFUN=1
OK
--> Sending: ATQ0 V1 E1 S0=0
ATQ0 V1 E1 S0=0
View test_mp.py
import multiprocessing as mp
def worker(filex):
""" reading lots of data """
raw = filter(lambda x: len(x.split())>3,
open(filex).readlines())
data = {}
# putting all the data in the data dictionary
return data
View addresses.log
# On the server:
$ ip a s dev tun0
15: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 100
link/none
inet 10.222.0.1 peer 10.222.0.2/32 scope global tun0
# Client output:
...
Fri Jul 11 08:55:32 2014 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 2048 bit RSA
Fri Jul 11 08:55:32 2014 [n.phihag.de] Peer Connection Initiated with [AF_INET]174.34.171.91:1194
View filehandles.go
package main
import "fmt"
import "io/ioutil"
func main() {
files, _ := ioutil.ReadDir("/tmp/files")
for _, file := range files {
_, err := ioutil.ReadFile("/tmp/files/" + file.Name())
View gist:8422290
Zugriff verweigert
Dir wurde der Zugriff auf diese Seite auf Grund eines Cross-Site Scripting-Angriffs (XSS) in der Variable $_POST::password verwehrt.
Bitte klicke hier oder benutze die Zurück-Funktion deines Browsers, um zur Ursprungsseite zurückzukehren!
username phihag
email phihag@phihag.de
confirmEmail phihag@phihag.de
password Y8XEz<FMQ$V0+:)6]sC`KTr}*&"D<=`}
confirmPassword Y8XEz<FMQ$V0+:)6]sC`KTr}*&"D<=`}
ye5b0afbd37a83f9 jd5970706b26931ef
View gist:8380598
The open function explained
[open](http://docs.python.org/dev/library/functions.html#open) opens a file. Pretty simple, eh? Most of the time, we see it being used like this:
[sourcecode language='python']
f = open('photo.jpg', 'r+')
jpgdata = f.read()
f.close()
[/sourcecode]