This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
ENDPOINT='https://hc-ping.com/{insert-HealthChecks-UUID-here}' | |
LOGFILE='/var/log/synolog/synobackup.log' | |
[[ -e $LOGFILE ]] || exit 1 | |
awk -f- $LOGFILE <<'EOF' | |
BEGIN { | |
FS="\t"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# ref: | |
# https://forums.macrumors.com/threads/smart-quotes-forced-on-in-messages.2284346/post-30657259 | |
_res() { | |
(( res += $1 )) | |
} | |
res=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%* | |
//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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%* | |
var searchLeaf; | |
app.workspace.iterateAllLeaves(leaf => { | |
if (leaf.view.getViewType() === 'search') { | |
searchLeaf = leaf; | |
}}); | |
if (typeof(searchLeaf) !== 'undefined') { | |
var q = searchLeaf.view.getQuery(); | |
if (q !== '') { | |
var md = '[search: ' + q + '](obsidian://search?query=' + encodeURIComponent(q) + ')'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ Live-updating floating windows at your service! | |
https://www.hammerspoon.org/docs/hs.window.html | |
https://www.hammerspoon.org/docs/hs.canvas.html | |
https://www.hammerspoon.org/docs/hs.image.html | |
https://www.hammerspoon.org/docs/hs.mouse.html | |
https://www.hammerspoon.org/docs/hs.timer.html | |
https://www.lua.org/manual/5.4/manual.html#6.2 (coroutines) | |
https://github.com/Hammerspoon/hammerspoon/issues/2710#issuecomment-788266990 (thanks @asmagill) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Create pagebreaks in exported Obsidian PDFs. | |
Example: | |
# Heading 1 | |
Lorem Ipsum is simply dummy text of the printing and typesetting industry. | |
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, | |
when an unknown printer took a galley of type and scrambled it to make a type |
NewerOlder