Skip to content

Instantly share code, notes, and snippets.

driver=nl80211
auth_algs=1
wpa_key_mgmt=WPA-PSK
beacon_int=100
ssid=YourWifiNetwork
channel=36
hw_mode=a
ieee80211n=1
require_ht=1
@seanlinmt
seanlinmt / livingroom.yaml
Created December 29, 2020 02:22
esp32 esphome
esphome:
name: livingroom
platform: ESP32
board: esp-wrover-kit
platformio_options:
board_build.partitions: min_spiffs.csv
i2c:
sda: 21
scl: 22
@seanlinmt
seanlinmt / school_zones.py
Created October 30, 2020 05:26
Extracting features from an ArcGIS server using arcpy
import arcpy
arcpy.env.overwriteOutput = True
baseURL = "https://services.arcgis.com/XTtANUDT8Va4DLwI/ArcGIS/rest/services/NZ_School_Zone_boundaries/FeatureServer/0/query"
where = "1=1"
fields = "OBJECTID,School_ID,School_name,Office,Approval_date,Effective_date,Institution_type,Shape__Area,Shape__Length"
query = "?where={}&outFields={}&returnGeometry=true&f=json".format(where, fields)

Keybase proof

I hereby claim:

  • I am seanlinmt on github.
  • I am seanlinmt (https://keybase.io/seanlinmt) on keybase.
  • I have a public key ASDCp9Y7mrERLudXwmhA5JAyzTUDLH9beWdPA8JL62ghxgo

To claim this, I am signing this object:

@seanlinmt
seanlinmt / 85-u2f-screen-lock.rules
Last active June 13, 2022 21:50
lock linux desktop via removal of U2F USB key or any USB device
# /etc/udev/rules.d/85-u2f-screen-lock.rules
# 2 REMOVE event rules for 2 different U2F devices
# to view the various properties you could use to create your rule use => udevadm monitor --property
# You may get multiple matches if your rule is too wide. No rule to unlock because it's not called 2FA for nothing.
# If you want to do that then you would need to add the matching rule for ADD events
ACTION=="remove", ENV{DEVTYPE}=="usb_device", ENV{SUBSYSTEM}=="usb", ENV{PRODUCT}=="1050/120/*", RUN+="/home/sean/bin/u2f-screen-lock.sh"
ACTION=="remove", ENV{ID_BUS}=="usb", ENV{ID_VENDOR_ID}=="096e", ENV{ID_MODEL_ID}=="0853", RUN+="/home/sean/bin/u2f-screen-lock.sh"
@seanlinmt
seanlinmt / gist:526d4fb8f02a35515c55f249b3fdf087
Created November 22, 2017 13:16
cloudflare_dynamic_ip_updater.sh
#!/usr/bin/env python
import json
import requests
import logging
import logging.handlers
import string
import sys
import ipaddress
logger = logging.getLogger(__name__)
@seanlinmt
seanlinmt / hackintosh.sh
Created September 4, 2017 13:00
mac OS QEMU with VGA passthrough, Clover EFI boot
QEMU_AUDIO_DRV=alsa QEMU_ALSA_ADC_BUFFER_SIZE=1024 QEMU_ALSA_ADC_PERIOD_SIZE=256 QEMU_ALSA_DAC_BUFFER_SIZE=1024 QEMU_ALSA_DAC_PERIOD_SIZE=256 QEMU_AUDIO_DAC_FIXED_SETTINGS=1 QEMU_AUDIO_DAC_FIXED_FREQ=44100 QEMU_A
UDIO_DAC_FIXED_FMT=S16 QEMU_AUDIO_ADC_FIXED_FREQ=44100 QEMU_AUDIO_ADC_FIXED_FMT=S16 QEMU_AUDIO_DAC_TRY_POLL=1 QEMU_AUDIO_ADC_TRY_POLL=1 QEMU_AUDIO_TIMER_PERIOD=50
/usr/local/bin/qemu-2.9.0 -machine q35,accel=kvm \
-cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,+vmx,vmware-cpuid-freq=on \
-mem-prealloc \
-drive file=/hackintosh/OVMF_CODE.fd,if=pflash,format=raw,unit=0,readonly=on \
-drive file=/hackintosh/OVMF_VARS.fd,if=pflash,format=raw,unit=1 \
-m 4096 \
-smp 4,sockets=1,cores=2,threads=2 \
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \
@seanlinmt
seanlinmt / mapproxy.yaml
Created August 26, 2017 02:07
sample mapproxy configuration
globals:
http:
client_timeout: 10
image:
resampling_method: bicubic
services:
demo:
tms:
use_grid_names: true
origin: 'nw'