This file contains hidden or 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
| MIT License | |
| Copyright (c) 2018 Oleg Yamnikov | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: |
This file contains hidden or 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
| all:consumer producer | |
| CPPFLAGS+=-std=c++03 -Wall -pedantic | |
| CPPFLAGS+=-g -O0 | |
| CPPFLAGS+=-isystem ~/custom/boost/ | |
| LDFLAGS+=-L ~/custom/boost/stage/lib/ -Wl,-rpath,/home/sehe/custom/boost/stage/lib | |
| LDFLAGS+=-lboost_system -lrt -lpthread | |
| %:%.cpp |
This file contains hidden or 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> | |
| #include <sys/mman.h> | |
| #include <fcntl.h> | |
| #include <unistd.h> | |
| #include <string.h> | |
| #define STORAGE_ID "/SHM_TEST" | |
| #define STORAGE_SIZE 32 | |
| int main(int argc, char *argv[]) |
This file contains hidden or 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 bitarray import bitarray | |
| import mmh3 | |
| class BloomFilter: | |
| def __init__(self, size, hash_count): | |
| self.size = size | |
| self.hash_count = hash_count | |
| self.bit_array = bitarray(size) | |
| self.bit_array.setall(0) |
This file contains hidden or 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
| version: '2.1' | |
| networks: | |
| monitor-net: | |
| driver: bridge | |
| volumes: | |
| prometheus_data: {} | |
| grafana_data: {} |
This file contains hidden or 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
| Source: https://tc.gts3.org/cs6265/2017/l/lab04/README-tut.txt | |
| ==================================== | |
| Lec04: Writing Exploits with PwnTool | |
| ==================================== | |
| http://docs.pwntools.com/ | |
| http://docs.pwntools.com/en/stable/intro.html |
Here's a few things I tried to write output to a python subprocess pipe.
from subprocess import Popen, PIPE
p = Popen('less', stdin=PIPE)
for x in xrange(100):
p.communicate('Line number %d.\n' % x)
This file contains hidden or 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 subprocess | |
| import select | |
| from sys import exit | |
| p = subprocess.Popen(['python3', './subproc.py'], stdout=subprocess.PIPE) | |
| e = select.epoll() | |
| e.register(p.stdout.fileno()) | |
| while True: | |
| events = e.poll(1) |