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 / .tmux.conf
Last active April 29, 2024 06:52
tmux cheatsheet
# bind alt arrorw keys for switching panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# start window number at 1 rather than zero (good if you do not have a numpad on your keyboard)
set -g base-index 1
# allow different clients to have different sized windows (same session)
@henri
henri / apt_cheat_sheet.txt
Last active April 22, 2024 22:34
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>
@henri
henri / fortigate_basic_cheat_sheet.txt
Last active April 18, 2024 05:21
Fortigate Command Line Cheat Sheet
# get basic system informaton (including version)
get system status
# overview of hardware interfaces
get system interface physical
# details of a single network interface,
get hardware nic <nic-name>
# kind of hidden command to see more interface stats such as errors
@henri
henri / fish_config_cheat_sheet.txt
Last active March 28, 2024 04:47
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
set -U fish_greeting ""
@henri
henri / nmap_basic_cheat_sheet.txt
Last active March 26, 2024 02:10
nmap cheat sheet
#################
### using nmap
#################
# locate free IP addresses (powered off systems or non ARP reply will not be spotted) within a network - change network scan as needed
sudo nmap -v -sn -n 192.168.1.0/24 -oG - | awk '/Status: Down/{print $2}'
# reverse of above show the hosts which are up
sudo nmap -v -sn -n 192.168.1.0/24 -oG - | awk '/Status: Up/{print $2}'
@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 / 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
# mosh (connection using specific public key-pair)
mosh --ssh="/usr/bin/ssh -i ~/.ssh/identity" user@myhost.com
@henri
henri / ghostbuster
Created February 14, 2024 22:08 — forked from thunderpoot/ghostbuster
Mosh: You have N detached Mosh sessions on this server
#!/bin/bash
# You know that really annoying message that pops up...
# Mosh: You have 3 detached Mosh sessions on this server, with PIDs:
# - mosh [2294539]
# - mosh [1874313]
# - mosh [2294805]
# I often find myself copying this list of PIDs in order to kill them manually
@henri
henri / macOS_timemachine_cheatsheet.txt
Last active February 14, 2024 03:25
macOS TimeMachine cheatsheet
# the man page for tmutil
man tmutil
# calculate drift on backups (cpu / io intensive)
tmutil calculatedrift backup_folder
# list backups
tmutil listbackups
# set backup destination