This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# show open TCP ports which are listening on the host | |
sudo lsof -nP -iTCP -sTCP:LISTEN | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# requires sendEmail to be installed. | |
SYSTEM_NAME="hostname" | |
FROM_EMAIL="from@email.com" | |
TO_EMAIL="dest1@email.com dest2@email.com" | |
SMTP_SERVER_NAME="smtp.com:587" | |
SMTP_USER_NAME="smtp__user_name" | |
SMTP_PASS="smtp_password" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to just buffer each line (rather than the entire input stream) when using awk / gawk to read data from a pipe. | |
awk '{ print $0 ; system("") }' # compatible with POSIX complient systems | |
gawk '{ print $0 ; system("") }' # gawk is smart and will not actually start a sub-shell | |
# fflush - is going to offer something similar (although you can speicify which kind of output you would like to flush). | |