Skip to content

Instantly share code, notes, and snippets.

View noahwilliamsson's full-sized avatar

noahwilliamsson

  • Reykjavík, Iceland
View GitHub Profile
@noahwilliamsson
noahwilliamsson / apple-vdm-get-actions-list.md
Last active April 13, 2022 07:50
Apple USB-PD VDM get-actions-list
Model / port 0x101 0x103 0x105 0x106 0x201 0x203 0x206 0x208 0x301 0x303 0x304 0x306 0x30a 0x502 0x606 0x702 0x803 0x809 0xb11 0x4606
MacBookAir10,1 (MBA’20) LR N/A 0x8000 0x8000 N/A N/A N/A 0x187 0x20c 0x318 0x8001 N/A 0x
@noahwilliamsson
noahwilliamsson / edgeswitch-exec-commands.py
Created July 31, 2019 10:55
Execute a list of (hard-coded) commands against Ubiquiti EdgeSwitches
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Execute a list of (hard-coded) commands against Ubiquiti EdgeSwitches
#
# The output will look similar to this:
# lon-sw-core01 [show client-info] show client-info
# lon-sw-core01 [show client-info]
# lon-sw-core01 [show client-info] VLAN-ID MAC Address Intf Hostname IP Address
# lon-sw-core01 [show client-info] ------- ----------------- ----- ----------------------- -----------------------
@noahwilliamsson
noahwilliamsson / slack-parse-html-logs.py
Created April 5, 2019 23:34
Parse Slack's HTML formatted audit access logs to JSON
#!/usr/bin/env python
#
# Parse Slack's HTML formatted audit access logs (https://theteam.slack.com/admin/logs)
# ..because structured audit logs is apparently an enterprise feature
#
# -- noah@hack.se
#
#
# 1. Open the browser's developer console
# 2. Open https://your-unique-subdomain.slack.com/admin/logs?page=1 and note how many pages are available (e.g. 2175)
@noahwilliamsson
noahwilliamsson / micropython-esp32-rmt-ws2812.py
Created December 18, 2018 20:07
Pycom LoPy (ESP32) Micropython RMT example for WS2812
brightness_lut = [
[4,9,4,9,4,9,4,9,4,9,4,9,4,9,4,9],
[4,9,4,9,4,9,4,9,4,9,4,9,4,9,8,5],
[4,9,4,9,4,9,4,9,4,9,4,9,8,5,4,9],
[4,9,4,9,4,9,4,9,4,9,4,9,8,5,8,5],
[4,9,4,9,4,9,4,9,4,9,8,5,4,9,4,9],
[4,9,4,9,4,9,4,9,4,9,8,5,4,9,8,5],
[4,9,4,9,4,9,4,9,4,9,8,5,8,5,4,9],
[4,9,4,9,4,9,4,9,4,9,8,5,8,5,8,5],
[4,9,4,9,4,9,4,9,8,5,4,9,4,9,4,9],
@noahwilliamsson
noahwilliamsson / klipper-temp.py
Created July 7, 2018 14:10
Graph temperature logs from the klippy.log file with plot.ly
#!/usr/bin/env python
#
# Graph temperature logs from the klippy.log file generated by
# https://github.com/KevinOConnor/klipper
#
# You will need a free https://plot.ly account and an API key from:
# https://plot.ly/settings/api#/
#
# Usage:
# pip install --user plotly cryptography cryptography nose tornado six
@noahwilliamsson
noahwilliamsson / rt90-index.php
Created November 17, 2015 13:18
Konvertera SWEREF99 och RT90 till WGS84
<?php
/**
* Conversion between RT90 and WGS84 (lat/lon) using the
* Debian package proj-bin (PROJ.4)
*
* http://trac.osgeo.org/proj/
* http://wiki.openstreetmap.org/wiki/Converting_to_WGS84#Sweden
*
* -- noah, dec 2013
*/
@noahwilliamsson
noahwilliamsson / hostapd.conf
Created November 5, 2015 22:48
WPA-EAP (Enterprise) configuration for hostapd
interface=wlan0
# --------------------------------------
bss=wlan1
ssid=EAP
# IEEE 802.11 specifies two authentication algorithms. hostapd can be
# configured to allow both of these or only one. Open system authentication
# should be used with IEEE 802.1X.
# Bit fields of allowed authentication algorithms:
# bit 0 = Open System Authentication

Keybase proof

I hereby claim:

  • I am noahwilliamsson on github.
  • I am nw (https://keybase.io/nw) on keybase.
  • I have a public key whose fingerprint is 992D 3E39 3356 B71E AEC5 8517 C3E9 9B55 4A2A DEAD

To claim this, I am signing this object: