Skip to content

Instantly share code, notes, and snippets.

View tkw1536's full-sized avatar
:octocat:
{{ .Status }}

Tom Wiesing tkw1536

:octocat:
{{ .Status }}
View GitHub Profile
@tkw1536
tkw1536 / all-exposure-checks-json.go
Created August 14, 2020 01:03
Quick and Dirty Parsing of `all-exposure-checks.json` from Android
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"sort"
"time"
)
@tkw1536
tkw1536 / manualcert.sh
Last active May 31, 2020 10:21
Manually make some certbot certs
#!/bin/bash
set -e
# This file generates a cerificate for a given set of domains using certbot.
# Usage: manualcert.sh <path to credentials> [--] <domain1> <domain2> ...
# Examples:
# Make a directory certs/ to store credentials in.
# Create a certificate: bash manualcert.sh certs example.com
# Renew a certificate: bash manualcert.sh certs -- renew -a manual -d 'example.com'
@tkw1536
tkw1536 / daemon.json
Created March 30, 2020 11:03
/etc/docker/daemon.json config file
{ "default-address-pools": [ {"base":"10.10.0.0/16","size":24} ] }
@tkw1536
tkw1536 / uuids.py
Created August 7, 2019 13:10
A check if Python's UUIDs are reasonably unique
import uuid
ids = set()
i = 0
MAX = 10 ** 7
while i < MAX:
u = str(uuid.uuid4())
if u in ids:
print("{}: {} DUPLICATE".format(i, u))
from scscp import SCSCPCLI
from openmath import openmath as om
def main():
# Eval(GAP, 1) TODO: Syntactic sugar
evalSymbol = om.OMSymbol(name='Eval', cd='Systems', cdbase='http://opendreamkit.org')
GAPSymbol = om.OMSymbol(name='GAPEval', cd='Systems', cdbase='http://opendreamkit.org')
query = om.OMApplication(evalSymbol, [GAPSymbol, om.OMInteger(integer=1)])
print(query)
@tkw1536
tkw1536 / example.tex
Last active October 10, 2019 02:02
Example for the new LaTeXML locators
\documentclass{article}
% to make sure that the binding is loaded, compile this with:
% latexml --preload example.tex.ltxml example.tex --dest=example.xml
\begin{document}
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Morbi non nisl metus.
\begin{quote}
Nunc efficitur, elit id accumsan iaculis, nisl mauris sodales sapien, in rutrum turpis neque finibus eros.
@tkw1536
tkw1536 / gsuitestats.py
Created May 15, 2018 09:26
Ugly hack to generate stats via the Google Directory API
from __future__ import print_function
import httplib2
import os
from apiclient import discovery
from oauth2client import client
from oauth2client import tools
from oauth2client.file import Storage
@tkw1536
tkw1536 / glutils.py
Created April 5, 2018 09:44
Generate a bash script that clones all GitLab repositories and runs a commit on all branches.
#!/usr/bin/env python
"""
Generate a bash script that clones all GitLab repositories and runs a commit on all branches.
Usage:
python3 glutils.py $glURL $token $command $commitMessage > script.sh
bash script.sh
"""
import sys
@tkw1536
tkw1536 / transform.py
Created March 15, 2018 12:44
Hack to quickly transform svg path
import re
def translatePath(pth, x, y):
is_x = True
def replacer(c):
nonlocal is_x
s = c.group()
print(is_x)

Keybase proof

I hereby claim:

  • I am tkw1536 on github.
  • I am tkw01536 (https://keybase.io/tkw01536) on keybase.
  • I have a public key ASA9m8upNa63mUHQNzqxknhdr13VmdqL49JfZvXIZkQyBQo

To claim this, I am signing this object: