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 | |
# 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 |
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
# 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 |
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
# Sometimes GateKeeper / SIP / FullDisk Access gets in the way of enableing various services on recent version of macOS | |
# It is possible to check if this is the case using these commands. The GUI tends to just hang. The apprach below will | |
# provide you with some feedback. Perhaps an update to macOS at some point will display a dialog box telling you why | |
# the service is not abe to start. | |
# check sshd status | |
sudo systemsetup -getremotelogin | |
# enable sshd | |
sudo systemsetup -setremotelogin on |
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
# 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 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 user@remote.system -R 8080:127.0.0.1:8080 "socat -L/tmp/socat.lock tcp4-listen:8090,reuseaddr,fork tcp:localhost:8080" |
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
# 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 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 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 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 "YOUR@EMAIL.com" | |
git config --global credential.helper cache |
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/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 |
NewerOlder