This is a simple script to control syncthing
. It is
possible to also source this script in 'sh'-like shells (tested in dash
,
bash
and zsh
).
When used as a script it accepts a number of subcommands; if sourced, a number
of syncthing_*
functions are defined.
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
[Adblock Plus 2.0] | |
! Version: 202503191345 | |
! Title: Lean YouTube filters | |
! Last modified: 19 Mar 2025 13:45 UTC | |
! Expires: 14 days (update frequency) | |
! License: https://creativecommons.org/publicdomain/zero/1.0/ | |
! | |
! This is a list of filters I maitain to make YouTube usable for me. | |
! It helps with making the site less distracting and annoying to interact | |
! with for users without who are logged out. |
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 sh | |
target_boot_name='Windows Boot Manager' | |
windows_boot_id="$(efibootmgr --unicode | grep "$target_boot_name" | sed 's/Boot\([0-9a-fA-F]\{4\}\)\*\? .*/\1/')" | |
if [ ${#windows_boot_id} -ne 4 ]; then | |
echo "$0: Could not find boot id for Windows." | |
exit 1 | |
fi |
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
# ZFS Root Snapshot Pacman Hook | |
# 2021 Filipe Rodrigues<[email protected]> | |
# | |
# Take a snapshot of the root dataset before any pacman operation. | |
# See: https://man.archlinux.org/man/alpm-hooks.5 | |
# Depends on: pacman, zfs, coreutils | |
# Location: /etc/pacman.d/hooks/zfs_snapshot.hook | |
[Trigger] | |
Operation = Install |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Via: https://sts10.github.io/2018/11/27/syncthing-and-tmux.html | |
# Changes to `ss` and `se`: | |
# - Start session with command on `new-session`: avoids creating a shell | |
# session just for `syncthing`; also use only `kill-session` instead of | |
# sending keys. | |
# - Test if the sessions exist (or don't exist) before creating/killing them. | |
# in ~/.bash_profile or ~/.bashrc | |
function ss { | |
if tmux has-session -t synct 2>/dev/null; then |
HIBP Pwned Passwords Awk splitter
This Awk script splits pwned-passwords-1.0.txt.7z
(and
updates) into 256 files xz compressed files, by hash prefix (2 digits).
The script assumes the format of the input file is one hash per line.
It can be ran for more than one pwned-passwords-*.txt.7z
file, such as
pwned-passwords-update-1.txt.7z
as long as Troy keeps the format consistent.
Requires 7z
(p7zip), and GNU Awk (tested with
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 | |
# Interactively capture a screenshot (using the cursor), and decode any 1D or 2D | |
# barcodes in the image (such as QR Code, EAN-13, etc...) | |
# | |
# OS X / macOS only | |
# Requires: | |
# - zbar (http://zbar.sourceforge.net/, `brew install zbar`) | |
# - screencapture (included with the system) | |
function screenqr() { |
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
<?php | |
/** | |
* `password_hash`/bcrypt cost benchmark script | |
* | |
* Usage: | |
* $ php bcrypt_cost_benchmark.php <lower cost> <higher cost> <n_tries> | |
* | |
* Example: Run 100 tries of costs 8 through 12 | |
* $ php bcrypt_cost_benchmark.php 8 12 100 |
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 | |
# Connecto to VNC using TigerVNC Viewer through an SSH tunnel. OS X only. | |
# Requires osx_app_path: https://github.com/shello/osx_app_path | |
# Tested with bash 3.2 and zsh 5.1.1 | |
vncssh () { | |
local SSH_HOST VNC_PORT LOCAL_PORT TIGERVNC | |
local TIGERVNC_BIN="Contents/MacOS/TigerVNC Viewer" |
NewerOlder