Skip to content

Instantly share code, notes, and snippets.

View ConnerWill's full-sized avatar
👽
These pretzels are making me thirsty

ConnerWill

👽
These pretzels are making me thirsty
View GitHub Profile
@ConnerWill
ConnerWill / parse-config-file-for-uncommented-lines.sh
Last active May 18, 2022 02:36
Bash script to parse and log only the configured *(uncommented)* lines/settings in a configuration file. *Used ‘kitty.conf’ as an example*.
# -----------------------------------------------------
# List of configured 'kitty.conf' options
#
# This File Only Shows The Set Options In 'kitty.conf'
# Which Makes It Easier To Know Which Options Are Configured
#
# This file is not a live/up-to-date list of set options,
# if an option was set and this file wasnt updated,
# the option will not show in this file until it is updated
#
@ConnerWill
ConnerWill / figlet-tr.sh
Last active May 18, 2022 03:03
Pointless bash function to show an interesting figlet font with basic help menu. More of a test/example/template than anything :-) Requires figlet
### figlet-tr help
funcname="figlet-tr"
figlettrhelp="
TITLE:
$funcname [-h|--help] [string]
@ConnerWill
ConnerWill / hardened-sshd_config
Last active December 8, 2023 16:43
hardened-sshd_config
##: ==============================================
##: [ SSHD_CONFIG ]
##: ==============================================
##: Title: hardened-sshd_config
##: Path: /etc/ssh/sshd_config
##: Author: github.com/ConnerWill
##: Date: 2022-07-16
##:
##: https://man.openbsd.org/sshd_config.5
##: https://linux.die.net/man/5/sshd_config
@ConnerWill
ConnerWill / Enable-ChocolateyCompletion.ps1
Created May 18, 2022 02:32
Enable Chocolatey (choco) tab completion for PowerShell. Code block is to be added to your PowerShell profile (“$profile”). Source: https://docs.chocolatey.org/en-us/troubleshooting
# Import the Chocolatey Profile that contains the necessary code to enable
# tab-completions to function for `choco`.
# Be aware that if you are missing these lines from your profile, tab completion
# for `choco` will not function.
# See https://ch0.co/tab-completion for details.
# Source https://docs.chocolatey.org/en-us/troubleshooting
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
Import-Module "$ChocolateyProfile"
}
@ConnerWill
ConnerWill / bash-stdout-stderr-redirection.sh
Last active June 27, 2022 16:04
Hide stdout and stderr with this code after your command
#############################################################################
#############################################################################
## ##
## Hide stdout and stderr with this code after your command ##
## ##
## > /dev/null 2>&1 ##
## ##
## EXAMPLE: ##
## ##
## This command will now show any output: ##
@ConnerWill
ConnerWill / ANSI-escape-sequences.md
Last active May 2, 2024 16:30
ANSI Escape Sequences cheatsheet

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@ConnerWill
ConnerWill / PowerShell-templates-snippets.md
Last active July 18, 2022 05:27
powershell resources

PowerShell-templates-snipets.md

Create a new PSCustomObject

@ConnerWill
ConnerWill / entities.json
Last active July 21, 2022 02:14
Unicode symbols are Unicode characters which are not part of a script used to write a natural language, but is nonetheless available for use as part of a text.
{
"&AElig": { "codepoints": [198], "characters": "\u00C6" },
"Æ": { "codepoints": [198], "characters": "\u00C6" },
"&AMP": { "codepoints": [38], "characters": "\u0026" },
"&": { "codepoints": [38], "characters": "\u0026" },
"&Aacute": { "codepoints": [193], "characters": "\u00C1" },
"Á": { "codepoints": [193], "characters": "\u00C1" },
"Ă": { "codepoints": [258], "characters": "\u0102" },
"&Acirc": { "codepoints": [194], "characters": "\u00C2" },
"Â": { "codepoints": [194], "characters": "\u00C2" },
@ConnerWill
ConnerWill / pkg
Last active July 18, 2022 18:08
'pkg' package manager wrapper for both Debian and Arch distros. (now in color! and with fzf!!!)
#!/data/data/com.termux/files/usr/bin/bash
set -eu
# Setup TERMUX_APP_PACKAGE_MANAGER
source "/data/data/com.termux/files/usr/bin/termux-setup-package-manager" || exit 1
show_help() {
local cache_size
local cache_dir=""
if [ "$TERMUX_APP_PACKAGE_MANAGER" = "apt" ]; then
@ConnerWill
ConnerWill / yay-search-pkg-array.sh
Last active July 18, 2022 23:34
Search for packages and return formatted names and descriptions: to be used to feed into fzf :):(
#!/bin/bash
##############################################################################:
##############################################################################:
##:
##:
####: DEFINE_CHAR_VARIABLES
##: {{{ DEFINE_CHAR_VARIABLES
_thin_line_sep="---------------------------------------------------"