Skip to content

Instantly share code, notes, and snippets.

Chad Brewbaker chadbrewbaker

View GitHub Profile
View play.rs
use std::process::Command;
fn main() {
let output = Command::new("ls")
.arg("/bin")
.output()
.expect("failed to execute process");
println!("stdout: {}",String::from_utf8_lossy(&output.stdout));
}
@chadbrewbaker
chadbrewbaker / sysinfo
Created Feb 7, 2019
Getting Cache/SIMD parameters on OSX
View sysinfo
sysctl -a #OSX
hw.cachesize: 8589934592 32768 262144 3145728 0 0 0 0 0 0
hw.pagesize: 4096
hw.busfrequency: 100000000
hw.busfrequency_min: 100000000
hw.busfrequency_max: 100000000
hw.cpufrequency: 2400000000
hw.cpufrequency_min: 2400000000
hw.cpufrequency_max: 2400000000
hw.cachelinesize: 64
@chadbrewbaker
chadbrewbaker / z3
Created Feb 3, 2019
z3 interception
View z3
#!/bin/bash
cat - | tee -a /tmp/z3in.log | /usr/local/bin/z3 $@ | tee -a /tmp/z3out.log
@chadbrewbaker
chadbrewbaker / bench.py
Created Jan 26, 2019
benchmark all the things in the directories without xargs shenanigans
View bench.py
import os
import time
for root, dirs, files in os.walk("."):
for file in files:
if file.endswith(".smt2"):
start = time.time()
if os.system("gtimeout 5 cvc4 "+ file) == 0:
end = time.time()
@chadbrewbaker
chadbrewbaker / Makefile
Created Jan 18, 2019
Do thing in the Docker container
View Makefile
dothething:
docker run --rm \
-v `pwd`:/opt \
some_docker_container \
/bin/bash -c 'echo do the thing > /opt/thing_result.txt'
@chadbrewbaker
chadbrewbaker / AWSLatency.txt
Last active Jan 11, 2019
AWS Latency Numbers Every Engineer Should Know
View AWSLatency.txt
Lambda statup latency
Lambda IO bandwidth
Lambda IO + CPU bandwidth for SORT
S3 read latency
S3 read bandwidth
View helpkim.py
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import time
chrome_options = Options()
#chrome_options.add_argument("--headless")
dest = "https://siouxcityjournal.com/opinion/poll-if-the-election-for-iowa-governor-was-held-today/poll_dcf19c08-69b6-11e8-9d92-0b4544897845.html?utm_medium=social&utm_source=facebook&utm_campaign=user-share"
while True:
@chadbrewbaker
chadbrewbaker / twitter_driver.py
Created Apr 29, 2018
Simple driver to profile infinite scroll twitter
View twitter_driver.py
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import time
chrome_options = Options()
#chrome_options.add_argument("--headless")
browser = webdriver.Chrome(chrome_options=chrome_options)
browser.get('https://twitter.com/hashtag/breakingnews')
while True:
@chadbrewbaker
chadbrewbaker / february.py
Created Feb 16, 2018
Script for SecDSM MiniCTF
View february.py
from PIL import Image
import io
import base64
import pytesseract
URI = 'http://ctf.secdsm.org:5557'
from subprocess import call
import urllib
import urllib2
response = urllib2.urlopen(URI)
html = response.read()
You can’t perform that action at this time.