Skip to content

Instantly share code, notes, and snippets.

@1activegeek
1activegeek / Installation.md
Last active September 30, 2022 18:29 — forked from albertbori/Installation.md
Automatically disable Wifi when an Ethernet connection (cable) is plugged in on a Mac

ADAPTED FOR MY OWN USE

Modified for use on M1Max Macbook Pro using a desktop dock for ethernet, and wifi when off dock.

Overview

This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.

Most the credit for these changes go to Dave Holland.

Requirements

@1activegeek
1activegeek / Docker Cleanup Snippets.md
Created March 26, 2020 23:20
Useful snippets for docker cleanup tasks

Docker Cleanup

Host cleanup - cleanup old kernels for ubuntu and other various apt related updates
apt-get autoclean
apt-get autoremove

List out the volumes that are no longer necessary or used
@1activegeek
1activegeek / Recover unRAID encrypted BTRFS Data
Created March 26, 2020 16:36
Details and links on what I used to be able to mount a filesystem that was not mounting inside of unRAID so I could get my data off the encrypted BTRFS cache pool
https://wiki.archlinux.org/index.php/Dm-crypt/Device_encryption
===============================================
Unlocking/Mapping LUKS partitions with the device mapper
Once the LUKS partitions have been created, they can then be unlocked.
The unlocking process will map the partitions to a new device name using the device mapper. This alerts the kernel that device is actually an encrypted device and should be addressed through LUKS using the /dev/mapper/dm_name so as not to overwrite the encrypted data. To guard against accidental overwriting, read about the possibilities to backup the cryptheader after finishing setup.
@1activegeek
1activegeek / Directions.txt
Last active March 26, 2020 17:44
Donations HTML for a customized banner in an Organizr2 homepage
1. Enable the Custom HTML homepage object
2. Make sure under the homepage items order, you've put this Custom object toward the top or where you'd like it to be.
3. In the Code box, copy and paste the above code in and click save.
4. Customize to your liking and adjust as needed for your situation.
5. Reference https://shields.io for more info on how to fully customize these for your needs and your desired look/feel.
@1activegeek
1activegeek / healthchecks.sh
Last active May 19, 2022 13:53
Healthchecks.io Bash Script
#!/bin/bash
## Checks get listed here as variables with a call to their respective command
## Sub token with Organizr API token
radarr=$(curl -o /dev/null -s -w "%{http_code}\n" -H "token: token" https://domain.com/radarr)
sonarr=$(curl -o /dev/null -s -w "%{http_code}\n" -H "token: token" https://domain.com/sonarr)
ombi=$(curl -o /dev/null -s -w "%{http_code}\n" -H "token: token" https://domain.com/requests)
plex=$(curl -L -o /dev/null -s -w "%{http_code}\n" -H "token: token" https://domain.com/plex)
domain=$(curl -o /dev/null -s -w "%{http_code}\n" -H "token: token" https://domain.com/)

Keybase proof

I hereby claim:

  • I am 1activegeek on github.
  • I am shawnmix (https://keybase.io/shawnmix) on keybase.
  • I have a public key whose fingerprint is 624F 5F70 DBC4 4304 4FAF BEDD 1929 5558 D9AF 1FDB

To claim this, I am signing this object: