Skip to content

Instantly share code, notes, and snippets.

View dadrian's full-sized avatar

David Adrian dadrian

View GitHub Profile
@dadrian
dadrian / gist:9999354
Created April 5, 2014 23:23
Keybase Gist
### Keybase proof
I hereby claim:
* I am dadrian on github.
* I am dadrian (https://keybase.io/dadrian) on keybase.
* I have a public key whose fingerprint is 1A43 E9DC 0B4B 6EAF 547A 590B 07FD 8DBD F1A9 578B
To claim this, I am signing this object:
module Main where
import Language.C
import Language.C.System.GCC -- preprocessor used
import Language.C.Syntax.AST
main = parseMyFile "header.h" >>= printMyAST
parseMyFile :: FilePath -> IO CTranslUnit
parseMyFile input_file =
do parse_result <- parseCFile (newGCC "gcc") Nothing ["-U__BLOCKS__"] input_file
@dadrian
dadrian / known_hosts
Created December 20, 2014 22:48
GitHub known_hosts
github.com,192.30.252.0 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
github.com,192.30.252.1 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
github.com,192.30.252.2 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84Ke

36 scans using ZGrab over the course of 36 hours of the Alexa Top 1 Million performed a few days ago.

  • Offer only export suites
  • Look at the keys that come back

Ends up with a distribution that looks like this:

graph

Pardon my GNUPloting :)

@dadrian
dadrian / premake5.lua
Last active August 29, 2015 14:23
gtest premake5 example
solution "MySolution"
configurations { "Debug", "Release" }
filter { "configurations:Debug" }
defines { "DEBUG" }
flags { "Symbols" }
filter { "configurations:Release" }
defines { "NDEBUG" }
optimize "On"
{
"ip": "192.168.59.103",
"timestamp": "2015-11-09T16:23:10-05:00",
"data": {
"iscsi": {
"ip": "192.168.59.103:3260",
"had_error": false
}
}
}
course_number course_name light_count light_fraction moderate_count moderate_fraction heavy_count heavy_fraction extremely_heavy_count extremely_heavy_fraction total_count average_score
182 Building Applications for Info. Systems 6 0.67 2 0.22 0 0 1 0.11 9 1.56
183 Elementary Programming Concepts 54 0.51 47 0.44 4 0.04 2 0.02 107 1.57
203 Discrete Mathematics 118 0.24 301 0.62 57 0.12 9 0.02 485 1.91
215 Introduction to Circuits 8 0.03 132 0.45 128 0.44 25 0.09 293 2.58
216 Introduction to Signals and Systems 12 0.05 128 0.50 95 0.37 19 0.07 254 2.48
230 Electromagnetics I 10 0.07 83 0.61 39 0.29 4 0.03 136 2.27
250 Electronic Sensing Systems 12 0.80 1 0.07 2 0.13 0 0 15 1.33
270 Introduction to Logic Design 23 0.08 200 0.67 65 0.22 9 0.03 297 2.20
280 Programming and Introductory Data Structures 37 0.06 374 0.59 185 0.29 35 0.06 631 2.35
@dadrian
dadrian / censys_get_intermediates.py
Created May 8, 2016 20:37
Download all trusted NSS intermediates from Censys as PEM's (ignores roots)
from censys.certificates import CensysCertificates
import base64
query = "current_valid_nss: true AND parsed.extensions.basic_constraints.is_ca: true AND NOT current_in_nss: true"
fields = ["raw"]
def split(input, size):
for start in range(0, len(input), size):
yield input[start:start+size]
@dadrian
dadrian / makefile
Last active June 29, 2022 18:29
Makefile for bootstrapping a Python project
VIRTUALENV_DIR ?= ./env
PYTHON ?= python3
PIP=$(VIRTUALENV_DIR)/bin/pip
VIRTUAL_PYTHON=$(VIRTUALENV_DIR)/bin/python
VIRTUALENV_BIN=$(PYTHON) -m venv
REQUIREMENTS ?= requirements.txt
all: help
.PHONY: build
# Usage: python3 tldr_fail_test.py ${HOSTNAME}
#
# You can optionally pass the destination IP with --addr
#
# Author: davidben [at] chromium [dot] org
import argparse
import socket
import time