Skip to content

Instantly share code, notes, and snippets.

View io41's full-sized avatar

Tim Kersten io41

View GitHub Profile
@io41
io41 / README.md
Last active June 19, 2026 15:02 — forked from wmudge/README.md
Create GPG Key, Managed by 1Password + 1Password pinentry for gpg-agent

Create GPG Key, Managed by 1Password

gpg-setup.sh makes 1Password the home and the live unlock agent for your GPG key. Run it once and the manual fiddling goes away:

  • It generates a new GPG key whose passphrase is a 64-character secret that 1Password creates β€” you never see it or type it.
  • It stores the public key, private key, and revocation certificate as documents in your 1Password vault, so a fresh machine is one download and gpg --import away.
  • It rewires gpg-agent so that every operation that needs your private key β€” signing and decryption β€” pulls the passphrase straight from 1Password through a small pinentry wrapper. Nothing to memorize, no passphrase on disk.
  • It sets 1Password's own expiry date to match the key's, so the item itself shows when the key is due for rotation.

After it runs, GPG just works: while 1Password is unlocked, signing and decryption succeed silently; when it's locked, you approve the 1Password CLI prompt once. There's nothing else to remember.

// ==UserScript==
// @name Auto Close Slack Tab on Redirect
// @namespace https://*.slack.com/archives/*
// @version 0.3
// @description Auto close Slack's "We’ve redirected you to the desktop app." tabs.
// @author Tim Kersten
// @match https://klarna.slack.com/archives/*
// @grant none
// @homepageURL https://gist.github.com/io41/304b1af0f83f82dd4408612b31bb25b5
// @updateURL https://gist.github.com/io41/304b1af0f83f82dd4408612b31bb25b5/raw/auto-close-slack-tab-on-redirect.user.js
@io41
io41 / no-toolbars-for-slack-lists.user.js
Last active August 5, 2024 11:51
No toolbars for slack lists (Toggleable), aka Fullscreen Lists userscript. Published to: https://greasyfork.org/en/scripts/501755-no-toolbars-for-slack-lists-toggleable
// ==UserScript==
// @name No toolbars for slack lists (Toggleable), aka Fullscreen Lists
// @namespace http://tampermonkey.net/
// @version 0.6
// @description Hides toolbars for any given Slack List, toggleable with Command + . Useful when combined with Chrome's ability to turn any webpage into an App.
// @author Tim Kersten
// @match https://app.slack.com/client/*/lists
// @grant GM_addStyle
// @homepageURL https://gist.github.com/io41/7ff3dfa815dd7566237234f7b699a529
// @downloadURL https://update.greasyfork.org/scripts/501755/No%20toolbars%20for%20slack%20lists%20%28Toggleable%29%2C%20aka%20Fullscreen%20Lists.user.js
@io41
io41 / .rgr.zsh
Last active July 4, 2023 12:47
ripgrep (rg) replace all files inplace, just like sed -i
# install ripgrep & moreutils (for the sponge tool) See https://www.putorius.net/moreutils.html
# On mac: brew install moreutils ripgrep
# Source this file in your zsh config by adding `source .rgr.zsh` to your .zshrc
function rgr() {
local context_lines=2
local search="$1"
local replace="$2"
shift 2