Skip to content

Instantly share code, notes, and snippets.

@azazar
azazar / configure-pam-ssh-agent-auth.sh
Created April 18, 2026 16:25
Configure PAM SSH agent auth on remote server
#!/usr/bin/env bash
set -euo pipefail
if [[ "${1:-}" == "--remote" ]]; then
export DEBIAN_FRONTEND=noninteractive
: "${PUBKEY_B64:?PUBKEY_B64 is required}"
: "${REMOTE_LOGIN_USER:?REMOTE_LOGIN_USER is required}"
USER_HOME="$(getent passwd "$REMOTE_LOGIN_USER" | cut -d: -f6)"
@azazar
azazar / create-test-vm.sh
Created April 18, 2026 16:22
Quickly create a temporary LXC Debian VM for small experiments
#!/bin/bash
set -euo pipefail
NAME="${1:-test-vm}"
PASSWORD="${2:-password}"
export LXD_DIR="${LXD_DIR:-/var/lib/lxd}"
command -v lxc >/dev/null || { echo "Missing command: lxc" >&2; exit 1; }
[ -S "$LXD_DIR/unix.socket" ] || { echo "Missing LXD socket: $LXD_DIR/unix.socket" >&2; exit 1; }
@azazar
azazar / Dockerfile.yggdrasil
Created April 16, 2026 12:29
Yggdrasil Network node docker image
# Build and run command: docker build . -t yggdrasil && docker run --rm -it --device=/dev/net/tun --privileged yggdrasil -autoconf
FROM debian:trixie-slim AS builder
ENV VERSION=0.5.13
ENV SOURCE_URL=https://github.com/yggdrasil-network/yggdrasil-go/archive/refs/tags/v${VERSION}.tar.gz
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends wget ca-certificates git golang \
&& go install gopkg.in/niemeyer/godeb.v1/cmd/godeb@latest \
@azazar
azazar / .bashrc_ps1
Last active February 18, 2025 12:17
My bash prompt
# Set terminal title (optional)
PS1="\[\e]0;\u@\h: \w\a\]"
# Segment 1: Dark Gray background (100) with Light Yellow text (93)
PS1+=$'\[\e[100;93m\] \u@\h '
# Arrow from Segment 1 to Segment 2:
# Arrow's foreground is set to dark gray (90)
# Arrow's background is set to Light Blue (104)
PS1+=$'\[\e[90;104m\]\uE0B0'
@azazar
azazar / vnc_single_window
Created January 8, 2025 11:22
A script that provides remote access to a single window using VNC over LAN.
#!/usr/bin/env python3
"""
vnc_single_window_wx_xlib_dbus.py
A Python script that:
- Uses python3-xlib (Xlib) to list available windows (plus a "root" option).
- Displays a wxPython GUI (ListBox) of windows.
- On selection, we run x11vnc on that window (passwordless + accept popup).
- Publishes the chosen window name via Avahi (Zeroconf) using python3-dbus instead of avahi-publish-service.
@azazar
azazar / bitcoin_dump_privkeys.py
Last active May 19, 2025 07:11
Scans directories for Bitcoin wallet.dat files with private keys and dumps all identified keys
import re
import hashlib
import base58 # pip install base58
import os
import sys
def hash256(data):
"""Perform SHA-256 hash twice."""
return hashlib.sha256(hashlib.sha256(data).digest()).digest()
@azazar
azazar / manage_sshd.py
Created February 1, 2024 19:54
Start/stop SSHD in Termux when power and wifi are connected
#!/data/data/com.termux/files/usr/bin/python3
import json
import os
import subprocess
import time
import logging
import signal
# Configuration
@azazar
azazar / .bashrc
Last active January 20, 2024 07:57
Aliases that changes the current directory to the home directory of a specified user and then starts a new shell session as that user.
# For users with read-only or otherwise unusable HOME directory
alias www='sudo -u www-data /bin/bash -c "mkdir -p /tmp/$(id -n -u)-home && cd /tmp/$(id -n -u)-home && (test -e realhome || ln -s $(getent passwd www-data|cut -d':' -f6) realhome) && HOME=/tmp/$(id -n -u)-home exec /bin/bash -l"'
# For users with writable HOME
alias uuu='cd $(getent passwd www-data|cut -d':' -f6) && sudo -u www-data -s /bin/bash'
// ==UserScript==
// @name author.today качать с названием
// @namespace Azazar's Scripts
// @match https://author.today/work/*
// @grant GM_setClipboard
// @version 1.0
// @author -
// ==/UserScript==
let extMap = {
// ==UserScript==
// @name flibusta.is качать с названием
// @namespace Violentmonkey Scripts
// @match *://flibusta.is/a/*
// @match *://flibusta.is/s/*
// @match *://flibusta.is/sequence/*
// @grant GM_setClipboard
// @grant GM_download
// @version 1.4
// @author -