Skip to content

Instantly share code, notes, and snippets.

@pbzona
pbzona / ec2-join-tag-example-yaml.yml
Created November 21, 2017 21:24
CloudFormation - Join example in YAML
Parameters:
App:
Description: "Examples: blog, api"
Type: String
Env:
Description: "Examples: prod, stag, dev"
Type: String
Role:
Description: "Examples: web, worker, scheduler"
Type: String
@tsujeeth
tsujeeth / get_from_map.go
Created December 5, 2014 16:51
Using Golang's reflect package (MakeFunc) to implement typed accessors for a map.
/* Using reflect.MakeFunc to fetch from map[string]interface{}.
* getString(key) will either return the 'string' value or empty string.
* getInt(key) will either return the 'int' value or a 0.
*/
package main
import (
"fmt"
"reflect"
@timnew
timnew / Rename.ps1
Last active October 15, 2025 14:30
Script to Rename Computer without Reboot
$ComputerName = "New Name"
Remove-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "Hostname"
Remove-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "NV Hostname"
Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Computername\Computername" -name "Computername" -value $ComputerName
Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Computername\ActiveComputername" -name "Computername" -value $ComputerName
Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "Hostname" -value $ComputerName
Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "NV Hostname" -value $ComputerName
Set-ItemProperty -path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -name "AltDefaultDomainName" -value $ComputerName