Skip to content

Instantly share code, notes, and snippets.

Per Buer perbu

Block or report user

Report or block perbu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View auto-venv.sh
#!/bin/zsh
#
# Auto activate a python virtualenv when entering the project directory.
# Installation:
# source virtualenv-auto-activate.sh
#
# Usage:
# Function `venvconnect`:
# Connect the currently activated virtualenv to the current directory.
#
View handler.js
function signalHandle(signal) {
console.log('Received signal ', signal);
server.em.emit("serverShutdown", "Shutdown initiated by signal "+signal);
}
process.on('SIGINT', signalHandle);
process.on('SIGTERM', signalHandle);
View trap1.js
/*
This prints out A,B,C,D and E.
What is the order and what is printed after E:
*/
myAdd = (a, b) => {
return new Promise((resolve, reject) => {
resolve(a + b);
});
@perbu
perbu / nacl.txt
Created Dec 19, 2017
Example NaCl config for a simple firewall.
View nacl.txt
Iface outside {
address: 10.0.0.2,
netmask: 255.255.255.0,
gateway: 10.0.0.1,
index: 0
}
Iface inside {
address: 192.168.0.1,
netmask: 255.255.255.0,
View full nat example
Iface eth0 dhcp
eth0.index: 0
Iface k1 {
address: 10.0.1.1,
netmask: 255.255.255.0,
index: 2,
prerouting: [ fw, mydnat ]
}
@perbu
perbu / captcha.md
Created Sep 24, 2017 — forked from Samuirai/captcha.md
G-WAN Captcha Decode
View captcha.md

G-WAN is a new free web server. They seem to be very proud of it, or at least just want to make a lot of money. Well anyway, in almost every sentence they write, they claim that they are 20% cooler than anything else. It feels a bit arrogant. I have to admit, I don't know a lot about web servers, so I can't speak to how good they are.

However, then I saw their Captcha example. I also don't know much about machine learning algorithms, OCR, and stuff like that, but I do know how to read pixels. I also know how to compare values with python :P

demo

They say the following about their Captcha:

View tcp-test.pl
#!/usr/bin/perl
use IO::Socket;
use constant MAXWRITE => 2000; #biggest write we'll attempt
use strict;
use warnings;
$|++; # autoflush stdout
my ($host,$port) = @ARGV;
View gist:4760d16227c495bd1fca343b505c4af1
o oooooo o
oo oooooooooo oo
oo oooooooooCoooooooooo oo
o oooooooooooooooooooooooo o
o oooooooooooooooooooooooCoooooooooo o
oooooooooooooooooooooooooooooooooooooo
oooooooooooooooCoooooooooooooooooooooooooooooooo
o oooooooooooooCoooooooooooooooooooooooooooooooooooooo o
oo oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo oo
o oooooooooooooooooooooooCoooooooooooooooooooooooooooooooooooooooooo o
View gist:ed005753736c2f1f9eb796ceb299ba4e
MMMMMMMMMMMMMMMNdhs++shdNMMMMMMMMMMMMMMM
MMMMMMMMMMMNNhyo++++++++oyhNNMMMMMMMMMMM
MMMMMMMMNmyso++++++++++++++osymNMMMMMMMM
MMMMNmhyo++++++++++++++++++++++oyhmNMMMM
NNdho++++++++++++++oo++++++++++++++ohdNN
hyoo++++++++++++osssssso++++++++++++ooyh
yyhhyso++++++oos+:. .:+soo++++++osyhddd
yyyyyyhysoos+:`` ``:+sooyhddddddd
yyyyyyyyyNd+:` `-/smddddddddd
yyyyyyyyyNdddho+. .//++/:mddddddddd
View gist:e8650e29a4df6c5dd0185bab95cdbdec
**** PANIC: ****
Stack protector: Canary modified
**** CONTEXT: ****
Connection::on_data: data from 10.0.0.42:80 10.0.0.1:59532 (ESTABLISHED)
GET /api/dashboard HTTP/1.1
Host: 10.0.0.42
Connection: keep-alive
Accept: application/json, text/plain, */*
You can’t perform that action at this time.