Skip to content

Instantly share code, notes, and snippets.

View lanrat's full-sized avatar
😎
👨‍💻

Ian Foster lanrat

😎
👨‍💻
View GitHub Profile
@lanrat
lanrat / generator.yml
Created October 25, 2023 01:14
APC PDU SNMP-Exporter
modules:
apcpdu:
walk:
- 1.3.6.1.4.1.318.1.1.12
lookups:
- source_indexes:
- rPDULoadStatusIndex
lookup: rPDUOutletStatusOutletName
drop_source_indexes: true
overrides:
#include <stdio.h>
#include <stdint.h>
// Philips Sonicare NFC Head Password calculation by @atc1441
uint16_t CRC16(uint16_t crc, uint8_t *buffer, int len) // Default CRC16 Algo
{
while(len--)
{
crc ^= *buffer++ << 8;
int bits = 0;
do
@lanrat
lanrat / globalentry.sh
Created October 18, 2022 17:10
Global Entry remote appointments
#!/usr/bin/env bash
# exclude empty string
curl -s 'https://ttp.cbp.dhs.gov/schedulerapi/slots?orderBy=soonest&limit=10&remote=true&minimum=1' | grep -v '\[ \]'
@lanrat
lanrat / click_grow_extension.scad
Created February 10, 2022 05:23
click and grow garden extension [WIP]
$fn = 100;
translate([0,0,100/2]) {
difference() {
cube([35,15,100],center=true);
cube([35-2,15-2,100.01],center=true);
translate([0,0,-35]) {
translate([35/2-2,0,0]) {
cube([2,20,30.01],center=true);
@lanrat
lanrat / conformal brush.scad
Created February 10, 2022 05:22
Conformal coating brush cap holder
$fn = 100;
cap_d = 27;
cap_h = 2;
cone_h = 15;
cone_base = 4.6;
cone_tip = 3.8;
union() {
cylinder(h=cap_h, d=cap_d); // cap
@lanrat
lanrat / docker-compose-install.sh
Last active December 29, 2021 19:58
Docker compose v2 installation linux
# https://github.com/docker/compose
curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-linux-x86_64 > /usr/libexec/docker/cli-plugins/docker-compose
chmod +x /usr/libexec/docker/cli-plugins/docker-compose
@lanrat
lanrat / remove-advertisers.js
Last active April 16, 2019 11:32 — forked from bluetidepro/remove-advertisers.js
Auto click "remove" on all facebook advertisers
// I did this in Chrome...
//
// Go to https://www.facebook.com/ads/preferences/
// Click the "Advertisers" section to open it up.
// Click "See more" once
// Before doing anything else, just keep clicking space bar to trigger the "see more" button
// Do this for a bit until all the advertisers are loaded
// then run this below in the dev tools console...
// (It will take a few minutes, depending how many you have, and your browser may lock up, but once it's done you will see it auto clicked the "remove" X in the top right for all of them)
@lanrat
lanrat / settings.json
Created July 29, 2018 04:53
theia settings
/*
Preference file for user scope
Please refer to the documentation online (https://github.com/theia-ide/theia/blob/master/packages/preferences/README.md) to learn how preferences work in Theia
*/
{
"git.decorations.colors": true
"editor.minimap.enabled": true
@lanrat
lanrat / alsa.sh
Created July 28, 2018 05:47
ALSA for Bluetooth on Linux reset Script
#! /usr/bin/env bash
# info: https://wiki.archlinux.org/index.php/Bluetooth_headset#Troubleshooting
set -eu
DEVICE_NAME="TODO"
reset_bt()
{
# turn card off
CARD=$(pactl list cards short | cut -f2 | grep blue | head -1)
@lanrat
lanrat / chrome.md
Created July 28, 2018 02:55
chrome ignore ssl warnings

thisisunsafe