Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
#
# Released Under GNU GPLv3
# Copyright 2025 Henri Shustak
#
# About :
# This script will print messages as they arrive from a meshtastic node connected via serial port USB.
# If you have multiple nodes attached, you will need to edit this script and specify the node to monitor.
#
# Requirements :
@henri
henri / curl_cheatsheet.txt
Last active May 12, 2025 00:08
curl cheatsheet
# check the total real page load time for a specific page load :
TIMEFORMAT='%E' ; time curl https://myserver.com 2> /dev/null >/dev/null
# get my current ip address :
curl wtfismyip.com/text
@henri
henri / ssh-multi.sh
Last active January 27, 2025 01:19 — forked from dmytro/ssh-multi.sh
Start multiple synchronized SSH connections with Tmux
#!/bin/bash
# ssh-multi
# Modified to check if the script is started within a TMUX session to avoid starting in a background TMUX session
# H.SHUSTAK
# Origional :
# D.Kovalov : https://gist.github.com/dmytro/3984680
# Based on http://linuxpixies.blogspot.jp/2011/06/tmux-copy-mode-and-how-to-control.html
@henri
henri / 010.linux_swap_cheatsheet_add_swap_file.txt
Last active November 3, 2025 04:23
linux swap cheatsheet
# NOTES
#
# - this approach has been tested on mint (will work on many other distributions as well - YMMV)
# - this approach uses swap files not partitions
#
# create a 5GB swap disk to use - run as root!
swapon --show
mkdir /swapfiles ; chmod 700 /swapfiles
@henri
henri / ping-stdin.bash
Last active October 23, 2024 20:21
ping from stdin
#!/usr/bin/env bash
#
# This super basic script boiler plate
# will ping each host passed into the
# via stdin. Pipe your hosts into this
# script to check if they are up.
#
# Modify as needed for your purposes
#
# (C)2024 Henri Shustak - Released Under the GNU GPL 3.0 or later.
@henri
henri / cinnamon-replace
Last active October 8, 2024 20:22
repalce cinnamon (when it springs a memory leak)
#!/usr/bin/env bash
#
# This script may be used when cinnamon springs
# a memory leak. Running this script will start
# a screen session and run 'cinnamon --replace'
# within this new session.
#
# Presently, this is a script to be run manually.
# perhaps in the future a deamon to keep an eye
# on memory usage would be a good idea.
@henri
henri / 003.migrated-to-github-repository.md
Last active August 19, 2025 22:17
start as many instances of a browser as you like (posix compliant)
@henri
henri / 001_rsync_cheatsheet.txt
Last active September 12, 2024 04:14
rsync cheatsheet
# Sometimes when moving files around, you do not have the ability to directly
# preserve permissions, the approach below uses two commands : getfacl and setfacl
# to save and restore permissions once your rsync is compled.
# Alterativly, you can also explore using the fake-super options in rsync.
# The commands below are if you have a small number of files, there are also some
# scripts below to split up larger files in to chunks for batch processing.
# save permissions for a direcotry tree to a file using ACL tools
getfacl --recursive ./ > permissions.data
@henri
henri / usbguard_cheatsheet.txt
Last active September 11, 2024 04:38
usb guard
# monitor (realtime) usbguard
usbguard watch
# perminatly allow USB device
usbguard allow-device --permanent <device-id-number>
@henri
henri / 001.micro_cheat_sheet.txt
Last active July 18, 2024 22:03
micro text editor cheatsheet
# link to plugins :
https://micro-editor.github.io/plugins.html
# open file in readonly mode
micro -readonly on <file_to_open_read_only.txt>
# bindings file :
~/.config/micro/bindings.json