Skip to content

Instantly share code, notes, and snippets.

@DamianStanger
DamianStanger / foo
Last active August 29, 2015 13:56
boxstarter foo
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
cinst IIS-WebServerRole -source windowsfeatures
cinst IIS-HttpCompressionDynamic -source windowsfeatures
cinst IIS-ManagementScriptingTools -source windowsfeatures
cinst IIS-WindowsAuthentication -source windowsfeatures
cinst GoogleChrome
cinst Console2
@DamianStanger
DamianStanger / basicBoxstarter
Created September 1, 2014 14:51
New box script
cinst sublimetext3
cinst BareTail
@DamianStanger
DamianStanger / NewBoxSetup
Last active March 24, 2016 17:10
new server setup
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
choco install gitextensions -y
choco install tortoisesvn -y
choco install baretail -y
choco install sublimetext3 -y
choco install googlechrome -y
choco install procexp -y
choco install Silverlight -y
choco install 7zip -y
$PSVersionTable.PSVersion
[Environment]::Is64BitProcess
(Get-Process -Id $PID).StartInfo.EnvironmentVariables["PROCESSOR_ARCHITECTURE"]
C:\Windows\SysNative\WindowsPowerShell\v1.0\powershell.exe
select-string -Path *.lnk -Pattern '(c|C):[- \w.\\_]+\.jpg' -AllMatches | % { $_.Matches } | % { $_.Value } | copy-item -destination .\copy\$_
Function Add-LocalUserAccount{
param (
[parameter(Mandatory=$true)]
[string[]]$ComputerNames=$env:computername,
[parameter(Mandatory=$true)]
[string[]]$UserNames,
[parameter(Mandatory=$true)]
[string]$Password
)
$context = New-AzureStorageContext -StorageAccountName foobar -StorageAccountKey gsdfgdsfGSDFGsdFGSdfgSDFGSDFGsdfg
$imeis = Select-String -Path .\foo.txt -Pattern "." | ForEach-Object {$_.Line}
$dateResultMap = @{}
#echo "xxx70"
$MAXSIZE = 150
for($i=0; $i -lt $imeis.Count; $i++){
@DamianStanger
DamianStanger / AHK key mapping
Last active March 29, 2016 09:13
Auto hot key, Vim style edit mode
; + = shift
; ^ = ctrl
; # = windows
; ! = alt
::pw1::password1
; #v::Run "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe"
^+Down::send ^{End}
^+Up::send ^{Home}
@DamianStanger
DamianStanger / commands
Created March 6, 2015 12:16
Git commands
git log --branches --remotes --tags --graph --oneline --decorate
@DamianStanger
DamianStanger / applycert.ps1
Created March 9, 2015 09:41
IIS Certificate installation
write-host "Apply the certName cert" -ForegroundColor Green
$cert = dir cert:\localmachine\my | where-object{$_.subject -like "*.certName.*"}
if(!$cert){
$cert = dir cert:\localmachine\webhosting | where-object{$_.subject -like "*.certName.*"}
}
if(!$cert){
throw [System.Exception] "No ssl cert found that matches the search '*.certName.*'"
}
new-item "IIS:\SslBindings\0.0.0.0!443" -Value $cert