Skip to content

Instantly share code, notes, and snippets.

@shawngmc
shawngmc / add-path
Last active November 16, 2024 17:26
Bash helper: Add Path
#!/bin/bash
# Based on: https://dev.to/christianpaez/simplifying-path-management-with-bash-4870
# Install via:
# sudo curl -o /usr/bin/add-path -L https://gist.githubusercontent.com/shawngmc/954ef4ccee03a26f1774c5b922e27777/raw/add-path
# sudo chmod 755 /usr/bin/add-path
unset dir_to_add
unset force_add
unset do_add
@shawngmc
shawngmc / readme.MD
Last active January 9, 2024 00:52
I hate SELinux!

Foreword

OK, so I love the idea of SELinux. I like the idea of process permissions and quasi-sandboxing. What I hate about SELinux is:

  • The lack of good, straightforward documentation
  • The awful UI/UX
  • The inconsistency and community split between AppArmor and SELinux

Let's see if I can help myself (and maybe you!) understand it a bit better.

Mode of Operation (How It Works)

Security context/label

@shawngmc
shawngmc / hubspace-clean.log
Last active January 3, 2023 17:15
Hubspace Log
homeassistant | s6-rc: info: service s6rc-oneshot-runner: starting
homeassistant | s6-rc: info: service s6rc-oneshot-runner successfully started
homeassistant | s6-rc: info: service fix-attrs: starting
homeassistant | s6-rc: info: service fix-attrs successfully started
homeassistant | s6-rc: info: service legacy-cont-init: starting
homeassistant | s6-rc: info: service legacy-cont-init successfully started
homeassistant | s6-rc: info: service legacy-services: starting
homeassistant | services-up: info: copying legacy longrun home-assistant (no readiness notification)
homeassistant | s6-rc: info: service legacy-services successfully started
homeassistant | 2023-01-03 17:03:52.653 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration pyscript which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
@shawngmc
shawngmc / apt-chromebook-dev.sh
Created November 14, 2022 21:26
Chromebook packages
# Updates
sudo apt-get update
# Prereqs
# Gnome-keyring - vscode uses, local secrets management
sudo apt-get install -y \
gnome-keyring
# Node/NPM/NVM
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
@shawngmc
shawngmc / .aws-creds
Last active August 16, 2024 19:12
Caddy Example Files
[default]
aws_access_key_id=XXXXXXXXXXXXXXXXXXXX
aws_secret_access_key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
aws_region=us-east-1
@shawngmc
shawngmc / utils.sh
Last active April 9, 2024 13:26
Bash utils script
#!/bin/bash
logMessage() {
local MESSAGE=$1;
local TIMESTAMP="";
TIMESTAMP=$(date +%Y-%m-%dT%H:%M:%S.%3NZ);
local CALLER="";
CALLER=$(readlink -f "$0");
echo "$TIMESTAMP: [$CALLER] $MESSAGE";
}
@shawngmc
shawngmc / README.md
Last active October 5, 2021 09:15
Getting Ubuntu/Ubuntu 18.04 in the New Windows Terminal
  1. Manually trigger Windows Update to Windows 10 19.03+
  2. Launch an administrative powershell and enable WSL via Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  3. After the reboot, install Ubuntu, Ubuntu 18.04 and Windows Terminal (Preview) from the Windows Store.
  4. Start each Ubuntu distro once to set up users.
  5. Open Windows Terminal.
  6. In the dropdown, choose Settings. Choose a JSON editor if asked.
  7. Pull a new icon - likely ubuntu_32px.png - from https://github.com/yanglr/WindowsDevTools/tree/master/awosomeTerminal/icons
  8. Save the icon to C:\Users\shawn\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\RoamingState
  9. Copy an existing profile block and make the following changes:
@shawngmc
shawngmc / install.sh
Last active June 10, 2019 18:01
Gluster Config
#!/bin/bash
# Debug stuff
set -o errexit;
set -o pipefall;
set -o nounset;
set -o xtrace;
# Add repo, package and service
sudo add-apt-repository ppa:gluster/glusterfs-4.1
@shawngmc
shawngmc / ceph.conf
Created June 7, 2019 15:58
ceph 5-minute quickstart stuff
[global]
# For version 0.55 and beyond, you must explicitly enable
# or disable authentication with "auth" entries in [global].
auth cluster required = cephx
auth service required = cephx
auth client required = cephx
[osd]
@shawngmc
shawngmc / cloud-config.yml
Last active June 5, 2019 13:02
Cloud Config for Rancher
#cloud-config
hostname: boxboat
rancher:
network:
interfaces:
eth*:
dhcp: true
dns: