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
@henri
henri / bluetooth_auto_connect_toggle.bash
Last active February 19, 2024 01:01
bluetooth disable auto connect
#!/usr/bin/env bash
#
# toggle auto aconnect
# Henri Shustak 2023
# Released under under MIT Licence
# version 1.1 - initial release
# version 1.2 - will work no matter the state of the lock files
toggle_file=/tmp/bluetooth_connect.toogle
@henri
henri / maxload.bash
Last active March 15, 2024 02:51
mximum load factor reporting script
#!/usr/bin/bash
# Simple Script which prints the maximum load factor to stdout.
# Henri Shustak (C) 2023
# Released Under GNU GPL v3 or later
# version 1.0 initial release.
# version 2.0 bug fix which resulted in different load factor being reported.
# version 3.0 added date to output
# version 4.0 added an optional reset paramater
# version 4.1 bug fix regarding reset time
@henri
henri / x11vnc_cheatsheet.txt
Last active May 3, 2023 07:37
x11vnc cheat sheet
# auto detect password and xsession authority IPv4 local host and keep running after disconnect (-forever).
x11vnc -noipv6 -forever -listen 127.0.0.1 -usepw -find
# set a password (default location - ~/.vnc/passwd)
x11vnc -storepasswd
@henri
henri / virsh_cheatsheet.txt
Created May 2, 2023 01:18
virsh cheatsheet (kvm/qemu/vm/virtual)
# set a domain to auto start
virsh autostart <machine/domain>
# show all domains set to autostart
virsh list --all --autostart
# show all domains not set to autostart
virsh list --all --no-autostart
@henri
henri / lsof_cheat_sheet.txt
Last active April 24, 2023 04:59
lsof cheat sheet
# show open TCP ports which are listening on the host
sudo lsof -nP -iTCP -sTCP:LISTEN
# show various commands
tmux list-commands
# list tmux sessions
tmux list-sessions
# create new session with specific name
tmux new -s <my-session-name>
# rename a session
@henri
henri / wiregaurd-cheat-sheet.txt
Last active July 10, 2024 03:24
wiregaurd cheatsheet
# basic status information
wg show
# enable wiregaurd unit (interface wg0) with systemctl
sudo systemctl enable --now wg-quick@wg0
# disable wiregaurd unit (interface wg0) with systemctl
sudo systemctl disable --now wg-quick@wg0
# bring up wireguard (interface wg0)
@henri
henri / fish_config_cheat_sheet.txt
Last active March 25, 2025 23:32
fish_config_cheat_sheet
# Edits you can make to ~/.config/fish/config.fish
# do not compress the PWD readout
set fish_prompt_pwd_dir_length 0
# remove the fish greeting or set it to something else
@henri
henri / gist:e10b60c467432f884ef0632ce865a2a2
Last active January 22, 2023 23:04
disk_space_email_alert.bash
#!/bin/bash
# requires sendEmail to be installed.
SYSTEM_NAME="hostname"
FROM_EMAIL="[email protected]"
TO_EMAIL="[email protected] [email protected]"
SMTP_SERVER_NAME="smtp.com:587"
SMTP_USER_NAME="smtp__user_name"
SMTP_PASS="smtp_password"
@henri
henri / 0010.apt_cheat_sheet.txt
Last active June 5, 2025 03:09
apt cheat sheet
### APT Tips (tested only on Ubuntu)
##
## Problem :
## The following packages have been kept back
##
## Possible Solutions (depending on the situation) :
# non-manual upgrade of kept back packages (safest) :
sudo apt-get --with-new-pkgs upgrade
sudo apt-get --with-new-pkgs upgrade <list of packages kept back>