This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ChildItem | Sort-Object LastWriteTime -Descending | Get-Content | Out-File combined.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Derived from https://stackoverflow.com/a/8743878 | |
function Get-MsiDatabaseVersion { | |
param ( | |
[string]$FilePath | |
) | |
if(!(Test-Path $FilePath)){ | |
throw "Could not find " + $FilePath | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ChildItem *.cs -recurse | ForEach { (Get-Content $_.FullName).Replace("#if DEBUG", "#if DEBUG_DISABLE").Replace("#if !DEBUG", "#if DEBUG") | Set-Content -Path $_.FullName -Encoding UTF8 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:://call:: | |
SendInput, /status :phone: Call{enter} | |
Return | |
:://clear:: | |
SendInput, /status clear{enter} | |
Return | |
:://wfh:: | |
SendInput, /status :house_with_garden: Working From Home{enter} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Run this every 1/2 hour and in an 8 hour work day there will be approximately 3 times per day that your victim hears a cat fact | |
if ((Get-Random -Maximum 10000) -lt 1875) { | |
Add-Type -AssemblyName System.Speech | |
$SpeechSynth = New-Object System.Speech.Synthesis.SpeechSynthesizer | |
$CatFact = (ConvertFrom-Json (Invoke-WebRequest -Uri 'http://catfacts-api.appspot.com/api/facts')).facts | |
$SpeechSynth.Speak("did you know?") | |
$SpeechSynth.Speak($CatFact) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Show and expand all Salesforce feed items | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @include https://*.salesforce.com | |
// @run-at document-end | |
// @require http://code.jquery.com/jquery-latest.min.js | |
// @grant none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HkdfHmacSha256 | |
{ | |
public const int HASH_LENGTH = 32; | |
public byte[] Compute(int length, byte[] ikm, byte[] salt = null, byte[] info = null) | |
{ | |
salt = salt ?? new byte[] { }; | |
info = info ?? new byte[] { }; | |
var prk = HmacSha256(salt, ikm); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://stackoverflow.com/a/10472358/73986 | |
$packageConfig = Get-Item packages.config | |
$content = [Xml](Get-Content $packageConfig) | |
$content | Select-Xml /packages/package | Selet-Object -ExpandProperty Node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$proxy = New-WebServiceProxy -uri $url -UseDefaultCredential -Namespace "SecretServer" | |
$NewUser = New-Object -TypeName "SecretServer.GroupOrUserRecord" | |
$NewUser.Name= 'PW' | |
$NewUser.IsUSer =$true | |
$NewUser.UserID =5 | |
$NewUser.GroupID =5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://stackoverflow.com/questions/311165/how-do-you-convert-byte-array-to-hexadecimal-string-and-vice-versa | |
public static string ByteArrayToString(byte[] ba) | |
{ | |
StringBuilder hex = new StringBuilder(ba.Length * 2); | |
foreach (byte b in ba) | |
hex.AppendFormat("{0:x2}", b); | |
return hex.ToString(); | |
} |