This file contains hidden or 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
server { | |
listen 443 ssl; | |
server_name YOUR_TRANSMISSION_HOST_NAME; | |
ssl_certificate /usr/local/etc/nginx/ssl/nginx.crt; | |
ssl_certificate_key /usr/local/etc/nginx/ssl/nginx.key; | |
# you should create a self-signed cert: | |
# sudo mkdir -p /usr/local/etc/nginx/ssl | |
# sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /usr/local/etc/nginx/ssl/nginx.key -out /usr/local/etc/nginx/ssl/nginx.crt |
This file contains hidden or 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
$ newYearsDay(){ date -v "${1:-$(date +"%Y")}y" -v 01m -v 01d +"%A"; } | |
$ newYearsDay 2025 | |
Wednesday | |
$ newYearsDay 2024 | |
Monday | |
$ newYearsDay # default value is current year | |
Wednesday |
This file contains hidden or 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 | |
set -eu -o pipefail | |
# Generate all permutations of a given string | |
# Usage: permutate "string" | |
permutate() { | |
local string=$1 | |
local prefix=${2:-} | |
local result=() | |
local len=${#string} |
This file contains hidden or 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
# one-liner in Bash | |
$ target=3; for i in "flour:200" "sugar:100" "eggs:2"; do echo "${i%%:*}:$(( ${i##*:} * target ))"; done | |
flour:600 | |
sugar:300 | |
eggs:6 |
This file contains hidden or 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
# this file is $HOME/.config/yt-dlp/config | |
# https://github.com/yt-dlp/yt-dlp?tab=readme-ov-file#readme | |
# Output location | |
--paths "temp:/tmp" | |
--paths "home:/Volumes/DSMedia/Media/Download" | |
# Process metadata first | |
--parse-metadata "title:%(title)s" |
This file contains hidden or 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 | |
set -uo pipefail | |
cycles=("done" "dry" "spin" "rinse" "wash" "soak") | |
createLaundryItem() { echo "5"; } | |
nextCycle() { | |
echo "${cycles[$1]}" | |
(($1 > 0)) && return $(($1 - 1)) || return 0 |
OlderNewer