Skip to content

Instantly share code, notes, and snippets.

Living life one byte at a time

Greg Bray gbrayut

Living life one byte at a time
Block or report user

Report or block gbrayut

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
gbrayut /
Last active Aug 16, 2019
Docker in LXD
exit #Not that kind of script, these sections should be run manually
# First get lxd working
# Install lxc/lxd. On ubuntu 18.04 I'm using snap to install lxd
sudo apt install snapd
sudo snap install lxd #
# Using ZFS for container storage makes it easy to move things around
sudo apt-get install zfsutils-linux
gbrayut /
Last active Apr 14, 2019
Quick Backup Scripts
cd /data/Backups/gbmint02/
sudo tar -zcvf "etc_$(date +"%F").tar.gz" /etc
sudo tar -zcvf "run_$(date +"%F").tar.gz" /run
sudo tar -zcvf "root_$(date +"%F").tar.gz" /root
sudo tar -zcvf "var_$(date +"%F").tar.gz" /var
sudo tar --exclude="$HOME/.cache" --exclude="$HOME/.config.old" --exclude="$HOME/Dropbox" --exclude="$HOME/code/go/pkg" -zcvf "${SUDO_USER}_$(date +"%F").tar.gz" $HOME
$ snap list
gbrayut / Corefile
Last active Aug 20, 2018
Coredns using Docker
View Corefile {
file config/
prometheus # enable metrics
errors # show errors
log # enable query logs
gbrayut /
Last active Dec 11, 2019
Firewall Testing
#Test all A entries for a DNS record to see if you can connect to port 443:
dig +short | xargs -I {} nc -v -w2 {} 443
#Example of output
Connection to 443 port [tcp/https] succeeded!
Connection to 443 port [tcp/https] succeeded!
Connection to 443 port [tcp/https] succeeded!
Connection to port 443 (tcp) timed out: Operation now in progress
Connection to 443 port [tcp/https] succeeded!
gbrayut /
Last active Jan 6, 2017
Python testing WMI
#pip install comtypes wmi
import sys, os, traceback
sys.coinit_flags = 0 # sets pythoncom.COINIT_MULTITHREADED = 0
import comtypes.client #
from comtypes.automation import IDispatch, IEnumVARIANT
import wmi
#Use help(...) and dir(...) on any object/class to see more details
#These are already set on the main thread by sys package, but need to call if we use other threads
gbrayut / hieradata_example.json
Last active Oct 10, 2016
Scollector Puppet Files
View hieradata_example.json
"scollector::collector_tags": [
gbrayut / Output
Created Jan 12, 2016
Testing TagOverride
View Output
2016/01/12 16:12:26 fatal: main.go:266: Type mismatch for 'conf.Conf.Tags': Expected map but found '[]map[string]interface {}'.
gbrayut / Systemd.service
Created Dec 8, 2015
Bosun Service files
View Systemd.service
#Bosun unit file at /etc/systemd/system/bosun.service
Description=Bosun Service
gbrayut / hbase-site.xml
Last active Aug 26, 2015
HBase setup scripts using Cloudera CDH 5.4.4 on RHEL 6.x
View hbase-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
gbrayut / Get-DscConfigurationStatus
Last active Nov 22, 2018
Issues with Missing DSC Schedules Tasks
View Get-DscConfigurationStatus
#Status after configuring LCM and running Update-DscConfiguration
PS C:\windows\system32\Configuration> Get-DscConfigurationStatus
Status StartDate Type Mode RebootRequested NumberOfResources
------ --------- ---- ---- --------------- -----------------
Success 2015/04/17 19:40:47 Initial Pull False 19
#Status after restarting the server
PS C:\windows\system32> Get-DscConfigurationStatus
You can’t perform that action at this time.