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 Jun 4, 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 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

Keybase proof

I hereby claim:

  • I am gbrayut on github.
  • I am gbrayut ( on keybase.
  • I have a public key whose fingerprint is A61D 298E 6CE1 3E92 BA44 8319 7044 E401 5F99 8507

To claim this, I am signing this object:

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
gbrayut / ytc.js
Created Jun 13, 2010
Chrome Youtube Extension
View ytc.js
//Modified version of Youtube Automatic Quality changer that supports:
// Wide-Mode with white background and reset to default when wide-mode is removed
// Full-screen resize with auto-resize on window change
// Quicklist detection and auto-resize using timer
// Disable annotations. Perform manually using:
//Original source:
//Apply changes to "C:\Users\<username>\AppData\Local\Google\Chrome\User Data\Default\Extensions\hgijgnfdfpfnkfliikinfajhdmphahpj\1.31_0\ytc.js"
// Add page action for max video size and channel->standard page link. (see comments page)
// Add support for detecting non-widescreen aspect ratio? (still works resonably well)
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 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 / Systemd.service
Created Dec 8, 2015
Bosun Service files
View Systemd.service
#Bosun unit file at /etc/systemd/system/bosun.service
Description=Bosun Service
You can’t perform that action at this time.