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
# link to plugins : | |
https://micro-editor.github.io/plugins.html | |
# open file in readonly mode | |
micro -readonly on <file_to_open_read_only.txt> | |
# bindings file : | |
~/.config/micro/bindings.json |
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 | |
# about : this is a wrapper script which will run links2 (CLI terminal) with rdrview | |
# a program which will work like reader view on a modern web browser | |
# more information on links2 : http://links.twibright.com/about.php | |
# more information on rdview : https://github.com/eafer/rdrview | |
# configure proxy servers | |
# export http_proxy="http://host:port" |
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
# pane splitting cli | |
https://wezfurlong.org/wezterm/cli/cli/split-pane.html | |
# default pane movement basic (arrow keys) | |
shift-control-leftarrow | |
shift-control-rightarrow | |
shift-control-uparrow | |
shift-control-downarrow | |
# get some help with the command line |
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 | |
# | |
# About : This script allows you to pass in the URL to a youtube users page as argument one and | |
# this script will output the RSS feed for the channel / user (simiilar to notifications) | |
# | |
# Copyright Henri Shustak 2024 | |
# Licence : GNUGLP 3 later | |
# https://www.gnu.org/licenses/gpl.html | |
# | |
# |
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 random_value to be integer less than 100 # fails in BASH! | |
random_value=`random 1 100` |
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" |
NewerOlder