Skip to content

Instantly share code, notes, and snippets.

View djdembeck's full-sized avatar

David Dembeck djdembeck

View GitHub Profile
@djdembeck
djdembeck / 07-renew-public-att-dhcp.sh
Last active May 21, 2023 02:19
UDMP Allow use of AT&T DHCP IP as static IP and keeps the lease alive
#!/bin/bash
# Polls AT&T's DHCP server for updates, to keep static IPs alive.
# This allows UDM Pro users to set their DHCP IP as 'static' in the 'Internet' section
# allowing the use of static IP configuration in Unifi Network.
# 1. Find your DHCP IP.
# 2. Set Internet IPv4 to Static IP, and enter your DHCP address. Gateway is going to be .1
# 3. Add your static IP block to Additional IP Addresses
# 4. Place this script in the on_boot.d/ directory: https://github.com/unifi-utilities/unifios-utilities/tree/main/on-boot-script
# 5. After reboot, check the script is working: cat /var/log/udhcpc.log
@djdembeck
djdembeck / audible-all-asins.js
Last active October 3, 2021 19:08
Collect and log all Audible asins
const fetch = require('isomorphic-fetch');
const url = 'https://api.audible.com/1.0/catalog/products/?num_results=50'
const delay = ms => new Promise(resolve => setTimeout(resolve, ms))
// Best to pipe out the results, like `node file.js > asins.txt`
function makeGetRequest(path) {
return new Promise(function (resolve, reject) {
fetch(path).then(
(response) => {
var result = response.json();
@djdembeck
djdembeck / audnexus-seeder.js
Last active September 27, 2021 05:43
Seeds audnexus with all current audible asins
const fetch = require('node-fetch');
const url = 'https://api.audible.com/1.0/catalog/products/?num_results=1'
const audnexus = 'https://api.audnex.us/books/'
function makeGetRequest(path) {
return new Promise(function (resolve, reject) {
fetch(path).then(
(response) => {
var result = response.json();
resolve(result);
@djdembeck
djdembeck / plexdb-repair.bash
Last active November 12, 2020 00:39
Linux Plex SQLite DB repair script
#/bin/bash
# quick script to perform actions from https://support.plex.tv/articles/201100678-repair-a-corrupt-database/
# MUST BE RUN FROM INSIDE "Library/Application Support/Plex Media Server/Plug-in Support/Databases"
# Don't forget to check user permissions of the databases after this script runs. Wrong user permissions will cause "Starting Plex Media Server" loop
# Only proceed if sqlite3 is found
if [[ -z $(which sqlite3) ]]; then
echo "ERROR: sqlite3 is not installed, exiting"
exit 1
fi