Skip to content

Instantly share code, notes, and snippets.

View davidfischer's full-sized avatar

David Fischer davidfischer

  • Read the Docs
  • San Diego, CA
  • 19:22 (UTC -07:00)
View GitHub Profile
@davidfischer
davidfischer / analyze-har.py
Created September 28, 2022 20:19
Parses a .har file (a recording from the browser's developer console) and outputs the unique domains where a request is made and what that domain resolves to.
import argparse
import json
import subprocess
from haralyzer import HarParser, HarPage
def get_dns_response(domain):
output = subprocess.check_output(["dig", "+short", domain], text=True)
return [l.strip() for l in output.split("\n") if len(l.strip()) > 0]
@davidfischer
davidfischer / check_ssl.py
Last active November 14, 2021 23:21
Check a server's SSL certificate expiry time
import socket
import ssl
from cryptography import x509
from cryptography.hazmat.primitives import hashes
hostnames = [
"expired.badssl.com",
"untrusted-root.badssl.com",
@davidfischer
davidfischer / redirect-tests.py
Created August 15, 2018 18:12
Test Read the Docs HTTPS redirects
from __future__ import print_function, unicode_literals
import requests
from requests.exceptions import RequestException
def request_url(url):
try:
return requests.get(url)
except RequestException as e:
@davidfischer
davidfischer / downtime.html
Created July 23, 2018 21:02
A scheduled maintenance page for Read the Docs
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Read the Docs is down for maintenance</title>
<style>
html {
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
font-size: 16px;
@davidfischer
davidfischer / datdota-responsive-tables.diff
Created March 9, 2018 22:59
DatDota responsive tables
diff --git a/datdota.com/heroes/elo.html b/datdota.com/heroes/elo.html
index 39b37d2..0656554 100644
--- a/datdota.com/heroes/elo.html
+++ b/datdota.com/heroes/elo.html
@@ -664,7 +664,7 @@ Help!
<div class="col-md-12">
<div class="hr-line-dashed"></div>
<h3>Results</h3>
-<div class="table-responsive col-md-4">
+<div class="table-responsive col-lg-4">
@davidfischer
davidfischer / datdota-filters.diff
Created March 9, 2018 22:54
DatDota match filters improvements
diff --git a/datdota.com/heroes/elo.html b/datdota.com/heroes/elo.html
index 39b37d2..8518f93 100644
--- a/datdota.com/heroes/elo.html
+++ b/datdota.com/heroes/elo.html
@@ -316,7 +316,7 @@ Help!
<hr>
<div class="ibox float-e-margins">
<form method="get" class="form-horizontal">
-<div class="col-md-4">
+<div class="col-lg-6 col-md-12">
@davidfischer
davidfischer / datdota-mobile.diff
Created March 8, 2018 05:32
Changes to DatDota.com to make the mobile navigation work correctly
diff --git a/datdota.com/index.html b/datdota.com/index.html
index 7c0a5b9..f088996 100644
--- a/datdota.com/index.html
+++ b/datdota.com/index.html
@@ -413,6 +413,15 @@ Help!
</div>
</nav>
<div id="page-wrapper" class="gray-bg dashbard-1">
+
+<div class="row border-bottom">
@davidfischer
davidfischer / create-ipblocks.py
Created July 25, 2016 18:04
Scripts for importing IP geolocation data from MaxMind
"""
Process the MaxMind GeoLite2 IPv4 and IPv6 blocks CSVs
into a single CSV with network and broadcast addresses
calculated
STEPS
* Download the MaxMind GeoLite2 city databases:
http://dev.maxmind.com/geoip/geoip2/geolite2/
* Run this program to calculate network and broadcast
addresses for each IP network entry
@davidfischer
davidfischer / README.md
Last active August 29, 2015 14:21
Beer Styles
  • International bittering units or IBU is a way of measuring the perceived bitterness of beer
  • Standard Reference Method or SRM is a system for measuring the color of beer
@davidfischer
davidfischer / README.md
Last active August 29, 2015 14:16
Meetup Growth of San Diego Python

This graph shows the growth of San Diego Python since the group was rebooted in February 2012. Growth has been very steady and regular.