Skip to content

Instantly share code, notes, and snippets.

View arebee's full-sized avatar

Richard Burte arebee

View GitHub Profile
@REM From http://www.windowsobserver.com/2014/04/10/add-the-missing-power-icon-on-your-surface-for-windows-8-1-update/
@REM Show power button on Start Screen
REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\ImmersiveShell\Launcher /v Launcher_ShowPowerButtonOnStartScreen /t REG_DWORD /d 1
@REM Hide power button on Start Screen
REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\ImmersiveShell\Launcher /v Launcher_ShowPowerButtonOnStartScreen /t REG_DWORD /d 0
@arebee
arebee / amIAdmin
Created April 29, 2014 19:52
Powershell one-liner for UAC detection.
# Will return false if you aren't in a UAC evelvated command prompt. true if you are.
(new-object System.Security.Principal.WindowsPrincipal([System.Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)
@arebee
arebee / IE Default reg
Created May 1, 2014 16:45
Change the default View Source editor in IE
REG ADD "HKCU\Software\Microsoft\Internet Explorer\View Source Editor\Editor Name" /t REG_SZ /d "C:\Code\Tools\Notepad2\Notepad2.exe"
@arebee
arebee / ReverseString in PowerShell
Created September 30, 2014 18:26
Reverse a string in PowerShell, using an efficient StringBuilder allocation.
function reverseString
{
Param(
[string]$str
)
$sb = New-Object System.Text.StringBuilder($str.Length)
write-verbose $sb.Capacity
for ($i = ($str.Length - 1); $i -ge 0; $i--)
@arebee
arebee / disable-ssl30-windows.cmd
Last active August 29, 2015 14:07
Disable SSL 3.0 on the Server for IIS etc,
@REM Disable server side
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\Schannel\Protocols\SSL 3.0\Server" /VE
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\Schannel\Protocols\SSL 3.0\Server" /V Enabled /T REG_DWORD /D 0
@REM To force disable client side, overkill. Use client config (i.e. IE Internet Options etc.)
@REM REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\Schannel\Protocols\SSL 3.0\Client" /VE
@REM REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\Schannel\Protocols\SSL 3.0\Client" /V DisabledByDefault /T REG_DWORD /d 1
@arebee
arebee / gist:3bb87840b1b912592a7f
Created July 30, 2015 06:06
PowerShell to get the Windows OS SKU
Get-WmiObject -Class Win32_OperatingSystem -Namespace "root\cimv2" | format-list Caption, Version
@arebee
arebee / no-bom.ps1
Created November 17, 2015 02:29
PowerShell script to save as UTF-8 without a BOM
gci . -recurse -filter *.ps* | % {
$MyFile = gc $_.Fullname -raw
$MyPath = $_.Fullname
[System.IO.File]::WriteAllLines($MyPath, $MyFile, [System.Text.UTF8Encoding]($False))
}
Import-Module Microsoft.PowerShell.Security
set-location cert:
Get-ChildItem -recurse | Where-Object {$_.Thumbprint -match "98A04E4163357790C4A79E6D713FF0AF51FE6927"} | write-host "eDellRoot Found"
# Current User
dir Cert:\CurrentUser\ -Recurse | where {(($_.Issuer -ne $null) -and ($_.Issuer.ToString() -match '.*Apple.*')) }
dir Cert:\CurrentUser\ -Recurse | where {(($_.Issuer -ne $null) -and ($_.Issuer.ToString() -match '.*Microsoft.*')) }
# Current Machine
dir Cert:\LocalMachine\ -Recurse | where {(($_.Issuer -ne $null) -and ($_.Issuer.ToString() -match '.*Apple.*')) }
dir Cert:\LocalMachine\ -Recurse | where {(($_.Issuer -ne $null) -and ($_.Issuer.ToString() -match '.*Microsoft.*')) }
# Scans the 192.168.1.nnn hosts for http responses.
for ($i = 1; $i -ile 254; $i++) {
$testAddress = "192.168.1." + $i
$info = Test-NetConnection -ComputerName $testAddress -CommonTCPPort http -InformationLevel Quiet
if ($info -eq $true)
{
write-host "$testAddress is listening on 80 for HTTP traffic"
}
}