Skip to content

Instantly share code, notes, and snippets.

View egg82's full-sized avatar

egg82

View GitHub Profile
@egg82
egg82 / get.sh
Created February 21, 2023 16:30
#!/usr/bin/env bash
SOURCE=${BASH_SOURCE[0]}
while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )
SOURCE=$(readlink "$SOURCE")
[[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )
#!/usr/bin/env bash
export INFO_ENABLED=true
export DEBUG_ENABLED=true
export TMP_DIR="/tmp/commander"
if [[ -d "${TMP_DIR}" ]]; then
rm -rf "${TMP_DIR}"
fi
mkdir -p "${TMP_DIR}"
#!/usr/bin/env bash
export LANG_VAR_NOT_SET="Variable {var} is not set."
export LANG_FROM_TYPE_NOT_RECOGNIZED="from type {type} not recognized."
#!/usr/bin/env bash
# https://stackoverflow.com/questions/51653450/show-call-stack-in-bash
stacktrace () {
local i=1 line file func
while read -r line func file < <(caller ${i}); do
echo >&2 "[${i}] ${file}:${line} ${func}()"
echo >&2 ">>> $(sed -n "${line}"p "${file}")"
((i++))
done
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKCrHoDSGJ1dj9QMj9AysdHAQhmNnNgah5IgTSOT74Ym eddsa-key-20221010
@egg82
egg82 / proxmox_nvidia.md
Last active April 12, 2024 21:15
NVidia Proxmox + LXC

Proxmox

Find the proper driver at the NVidia website.

Note: Make sure to select "Linux 64-bit" as your OS

Hit the "Search" button.

@egg82
egg82 / hardening.md
Last active April 2, 2022 12:46
Basic server hardening techniques

Trust

As is outlined in this LiveOverflow video, trusting information is hard.

Note that I disagree with some of the key talking points in the video, as you will see later on in this guide.

My credentials, as of time of writing:

  • Security+ certified
  • Linux admin for over a decade
  • Professional Linux admin for about 6 years

Debian/Ubuntu + Active Directory/LDAP v2

This is another quick write-up on getting Debian/Ubuntu to play nicely with LDAP groups. This includes logins, sudoers, home directories, default shells, the works.

This is tested and working on Ubuntu 18 and 20.04 and Windows Server 2016. This setup assumes you already have users/groups in AD/LDAP and have a basic understanding of users/groups.

While this guide is written toward Debian-based systems, some tweaks and downloading the appropriate PBIS script will allow this to work on any Linux-based system.

Install components

@egg82
egg82 / apt_cacher_ng.md
Last active January 22, 2024 08:15
AptCacherNg Apt Proxy Setup

More techniques - caching apt packages network-wide

This guide runs through setting up AptCacherNg on a proxy/server to provide apt caching to clients. The client proxy scripts allow for multiple proxies, and account for proxies being offline.

Note that, for obvious reasons, this only works on Debian-based machines (Ubuntu and derivatives as well).

Server (the cache/proxy)

Note: you will need port 3142 open to the clients using this cache/proxy

@egg82
egg82 / telegraf-qnap.conf
Created October 2, 2020 03:56
QNAP Telegraf config
[[inputs.snmp]]
agents = [ "10.0.0.5:161"]
interval = "45s"
timeout = "10s"
retries = 3
max_repetitions = 10
version = 2
community = "616a1b353f21d9495ffe536656f110299a27712a63fd4ae"
name = "snmp.NAS"