Skip to content

Instantly share code, notes, and snippets.

@nycksw
nycksw / agent
Last active June 6, 2025 16:44
agent handler 🕵️
# Like keychain(1) but in 66 lines of bash.
SSH_AGENT_FILE="$HOME/.ssh/agent.$(hostname)"
# Validate agent: must have valid socket and identities.
agent_valid() {
[[ -S "${SSH_AUTH_SOCK}" ]] && ssh-add -l &>/dev/null
}
# Source saved agent file if no valid forwarded agent.
@nycksw
nycksw / nmap2md.xslt
Created March 16, 2025 18:07
nmap xml -> md
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- Output method for plain text (Markdown) -->
<xsl:output method="text" />
<!-- Main Template -->
<xsl:template match="/nmaprun">
<!-- Loop through each host -->
<xsl:for-each select="host">
<xsl:text>#### TCP&#10;&#10;- Target: `</xsl:text>
@nycksw
nycksw / tmux.conf
Last active November 27, 2025 14:35
tmux.conf
unbind -a # No defaults; all keybindings are explicit.
bind : command-prompt
bind ? list-keys
bind C customize-mode -Z
bind \$ command-prompt -I "#S" { rename-session "%%" }
bind \~ show-messages
bind a send-prefix # For sending a literal ^a.
bind i display-message
bind r source-file ~/.tmux.conf \;\; display-message "Configuration reloaded."
@nycksw
nycksw / contabo.nix
Created March 14, 2025 10:42
contabo.nix
# contabo.nix: Parameters needed for Contabo's VPS environment.
{ config, pkgs, ... }:
{
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
boot.loader.grub.device = "/dev/sda";
boot.loader.grub.forceInstall = true;
}
@nycksw
nycksw / i3-config
Last active March 12, 2025 19:56
.config/i3/config
set $mod Mod4
set $alt Mod1
font pango:Ubuntu Regular 10
exec --no-startup-id nm-applet
# Use pactl to adjust volume in PulseAudio.
set $refresh_i3status killall -SIGUSR1 i3status
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status