Skip to content

Instantly share code, notes, and snippets.

View henri's full-sized avatar
💭
hacking the mainframe

henri henri

💭
hacking the mainframe
View GitHub Profile
#!/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 February 12, 2025 02:43
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
@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 / linux_swap_cheatsheet.txt
Last active January 23, 2025 23:09
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 / 005.start-private-browser-installer.md
Last active March 5, 2025 04:18
start as many instances of a browser as you like (posix compliant)

SPB (start-private-browser)

This GIST has everything you need to run multiple private web browsers on your system.

Kick off installer script with the one liner four lines bellow in your terminal :

/bin/bash -c "$(curl -fsSL \
https://gist.githubusercontent.com/henri/\
34f5452525ddc3727bb66729114ca8b4/raw/\
@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