Skip to content

Instantly share code, notes, and snippets.

function ReverseBytes
{
param([UInt32]$Value)
return (($value -band 0x000000FF) -shl 24) -bor (($value -band 0x0000FF00) -shl 8) -bor (($value -band 0x00FF0000) -shr 8) -bor (($value -band 0xFF000000 -shr 24))
}
function FlipHex
{
param([NETLOGON_NT_VERSION]$flags)
[UInt32] $f = [UInt32]$flags
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDVwZD2Ur4i/sEIZRYXkinx5PfAnLfJbTRMl6gl4tiR9PtWANVm5jsfoHujgNs3EMgSoBAPIJHz+mtyHD5LU3tMgqcVpw6KdDAypoZsD+cGJkGLIouI3U+lhUSb0xcfDE0etsvn+c0fFX9AHIlQgDFio1fN+UpNhWzFrZA0iriVsJ7pRqz87aOYa1FElSZ/jbQjctiOPuYStfDI8/5ipU4OyzqP50q45L+Qj6MpFKdNcinL2o+rXvrhILMjlxrjK3yExodKIAaf+gfu5MIRKUnlih2c5jv4oalWsYNl1vmZR6FPh77fkgheRKy6itJfmoe2V4M4xWsWUd3ihBzKrMWP
@GoodOlClint
GoodOlClint / pisetup.sh
Last active May 9, 2018 04:56
Configuration script for a new Raspberry Pi
#!/bin/bash
username=goodolclint
publickey=ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAnMfLbajwTboPlqFJyajrl9h+V++Nua0BibBiYkNckYbzQrl512pzYsqjp+Iti09FaJMo7ezbDjTa9PNv/H9oodiat8DZah+1EoRF4uoEATeWouU9ruhGHGLEe3CA9+48nqnfMRnWHrXymlpNEZCY6CuN+fQWZd7dFJ3fystOZ26R2t3ijWBitzsVntCPSYTLgbtqozbZk6efJwzwua+i8E9GbHOQ39jM1F6byoO9CFqaw6OwkSzvo03BNTLYofsw/cwb9MovjvDJz4x2/0DA0pz5zREhTbnhXpxxJAOfO8/IHiiLCF2zChBXUIamcpdCcnlo+WZYHBrUSIx1Fnr00Q== rsa-key-20161130
### DO NOT EDIT BELOW THIS LINE ###
if (( $EUID != 0 )); then
echo 'This script must be run as root'
exit
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAnMfLbajwTboPlqFJyajrl9h+V++Nua0BibBiYkNckYbzQrl512pzYsqjp+Iti09FaJMo7ezbDjTa9PNv/H9oodiat8DZah+1EoRF4uoEATeWouU9ruhGHGLEe3CA9+48nqnfMRnWHrXymlpNEZCY6CuN+fQWZd7dFJ3fystOZ26R2t3ijWBitzsVntCPSYTLgbtqozbZk6efJwzwua+i8E9GbHOQ39jM1F6byoO9CFqaw6OwkSzvo03BNTLYofsw/cwb9MovjvDJz4x2/0DA0pz5zREhTbnhXpxxJAOfO8/IHiiLCF2zChBXUIamcpdCcnlo+WZYHBrUSIx1Fnr00Q== rsa-key-20161130
@GoodOlClint
GoodOlClint / New-JunkFile
Created May 20, 2015 03:16
Generates a file of a specified length, filled with random bytes
function New-JunkFile
{
<#
.SYNOPSIS
Generates a file of a specified length, filled with random bytes
.DESCRIPTION
Generates a file of a specified length, filled with random bytes
Uses the RNGCryptoServiceProvider to randomly select each byte
@GoodOlClint
GoodOlClint / New-StrongPassword
Created April 13, 2015 01:51
Generates a cryptographically strong password
function New-StrongPassword
{
<#
.SYNOPSIS
Returns a strong password of the specified length
.DESCRIPTION
Returns a strong password of the specified length
Uses the RNGCryptoServiceProvider to randomly select each character of the password
@GoodOlClint
GoodOlClint / Show-Cats
Created October 2, 2014 01:40
Displays a random cat picture from TheCatApi
function Show-Cat
{
if($psversiontable.psversion.major -lt 3)
{
Write-Host 'Cats are only available on Powershell Version 3 or later'
return
}
[void][Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms')
$proxy = [System.Net.WebRequest]::GetSystemWebproxy().GetProxy('http://thecatapi.com/')
$settings = @{}