Skip to content

Instantly share code, notes, and snippets.

@stephenchew
stephenchew / README.md
Last active January 6, 2024 14:44
Bulk edit photos in Photoprism

Bulk edit photos in Photoprism

Tested to work with builds: -

  • 231011-63f708417
  • 230923-e59851350
  • 230719-73fa7bbe8

Use this workaround until Photoprism implemented bulk-edit feature.

@calexandre
calexandre / merge-zsh-history.sh
Last active July 21, 2026 08:59
Merge two zsh history files
#!/bin/bash
# Inspired on https://david-kerwick.github.io/2017-01-04-combining-zsh-history-files/
set -e
history1=$1
history2=$2
merged=$3
echo "Merging history files: $history1 + $history2"
test ! -f $history1 && echo "File $history1 not found" && exit 1
@artizirk
artizirk / debug.md
Last active November 29, 2024 00:21
Debug WireGuard Linux kernel module
@jeffjohnson9046
jeffjohnson9046 / kill-all-connections-to-db.sql
Created June 18, 2018 18:10
How to kill all connections to a Postgres database
-- Accepted answer from here: https://stackoverflow.com/questions/5408156/how-to-drop-a-postgresql-database-if-there-are-active-connections-to-it
SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity
WHERE pg_stat_activity.datname = '[your database name goes here]'
AND pid <> pg_backend_pid();
#!/bin/bash
# Expects Ubuntu 16.06 (xenial) and kernel 4.x.
# Based upon a blog post by Zach at http://zachzimm.com/blog/?p=191
set -eux
# Have the user call sudo early so the credentials is valid later on
sudo whoami
@jframos
jframos / mic_mute_script.workflow
Created December 22, 2017 09:25
AppleScript - Microphone mute
if input volume of (get volume settings) = 0 then
set level to 90
display notification "On" with title "Mic"
tell application "System Events"
tell appearance preferences
set dark mode to false
end tell
end tell
else
set level to 0
#!/bin/bash
# Expects Ubuntu 16.06 (xenial) and kernel 4.x.
# Based upon a blog post by Zach at http://zachzimm.com/blog/?p=191
set -eux
# Have the user call sudo early so the credentials is valid later on
sudo whoami
@danieleggert
danieleggert / GPG and git on macOS.md
Last active March 20, 2026 13:01
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@sdieunidou
sdieunidou / Sweet-Dog.md
Last active July 11, 2026 16:10
Sweet Dog

Sweet Dog

Un guide bienveillant pour les propriétaires de chien : des parcours d'apprentissage, des guides pratiques, des fiches de races et un assistant qui répond à vos questions en s'appuyant uniquement sur ces guides.

Sweet Dog est un « concierge du canon » : son assistant ne répond qu'à partir des guides publiés ci-dessous et ne contredit jamais un guide. Édition française (langue de référence) ; l'édition anglaise suit, après le séparateur.

Démarrer

@eculver
eculver / protocol-fix.txt
Created March 16, 2015 18:54
How to deal with tmux "protocol version mismatch"
$ tmux attach
protocol version mismatch (client 7, server 6)
$ pgrep tmux
3429
$ /proc/3429/exe attach