This file contains hidden or 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
# visual diff using smerge | |
smerge mergetool file1 file2 | |
# fish open files with wildcard name substiution | |
smerge mergetool (ls *-myfiles.txt | string split " ") | |
# bash open files with wildcard name substiution | |
smerge mergetool $(ls *-myfiles.txt) | |
This file contains hidden or 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
# this example sets up a tunnel on the remote system on port 8090 to the system initiating the ssh connection on port 8080 | |
# | |
# starting socat ipv4 tunnel between ports on remote system (forking and lock file enabled with socat) | |
# and killing socat with control-c / tunnel close | |
# | |
# tags : proxy port | |
# most direct approach | |
ssh -t [email protected] -R 8080:127.0.0.1:8080 "socat -L/tmp/socat.lock tcp4-listen:8090,reuseaddr,fork tcp:localhost:8080" |
This file contains hidden or 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
# reload the systemd deamon config files (useful for testing once you have made a change) | |
systemctl daemon-reload | |
# list all unit configuration files found in the search paths. | |
systemctl list-unit-files | |
# list units with descriptions which are currently loaded into memory | |
systemctl list-units | |
# lists units with additional information |
This file contains hidden or 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
# login as a user if they do not have a shell : | |
su - <user> -s /bin/bash | |
# example logging in as www-data : | |
su - www-data -s /bin/bash | |
# add user to sudo group | |
usermod -aG sudo <user-to-grant-sudo-access> |
This file contains hidden or 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
# Requires 'sxhkd' and 'xdotool' to both be installed. | |
# Start 'sxhkd' for this to actually become active | |
# Config should be installed into this file : | |
# ./config/sxhkd/sxhkdrc | |
# | |
# Released under the GNU/GPL v3 or later : | |
# https://en.wikipedia.org/wiki/GNU_General_Public_License | |
# | |
# Unintended operation and unexpected issues are not my responsobility | |
# use this script and settings and these tools at your own risk |
This file contains hidden or 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
If you are connecting via VNC / ARD client to a macOS system with mutliple GUI sessions. | |
If the screen saver is enabled on the account and it locks the screen, any subsequent connections will be in | |
a stuck state, you will not be able to type or even access the screen saver password dialog box. It is like the system | |
will not recognise any movement. | |
Provided you have SSH accesss to an admin account on the system and you have no unsaved changes, | |
you will be able to force logout the GUI enviroment using the command below : | |
$ sudo launchctl bootout gui/$(id -u <usercode>) |
This file contains hidden or 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
git config --global color.ui true | |
git config --global user.name "YOUR NAME" | |
git config --global user.email "[email protected]" | |
git config --global credential.helper cache |
This file contains hidden or 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/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 |
This file contains hidden or 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 hidden or 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 |