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 / start-private-browser.bash
Last active September 19, 2024 05:03
start as many instances of a browser as you like (posix compliant)
#!/usr/bin/env bash
#
# Start many instances of Brave at the same time, under the same linux graphical login
# The general idea behind this script to start a private instance of brave-browser
# with local user data directory set to a directory within /tmp/
#
# Henri Shustak 2024
#
# Released under the GNU GPLv3 or later licence :
# https://www.gnu.org/licenses/gpl-3.0.en.html
@henri
henri / 001_rsync_cheatsheet.txt
Last active September 12, 2024 04:14
rsync cheatsheet
# Sometimes when moving files around, you do not have the ability to directly
# preserve permissions, the approach below uses two commands : getfacl and setfacl
# to save and restore permissions once your rsync is compled.
# Alterativly, you can also explore using the fake-super options in rsync.
# The commands below are if you have a small number of files, there are also some
# scripts below to split up larger files in to chunks for batch processing.
# save permissions for a direcotry tree to a file using ACL tools
getfacl --recursive ./ > permissions.data
@henri
henri / usbguard_cheatsheet.txt
Last active September 11, 2024 04:38
usb guard
# monitor (realtime) usbguard
usbguard watch
# perminatly allow USB device
usbguard allow-device --permanent <device-id-number>
@henri
henri / 001.micro_cheat_sheet.txt
Last active July 18, 2024 22:03
micro text editor cheatsheet
# 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
@henri
henri / rdrview-links2
Last active July 15, 2024 22:47
wrapper script for rdrview to use links2
#!/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"
@henri
henri / 01_wezterm_cheatsheet.txt
Last active July 2, 2024 03:27
wezterm cheat sheet
# 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
@henri
henri / yt-rss.bash
Last active September 17, 2024 08:39
From a Youtube user / channel URL find the RSS feed
#!/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
#
#
@henri
henri / fish_shippits.fish
Last active July 23, 2024 23:06
fish snippits
# set random_value to be integer less than 100 # fails in BASH!
random_value=`random 1 100`
# read file in and print each line with a while loop
cat /path/to/my.file | while read -l line ; echo $line ; end
while read -l line ; echo $line ; end < /path/to/my.file
@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 August 14, 2024 00:17
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