Skip to content

Instantly share code, notes, and snippets.

@assimilat
assimilat / screen_mirror.applescript
Created June 26, 2021 01:32
Toggles screen mirroring to the airplay device named "Bedroom"
tell application "System Preferences"
quit
end tell
tell application "System Preferences"
activate
set the current pane to pane id "com.apple.preference.displays"
tell application "System Events"
delay 1
set window_name to name of first window of (first application process whose frontmost is true)
get window_name
@assimilat
assimilat / duo-proxy-fargate.template.yaml
Created July 28, 2021 16:17
duo_proxy_fargate_template
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
# AWS Customer Agreement - https://aws.amazon.com/agreement
AWSTemplateFormatVersion: 2010-09-09
Description: >
Configures Duo RADIUS ECS services using Fargate for use in Directory Service MFA (can be used
for AWS SSO, WorkSpaces, and other SAML service providers)
Metadata:
QuickStartDocumentation:
@assimilat
assimilat / pam_modules.list
Created October 22, 2021 19:10
list_of_pam_modules
https://github.com/nuvious/pam-duress
A Pluggable Authentication Module (PAM) which allows the establishment of alternate passwords that can be used to perform actions to clear sensitive data, notify IT/Security staff, close off sensitive network connections, etc if a user is coerced into giving a threat actor a password.
https://github.com/uber/pam-ussh
uber's ssh certificate pam module
https://github.com/Yubico/yubico-pam
Yubico Pluggable Authentication Module (PAM)
https://github.com/hamzasood/pam_touchid
[admin@citadel info]# /opt/bin/lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 5.5T 0 disk
├─sda1 8:1 0 517.7M 0 part
│ └─md9 9:9 0 517.6M 0 raid1 /mnt/HDA_ROOT
├─sda2 8:2 0 517.7M 0 part
│ └─md256 9:256 0 517.7M 0 raid1 [SWAP]
├─sda3 8:3 0 5.4T 0 part
│ └─md1 9:1 0 38.1T 0 raid5
│ └─drbd1 147:1 0 38.1T 0 disk
vg1-tp1_tierdata_0 253:2 0 4M 0 lvm
└─vg1-tp1-tpool 253:6 0 37.9T 0 lvm
├─vg1-tp1 253:7 0 37.9T 0 lvm
├─vg1-lv288 253:8 0 25T 0 lvm
│ └─cachedev288 253:4 0 25T 0 f82d06f9
└─vg1-lv3 253:9 0 100G 0 lvm
└─cachedev3 253:0 0 100G 0 68757d0f /share/CACHEDEV3_DATA
vg1-tp1_tierdata_1 253:3 0 4M 0 lvm
└─vg1-tp1-tpool 253:6 0 37.9T 0 lvm
├─vg1-tp1 253:7 0 37.9T 0 lvm
[
{
"type": "lte",
"registered": true,
"asu": 18,
"dbm": -122,
"level": 0,
"ci": 6868227,
"pci": 317,
"tac": 43777,
@assimilat
assimilat / bxe_elink.c
Created October 28, 2021 00:58
bxe_elink.c patched for 2.5Gb/s
diff --git a/sys/dev/bxe/bxe.c b/sys/dev/bxe/bxe.c
index cf8cfb66e..43d3e5f6a 100644
--- a/sys/dev/bxe/bxe.c
+++ b/sys/dev/bxe/bxe.c
@@ -104,7 +104,7 @@ static struct bxe_device_type bxe_devs[] = {
BRCM_VENDORID,
CHIP_NUM_57711,
PCI_ANY_ID, PCI_ANY_ID,
- "QLogic NetXtreme II BCM57711 10GbE"
+ "QLogic NetXtreme II BCM57711 10GbE [BELL BYPASS]"
@assimilat
assimilat / relay_control.cpp
Last active December 7, 2021 01:04
sainsmart 8 channel relay control
volatile byte relayState = LOW;
long lastDebounceTime = 0;
long debounceDelay = 1000;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
@assimilat
assimilat / set_pin.sh
Last active December 6, 2021 22:31
set and/or check an arduino's pinstate. for use with: https://gist.github.com/assimilat/8bb0921333054be777c6ac16318ad59d
#!/bin/bash -
#===============================================================================
#
# FILE: set_pin.sh
#
# USAGE: set_pin.sh
#
# DESCRIPTION:
#
# OPTIONS: ---