Skip to content

Instantly share code, notes, and snippets.

View dknoodle's full-sized avatar

Daniel Knoodle dknoodle

View GitHub Profile
#!/bin/bash
# Change hostname on Ubuntu/Debian system
# Run with: sudo bash change-hostname.sh new-hostname
set -e
# Check if running as root
if [ "$EUID" -ne 0 ]; then
echo "Please run with sudo: sudo bash $0 <new-hostname>"
exit 1
#!/bin/bash
# Fix Proxmox VM Initramfs/GRUB Issues After Cloning
# Run from Ubuntu Live ISO - Select "Try Ubuntu"
# wget https://gist.githubusercontent.com/YOUR_USERNAME/GIST_ID/raw/fix-vm-boot.sh
# sudo bash fix-vm-boot.sh
set -e
# Check root
[ "$EUID" -ne 0 ] && { echo "Run with sudo: sudo bash $0"; exit 1; }
@dknoodle
dknoodle / Windows Defender Exclusions VS 2022.ps1
Last active June 27, 2025 21:29
Windows Defender exclusions for Visual Studio development
# Function to display colored text
function Write-ColorOutput($ForegroundColor)
{
$fc = $host.UI.RawUI.ForegroundColor
$host.UI.RawUI.ForegroundColor = $ForegroundColor
if ($args) {
Write-Output $args
}
else {
$input | Write-Output
@dknoodle
dknoodle / Windows Defender Exclusions VS 2017.ps1
Last active February 27, 2025 07:27
Adds Windows Defender exclusions for Visual Studio 2017
$userPath = $env:USERPROFILE
$pathExclusions = New-Object System.Collections.ArrayList
$processExclusions = New-Object System.Collections.ArrayList
$pathExclusions.Add('C:\Windows\Microsoft.NET') > $null
$pathExclusions.Add('C:\Windows\assembly') > $null
$pathExclusions.Add($userPath + '\AppData\Local\Microsoft\VisualStudio') > $null
$pathExclusions.Add('C:\ProgramData\Microsoft\VisualStudio\Packages') > $null
$pathExclusions.Add('C:\Program Files (x86)\MSBuild') > $null
$pathExclusions.Add('C:\Program Files (x86)\Microsoft Visual Studio 14.0') > $null
@dknoodle
dknoodle / window-controller.js
Created March 28, 2017 20:16 — forked from neilj/window-controller.js
Cross-tab window controller
function WindowController () {
this.id = Math.random();
this.isMaster = false;
this.others = {};
window.addEventListener( 'storage', this, false );
window.addEventListener( 'unload', this, false );
this.broadcast( 'hello' );
@dknoodle
dknoodle / states_hash.json
Created December 3, 2012 21:45 — forked from mshafrir/states_hash.json
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",