Skip to content

Instantly share code, notes, and snippets.

View brucevanhorn2's full-sized avatar
I may be slow to respond.

Bruce M. Van Horn II brucevanhorn2

I may be slow to respond.
View GitHub Profile
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns=""
xsi:schemaLocation=" NLog.xsd"
internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log" >
<!-- optional, add some variabeles
brucevanhorn2 /
Created February 23, 2018 21:28 — forked from aunyks/
The block structure for SnakeCoin.
import hashlib as hasher
class Block:
def __init__(self, index, timestamp, data, previous_hash):
self.index = index
self.timestamp = timestamp = data
self.previous_hash = previous_hash
self.hash = self.hash_block()
# sets up a PC for full stack boot camp at SMU
# assumes you have chocolatey installed
# at this point it doesn't install EVERYTHING, just the basics. no databases yet.
ssh-keygen -N <change-to-actual-password-before-running> -f C:\Users\<insert user name here>\.ssh\id_rsa
wsl --install -d Ubuntu-20.04
choco install -Force -y visualstudio2019buildtools
choco install -Force -y brave
choco install -Force -y git
choco install -Force -y vscode
brucevanhorn2 / bvh-mt.omp.json
Created November 9, 2021 19:54
This is my version of the MT theme for Oh My Posh (gives you a fancy terminal window)
"$schema": "",
"final_space": true,
"blocks": [
"type": "prompt",
"alignment": "left",
"segments": [
"type": "shell",
echo Whosa are yousa?
read yousaIs
echo Nicen to meets you $yousaIs. Messa thinkin weesa bein friends!
brucevanhorn2 /
Created April 21, 2022 19:36
Use Python to Parse Python Files with Abstract Syntax Tree

Parsing a Python File using Python and the Abstract Syntax Tree

This comes in handy often. I want to do something based on a Python file. Maybe I want to pull all the docstrings out and make a markdown file. Maybe I want generate a script that calls all the functions in a python file. Whatever it is, the abstract syntax tree can help. Here is an example for the first use case: I pull out all the docstrings. We used this to create the documentation for hackathon at Clear Technologies a few years ago.

brucevanhorn2 / bvh-windows-10-dev-setup.ps1
Last active May 10, 2022 17:21
Windows Dev Machine Setup
This script is designed to automate the set up of developer machines at Clear Technologies for work on Visual Storage Intelligence.
It should be run on a Windows 10 computer. I usually run a de-bloat script first, then I run this one.
Basically it install chocolatey then uses it to install everything we need to do our work.
It's mostly an unattended install but if you want to repos towards the bottom to be checked out you should copy the generated key
to beanstalk while the script is paused.
Set-ExecutionPolicy Bypass -Scope Process -Force;
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;
Invoke-Expression((New-Object System.Net.WebClient).DownloadString(''))
brucevanhorn2 /
Created October 7, 2022 04:32 — forked from djfdyuruiry/
WSL 2 - Enabling systemd

Enable systemd in WSL 2

NOTE: There is now an official way to do this in WSL 2, use it if possible - see MS post here

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of to a new file /tmp/

brucevanhorn2 / gist:4be9e3dfd38dd6ef074d983e1c261b41
Created November 10, 2022 18:05
Use the VSI 5 REST API to export your Enterprise Summary Data (cURL verion)
curl --location --request POST '' \
--header 'Content-Type: application/json' \
--data-raw '{
"export_format": "json",
"request_date": "10-31-2022",
"request_user": "your email here",
"request_password": "your password here"
brucevanhorn2 /
Created November 10, 2022 18:08
VSI 5 Enterprise Summary Export (Python 3 Version)
import http.client
import json
conn = http.client.HTTPSConnection("")
payload = json.dumps({
"export_format": "json",
"request_date": "10-31-2022",
"request_user": "your email here",
"request_password": "your password here"