Skip to content

Instantly share code, notes, and snippets.

View mikaelweave's full-sized avatar
🔥

Mikael Weaver mikaelweave

🔥
View GitHub Profile

Keybase proof

I hereby claim:

  • I am mikaelweave on github.
  • I am mikaelweave (https://keybase.io/mikaelweave) on keybase.
  • I have a public key whose fingerprint is D89C 4141 D302 508F 0BE8 FBE6 33F3 E2E7 27E3 8E9A

To claim this, I am signing this object:

@mikaelweave
mikaelweave / dspcDecode.sh
Last active July 27, 2020 14:57
Mac OSX Display DSPC Hex Decoder
#!/bin/bash
function hex2values {
# https://opensource.apple.com/source/IOKitUser/IOKitUser-67/graphics.subproj/IOGraphicsLibPrivate.h
clock=0x${1:0:4}
horizActive=0x${1:4:2}
horizBlanking=0x${1:6:2}
horizHigh=0x${1:8:2}
verticalActive=0x${1:10:2}
verticalBlanking=0x${1:12:2}
@mikaelweave
mikaelweave / list_of_types.txt
Created July 9, 2019 18:31
Azure Policy Daig Types
{"listOfResourceTypes":{"value":["Microsoft.AnalysisServices/servers", "Microsoft.ApiManagement/service", "Microsoft.Automation/automationAccounts", "Microsoft.Batch/batchAccounts", "Microsoft.Cdn/profiles/endpoints", "Microsoft.ClassicNetwork/networksecuritygroups", "Microsoft.CognitiveServices/accounts", "Microsoft.ContainerService/managedClusters", "Microsoft.CustomerInsights/hubs", "Microsoft.DataFactory/factories", "Microsoft.DataLakeAnalytics/accounts", "Microsoft.DataLakeStore/accounts", "Microsoft.DBforMySQL/servers", "Microsoft.DBforPostgreSQL/servers", "Microsoft.Devices/IotHubs", "Microsoft.Devices/provisioningServices", "Microsoft.DocumentDB/databaseAccounts", "Microsoft.EventHub/namespaces", "Microsoft.Insights/AutoscaleSettings", "Microsoft.IoTSpaces/Graph", "Microsoft.KeyVault/vaults", "Microsoft.Logic/workflows", "Microsoft.Logic/integrationAccounts", "Microsoft.Network/networksecuritygroups", "Microsoft.Network/loadBalancers", "Microsoft.Network/publicIPAddresses", "Microsoft.Network/virtualN
@mikaelweave
mikaelweave / reclaimWindows10.ps1
Created August 8, 2018 21:37 — forked from alirobe/reclaimWindows10.ps1
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <disassembler@dasm.cz>
# Modified by: alirobe <alirobe@alirobe.com> based on my personal preferences.
# Version: 2.20.1, 2018-07-23
# Primary Author Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
# Tweaked Source: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1/
# Tweak difference:
#
# @alirobe's version is a subset focused on safely disabling telemetry, some 'smart' features and 3rd party bloat ...
## REMOVE CRAP
Get-AppxPackage -AllUsers | Remove-AppxPackage
## INSTALL PACKAGE MANAGERS
Write-Host "Installing Scoop and Choco..."
Set-ExecutionPolicy Bypass -Scope Process -Force; iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
## INSTALL APPS THROUGH SCOOP
Write-Host "Installing apps through scoop (cmder, curl, docker)..."
@mikaelweave
mikaelweave / get_random_subset_of_files
Created July 20, 2018 21:51
Taken files in a directory, get a random subset of them
import os, random
#Where the image folders live
hardshell_path = "gear_images/hardshell_jackets/"
insulated_path = "gear_images/insulated_jackets/"
#Play around with ratio training to run
train_ratio = 0.5
set_hardshell = set(os.listdir(hardshell_path))
#view if readonly
gci -Include *.cshtml -Recurse -Path $pwd | select fullname,isreadonly
#remove read only
gci -Include *.cshtml -Recurse | % { if($_.IsReadOnly){$_.IsReadOnly= $false} }
Install-Module -Name Posh-SSH -Scope CurrentUser
Get-Command -Module Posh-SSH
IF NOT EXISTS (SELECT * FROM sys.objects WHERE type = 'IF' AND object_id = object_id('dbo.ParseFilePath'))
EXEC ('CREATE FUNCTION dbo.ParseFilePath() RETURNS TABLE AS RETURN SELECT Result = ''This is a stub'';' )
GO
ALTER FUNCTION dbo.ParseFilePath (@FilePath nvarchar(300))
RETURNS TABLE
/*************************************************************************************************
AUTHOR: Andy Mallon
CREATED: 20180114