Skip to content

Instantly share code, notes, and snippets.

@gentzeng
gentzeng / gpg-ssh-setup.md
Created May 5, 2021 15:24 — forked from mcattarinussi/gpg-ssh-setup.md
A setup guide to use a personal gpg key for ssh authentication

GPG - SSH setup

Generating the master key

Here we create the master key. We want only Certify capability: we use the master key only to create the subkeys, Sign - Encrypt - Authenticate capabilities will be assigned to the subkeys.

Run the following command to start the master key generation process. Select the set your own capabilities creation process (type 8)

  ▶ gpg --full-generate-key --expert

gpg (GnuPG) 2.2.9; Copyright (C) 2018 Free Software Foundation, Inc.

@gentzeng
gentzeng / ssh_add_identity.sh
Created October 15, 2020 10:56 — forked from sergii-bond/ssh_add_identity.sh
Start SSH agent only once and add identity information without password prompt
SSH_ENV="$HOME/.ssh/environment"
KEY="$HOME/.ssh/id_rsa"
function start_agent {
# Starts the ssh-agent
# and adds its env vars into $SSH_ENV file.
echo "Initializing new SSH agent..."
# spawn ssh-agent
ssh-agent | sed 's/^echo/#echo/' > "$SSH_ENV"
@gentzeng
gentzeng / get-edid.py
Created April 21, 2020 19:34 — forked from mvollrath/get-edid.py
Using xrandr CLI to write EDID from a connected monitor to stdout
#!/usr/bin/env python
import re
import subprocess
def get_edid_for_output(connector: str) -> bytes:
xrandr = subprocess.run(
['xrandr', '--props'],
check=True,