Skip to content

Instantly share code, notes, and snippets.

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

Ian Foster lanrat

😎
👨‍💻
View GitHub Profile
@lanrat
lanrat / NetworkManager.conf
Created July 12, 2016 01:19
NetworkManager ignore docker, virtualbox, and vmware adapters
[main]
plugins=ifupdown,keyfile
[ifupdown]
managed=false
[keyfile]
unmanaged-devices=interface-name:docker0;interface-name:vmnet1;interface-name:vmnet8;interface-name:vboxnet0
@lanrat
lanrat / rtorrent.rc
Created February 16, 2015 04:08
rtorrent configuration
# Maximum and minimum number of peers to connect to per torrent.
min_peers = 40
max_peers = 64
# Same as above but for seeding completed torrents (-1 = same as downloading)
min_peers_seed = 1
max_peers_seed = 1
# Maximum number of simultanious uploads per torrent.
max_uploads = 10
@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:
@lanrat
lanrat / awmtt.sh
Created January 26, 2015 19:38
run awesome in a nested window for testing
#!/usr/bin/env bash
# awmtt: awesomewm testing tool
#{{{ Usage
usage() {
cat <<EOF
awmtt [ start | stop | restart | -h | -e | -t [ get | change | list | random ] ] [ -C /path/to/rc.lua ] [ -D display ] [ -S windowsize ]
start Spawn nested Awesome via Xephyr
stop Stops Xephyr
#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 / bandwidth.sh
Created December 21, 2015 20:40
DD-WRT SNMP bandwidth
#!/usr/bin/env bash
HOST=192.168.1.1
IFACE_ID=3
SAMPLE=5
## iface
NAME=$(snmpget -v 2c -c public -O q $HOST iso.3.6.1.2.1.2.2.1.2.$IFACE_ID | cut -d ' ' -f2)
echo "Bandwidth for $NAME"
## bytes
D1=$(snmpget -v 2c -c public -O q $HOST iso.3.6.1.2.1.2.2.1.10.$IFACE_ID | cut -d ' ' -f2)
U1=$(snmpget -v 2c -c public -O q $HOST iso.3.6.1.2.1.2.2.1.16.$IFACE_ID | cut -d ' ' -f2)
@lanrat
lanrat / wmtt.sh
Created January 26, 2015 19:42
run nested window-manager
#!/usr/bin/env bash
# wmtt: wm testing tool
# built from the awmtt script
#Default Variables
#TODO make this arg passable
WM="openbox-session"
ME=$(basename ${0})
# Display and window size
D=1
@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