Skip to content

Instantly share code, notes, and snippets.

View dapperfu's full-sized avatar

dapperfu (+++ATH0) dapperfu

  • 3rd Coast
View GitHub Profile
@dapperfu
dapperfu / gist:b00d91845ebd77f2a403842ab3d4c614
Created September 4, 2019 13:29
Passing a (const char *) in ctypes.
dll = canape.dll
hdl = canape.handle
directory = ctypes.create_string_buffer(b"", 256)
size = ctypes.c_ulong()
# Asap3GetProjectDirectory
dll.Asap3GetProjectDirectory.argtypes=(TAsap3Hdl, ctypes.POINTER(type(directory)), ctypes.POINTER(ctypes.c_ulong))
dll.Asap3GetProjectDirectory.restype=ctypes.c_bool
result = dll.Asap3GetProjectDirectory(
hdl,
@dapperfu
dapperfu / dns_bench_to_dnsmasq.sh
Created August 13, 2019 18:05
DNS Benchmark to dnsmasq
# Export csv from DNS Benchmark to DNSmasq server lines.
# https://www.grc.com/dns/benchmark.htm
# (Runs fine under wine).
cat dns-*.csv | cut -f1 -d"," | sed "s/ //g" | sort | uniq | grep -v Server | xargs -n1 -IXX echo server=XX
@dapperfu
dapperfu / SonoffOpen
Created July 9, 2019 01:30
Get the Sonoffs
nmap -p 80 -oG - 172.16.11.1/24 | grep sonoff | cut -f2 -d" " | sort | uniq | xargs -IXX -n1 firefox http://XX
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 <ADD_YOURS_HERE>
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 <ADD_YOURS_HERE>
127.0.1.1 REPLACE REPLACE.localdomain REPLACE.local REPLACE.lan REPLACE.vlan11 REPLACE.vlan21 REPLACE.vlan31 REPLACE.vlan41 REPLACE.vlan51
@dapperfu
dapperfu / getdev.sh
Created April 15, 2019 01:08
WTF got plugged in?
#!/usr/bin/env bash
function pause(){
read -p "$*"
}
# Baseline
find /dev > /tmp/a
lsusb -v >> /tmp/a
xinput list >> /tmp/a
#!/usr/bin/env bash
exiftool -dateFormat %Y/%m-%b/%Y%m%d_%H%M%S%%-c.%%e "-filename<CreateDate" "$1"
@dapperfu
dapperfu / mbd_pnt_check_lic_expire.m
Created January 29, 2019 04:12
License gets checked *way* too often and makes it hard to deploy to DevOps. Shim to bypass license check.
function varargout = mbd_pnt_check_lic_expire(varargin)
% Delete mbd_pnt_check_lic_expire.p
varargout = {0, 0};
#user nobody;
worker_processes 1;
# This default error log path is compiled-in to make sure configuration parsing
# errors are logged somewhere, especially during unattended boot when stderr
# isn't normally logged anywhere. This path will be touched on every nginx
# start regardless of error log location configured here. See
# https://trac.nginx.org/nginx/ticket/147 for more info.
#
@dapperfu
dapperfu / view_net_devices.sh
Last active January 12, 2019 12:26
What has a server on my network.
#!/usr/bin/env bash
for PORT in 80 8000 8888
do
nmap -p ${PORT} -oG - 10.0.0.0/22 | grep open | cut -f2 -d" " | xargs -n1 -I{} firefox http://{}:${PORT}+
done
nmap -oG - 10.0.0.0/22 -p 554 | grep open
find . -name K01ssh | xargs -n1 rename "s/K01/S01/"