Skip to content

Instantly share code, notes, and snippets.

View jaeyson's full-sized avatar
🎯
Focusing

Jaeyson Anthony Y. ⚗️ jaeyson

🎯
Focusing
View GitHub Profile
@jaeyson
jaeyson / README.md
Created February 7, 2025 10:37 — forked from thmsmlr/README.md
cmd+k for any terminal

These three scripts can provide you a cursor style CMD+K Like experience in any terminal.

How it works

  1. Set logged-shell to be your default shell for your terminal emulator. shell = /path/to/logged-shell in ~/.config/kitty/kitty.conf for kitty users.
  2. This will stream both the inputs and outputs of your terminal session into a file defined at $SHELL_LOG_FILE
  3. The ai-bash-command will take a user prompt, add the shell as context, and call OpenAI (with the ai command) to get the bash command that satisfies the prompt.
  4. It will type the results back into your terminal using wtype for wayland users.
@jaeyson
jaeyson / 1-setup.md
Created February 3, 2025 02:06 — forked from troyfontaine/1-setup.md
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@jaeyson
jaeyson / firewall.sh
Created October 30, 2024 13:18 — forked from andrasbacsai/firewall.sh
Update a Hetzner Firewall rule with your IP address
#!/bin/bash
# Script to update a firewall rule in a Hetzner Firewall with your current IP address.
# Good if you would like to restrict SSH access only for your current IP address (secure).
#################
# WARNING: This script will overwrite all rules in the firewall rules, so make sure you
# added all the required rules.
# I use a separate firewall rule just for SSH access.
#################
@jaeyson
jaeyson / observer.md
Created August 9, 2024 08:35 — forked from pnc/observer.md
Using Erlang observer/appmon remotely

Using OTP's observer (appmon replacement) remotely

$ ssh remote-host "epmd -names"
epmd: up and running on port 4369 with data:
name some_node at port 58769

Note the running on port for epmd itself and the port of the node you're interested in debugging. Reconnect to the remote host with these ports forwarded:

$ ssh -L 4369:localhost:4369 -L 58769:localhost:58769 remote-host
defmodule SchemaChecker do
def find_field_discrepancies do
schema_modules()
|> Enum.map(fn mod ->
{mod.__schema__(:source), check_module(mod)}
end)
end
defp schema_modules do
{:ok, modules} = :application.get_key(:core, :modules)