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
gbrayut / 01-setup-LXD.sh
Last active Aug 16, 2019
Docker in LXD
View 01-setup-LXD.sh
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 https://docs.snapcraft.io/installing-snapd/6735
sudo apt install snapd
sudo snap install lxd # https://mangolassi.it/topic/18073/installing-lxd-on-ubuntu-18-04-the-right-way
# Using ZFS for container storage makes it easy to move things around
sudo apt-get install zfsutils-linux
@gbrayut
gbrayut / test.sh
Last active Jun 4, 2019
Firewall Testing
View test.sh
#Test all A entries for a DNS record to see if you can connect to port 443:
dig +short microsoft.com. | xargs -I {} nc -v -w2 {} 443
#Example of output
Connection to 191.239.213.197 443 port [tcp/https] succeeded!
Connection to 104.43.195.251 443 port [tcp/https] succeeded!
Connection to 104.40.211.35 443 port [tcp/https] succeeded!
Connection to 23.100.122.175 port 443 (tcp) timed out: Operation now in progress
Connection to 23.96.52.53 443 port [tcp/https] succeeded!
@gbrayut
gbrayut / backup.sh
Last active Apr 14, 2019
Quick Backup Scripts
View backup.sh
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
View keybase.md

Keybase proof

I hereby claim:

  • I am gbrayut on github.
  • I am gbrayut (https://keybase.io/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
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
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: http://www.youtube.com/account#playback/annotations
//Original source: https://chrome.google.com/extensions/detail/hgijgnfdfpfnkfliikinfajhdmphahpj
//Apply changes to "C:\Users\<username>\AppData\Local\Google\Chrome\User Data\Default\Extensions\hgijgnfdfpfnkfliikinfajhdmphahpj\1.31_0\ytc.js"
//TODO:
// 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
gbrayut / Corefile
Last active Aug 20, 2018
Coredns using Docker
View Corefile
home.arpa {
file config/home.arpa
prometheus # enable metrics
errors # show errors
log # enable query logs
}
@gbrayut
gbrayut / testwmi.py
Last active Jan 6, 2017
Python testing WMI
View testwmi.py
#pip install comtypes wmi
import sys, os, traceback
sys.coinit_flags = 0 # sets pythoncom.COINIT_MULTITHREADED = 0
import comtypes.client # http://starship.python.net/crew/theller/comtypes/
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
gbrayut / hieradata_example.json
Last active Oct 10, 2016
Scollector Puppet Files
View hieradata_example.json
{
"scollector::collector_tags": [
"named",
"mysql"
]
}
@gbrayut
gbrayut / Systemd.service
Created Dec 8, 2015
Bosun Service files
View Systemd.service
#Bosun unit file at /etc/systemd/system/bosun.service
[Unit]
Description=Bosun Service
After=network.target
After=docker.service
After=rsyslog.service
[Service]
Type=simple
User=root
You can’t perform that action at this time.