Skip to content

Instantly share code, notes, and snippets.

View XertroV's full-sized avatar

Max Kaye XertroV

View GitHub Profile
@XertroV
XertroV / watch.sh
Last active September 5, 2019 01:24
Watch.sh - a generic watch-for-files-and-restart-a-command utility for linux.
#!/usr/bin/env bash
# if you have issues, try increasing /proc/sys/fs/inotify/max_user_watches
usage(){
echo "$0 -i 'INCLUDE_FILES' [-e 'EXCLUDE_FILES'] -c 'COMMAND'"
cat << EOF
watch.sh - a generic watch-for-files-and-restart-a-command utility for linux.
Author: Max Kaye
License: Public Domain
@XertroV
XertroV / ubuntu-setup-remote-luks-unlock.sh
Created April 29, 2020 23:23
installs the stuff and does some config for a dracut-ssh-crypt like setup -- ssh into initramfs to unlock the luks partition
#!/usr/bin/env bash
# installs the stuff and does some config for a dracut-ssh-crypt like setup -- ssh into initramfs to unlock the luks partition
sudo apt install dropbear{,-initramfs}
DB_CONFIG=/etc/dropbear-initramfs/config
DB_AUTH_KEYS=/etc/dropbear-initramfs/authorized_keys
sudo mkdir -p /etc/dropbear-initramfs
@XertroV
XertroV / github-status.py
Created May 5, 2020 20:45
script to set github status for commit SHA
#!/usr/bin/env python3
# based on: https://gist.githubusercontent.com/minimal/3799247/raw/b960a004e3b44ed34c39a5d35a3f57bc26f75e1e/githubstatus.py
import logging
import json
import argparse
import requests
# Generated by Powerlevel10k configuration wizard on 2020-05-31 at 09:24 AEST.
# Based on romkatv/powerlevel10k/config/p10k-lean.zsh, checksum 13668.
# Wizard options: nerdfont-complete + powerline, small icons, unicode, lean, 24h time,
# 2 lines, solid, no frame, lightest-ornaments, sparse, few icons, concise,
# transient_prompt, instant_prompt=quiet.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with lean prompt style. Type `p10k configure` to generate
# your own config based on it.
#
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
server:
num-threads: 4
#Enable logs
verbosity: 1
#list of Root DNS Server
root-hints: "/var/lib/unbound/root.hints"
@XertroV
XertroV / my-ubuntu-20.04-svr.sh
Last active May 31, 2020 02:01
my-ubuntu-20.04-svr.sh
#!/usr/bin/env bash
# don't copy this line when installing
export _XERT_DONTRUN="true"
# Copy the below 2 lines to install
CONFIG_MY_SVR_URL="https://gist.githubusercontent.com/XertroV/898436fe500f264a1fabeac889196f9e/raw/my-ubuntu-20.04-svr.sh"
if [[ "$_XERT_DONTRUN" == "" ]]; then curl "$CONFIG_MY_SVR_URL?nonce=$(date +%s)" | bash; fi
ZSHRC_MAID_URL="https://gist.githubusercontent.com/XertroV/6b9bbe298edff882b202c189e18b9c26/raw/.zshrc"
@XertroV
XertroV / gist:be017a7500345f3a5c5e42c797036531
Created July 11, 2020 23:06
structure of voting-alpha
~/tmp/voting-alpha master ────────────────  3.7.5/envs/sv-alpha-3.7.5 3.7.5  10.21.0 xertrov@vm-dev-177 08:49:58
❯ cloc .
121 text files.
112 unique files.
47 files ignored.
github.com/AlDanial/cloc v 1.85 T=0.08 s (1031.7 files/s, 186863.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
@XertroV
XertroV / env-wsl-v2-x11-server.sh
Created November 2, 2020 20:44
commands to export DISPLAY on WSL v2 so that X11 applications work. (an option like 'allow public access' is usually required in the x-server settings; use windows firewall to block network traffic)
export WSL_HOST_IP="$(cat /etc/resolv.conf | grep -E '[0-9]{1,3}\.' | cut -d ' ' -f 2)"
export DISPLAY=$WSL_HOST_IP:0
@XertroV
XertroV / onerednail.md
Last active November 18, 2020 17:02
onerednail.com

One Red Nail

A statement on the importance of philosophy and morality in daily life.

v1.2, 2020-11-19, Max Kaye. (revisions)

I no longer endorse this idea

I have changed my mind about this idea. I'm leaving the rest of the document (after this section) as it is for the moment. I might change things later.