Skip to content

Instantly share code, notes, and snippets.

@ruusty
ruusty / NmiCheckSum.cs
Created August 5, 2018 11:32
Nmi check sum
using System;
using System.Text;
using System.Linq;
/*Calculates a LUHN-10.
* 1. Double the value of alternate digits beginning with the rightmost digit
* 2. Add the individual digits comprising the products obtained in step 1 to each of the unaffected digits in the original number.
* 3. Find the next highest multiple of 10
* 4. The check digit is the value obtained in step 2 subtracted from the value obtained in step 3.
* 5. END
gwmi win32_operatingSystem | select caption
http://serverfault.com/questions/727163/is-it-possible-to-get-a-windows-version-from-a-powershell-command-on-windows-ser
Dism /Online /Get-Feature
Get-CimInstance Win32_OperatingSystem | Select-Object Caption | ForEach{ $_.Caption }
@ruusty
ruusty / Windows10-Setup.ps1
Created July 7, 2016 12:50 — forked from NickCraver/Windows10-Setup.ps1
(In Progress) PowerShell Script I use to customize my machines in the same way for privacy, search, UI, etc.
##################
# Privacy Settings
##################
# Privacy: Let apps use my advertising ID: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0
# To Restore:
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 1
# Privacy: SmartScreen Filter for Store Apps: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Type DWord -Value 0
@ruusty
ruusty / filter sample .ps1
Created January 28, 2016 12:42
Filter to remove null entries
filter Skip-Empty { $_|?{ $_ -ne $null -and $_} }
get-content *-servers.txt | sort -unique | Skip-Empty | .\Collect-ServerInfo\Collect-ServerInfo.ps1
@ruusty
ruusty / 0_reuse_code.js
Created March 23, 2014 04:06
Here are some things you can do with Gists in GistBox. gist.io
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console