Skip to content

Instantly share code, notes, and snippets.

View luckman212's full-sized avatar

Luke Hamburg luckman212

View GitHub Profile
@luckman212
luckman212 / .env
Last active September 3, 2023 01:27
docker-compose config for speedtest-tracker + MariaDB on Synology
# place in same dir as compose.yml, adjust as needed for your environment
# create a limited user and run `id <username>` to get the PUID/PGID values
TZ=America/New_York
CNAME=speedtest
DOCKER_DIR=/volume1/docker
PUID=1030
PGID=100
MARIADB_DATABASE=speedtest-tracker
MARIADB_USER=speedy
@jwmcgettigan
jwmcgettigan / bitwarden_duplicate_cleaner.py
Last active October 31, 2024 13:09
Identifies and removes duplicate 'items' and 'folders' from your Bitwarden vault. 🎃
#!/usr/bin/env python3
# Copyright © 2023 Justin McGettigan
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software
# and associated documentation files (the “Software”), to deal in the Software without
# restriction, including without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or
#!/bin/sh
# This is an example script to force provision a UniFi network device using the controller API
# If you are running this externally then replace localhost with the hostname
baseurl=https://localhost:8443
# I would make a dedicated admin user for this
username=<username_here>
password=<password_here>
@luckman212
luckman212 / pwgen-dw.py
Last active January 25, 2023 15:01
small wrapper around diceware (https://pypi.org/project/diceware) to implement multiple passphrase generation
#!/usr/bin/env python3
"""
generates multiple random passphrases in one go
https://github.com/ulif/diceware/issues/53
requires diceware: pip install diceware
"""
import os
@luckman212
luckman212 / syno_hb_hcio.sh
Last active November 7, 2024 17:39
Script to ping healthchecks.io if Synology HyperBackup was successful
#!/usr/bin/env bash
ENDPOINT='https://hc-ping.com/{insert-HealthChecks-UUID-here}'
#logfile location changed as of v4.1.2-4039
#LOGFILE='/var/log/synolog/synobackup.log'
LOGFILE='/volume1/@appdata/HyperBackup/log/synolog/synobackup.log'
[[ -e $LOGFILE ]] || exit 1
awk -f- $LOGFILE <<'EOF'
@wrmack
wrmack / Win11.md
Last active August 24, 2024 13:27
Windows 11 on MacBook M1

Windows 11 on MacBook M1 (ARM)

Steps I went through to install a Windows Insider Preview VHDX on a Macbook Pro using UTM. I needed Windows because I was developing an app to submit to the Microsoft Store. With the following setup I was able to develop an electron-based app and submit it to the Microsoft Store.

  1. Download the VHDX from Windows Insider Previews. You need to register for the Insider Program and sign in.
    • under Select edition select the Canary channel and press Confirm
    • select language and confirm
    • press Download
  2. Open UTM and press + to create a new virtual machine
    • Virtualize
  • Windows
@luckman212
luckman212 / imessage-i-mean-what-i-type.sh
Last active October 13, 2022 05:00
Possible fix for iMessage text mangling
#!/usr/bin/env bash
# ref:
# https://forums.macrumors.com/threads/smart-quotes-forced-on-in-messages.2284346/post-30657259
_res() {
(( res += $1 ))
}
res=0
@luckman212
luckman212 / devteamid.sh
Last active October 17, 2024 12:49
grab Apple DEVELOPMENT_TEAM ID from Keychain
#!/usr/bin/env bash
CODESIGN_CN_STRING='Developer ID Application'
#CODESIGN_CN_STRING='Apple Development'
#requires openssl@3 from Homebrew
_openssl=$(brew --prefix openssl 2>/dev/null)/bin/openssl
[[ -x $_openssl ]] || { echo "missing openssl, try \`brew install openssl\`"; exit 1; }
#find development cert
<%*
//v0.2 - bug fix: when search results match just a file name and no line contents under it
//User can set the following two parameters
const resultFilePrefix = '## ';
const folderLocation = '/search';
const search = app.workspace.getLeavesOfType("search")[0];
const searchTerms = search.view.getQuery();
const arrCount = Array.from(search.view.dom.resultDomLookup);
@luckman212
luckman212 / Insert current search as a markdown link.js
Last active April 8, 2022 15:17
Templater: Insert current search as a markdown link