most of these require logout/restart to take effect
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeat
; AutoHotkey script, download from: | |
; http://www.autohotkey.com/ | |
; NOTE: Save this file with Windows line endings i.e. \r\n | |
; | |
cmd_line := "C:\bin\cygwin\bin\mintty.exe /bin/zsh --login" | |
wnd_class := "ahk_class mintty" | |
#c:: |
## -------------------------------------------------------------------------------------- | |
## | |
## This script is used to control how we deploy packages to Windows Azure. | |
## Orignial script (https://gist.github.com/PaulStovell/5234255) customized for | |
## Staging-To-Production with VIP swap deployment. | |
## | |
## NOTE: the script will only do Staging+VIP swap if $OctopusAzureSlot == "Staging". | |
## If $OctopusAzureSlot == anything else, the script will deploy directly to that slot | |
## without any further swapping. | |
## |
echo For my cloud agents, I had to get the pfx alias, Import the CARoot.cer, merge the pfx, and then change the password. | |
echo Based on https://github.com/haron/startssl-java and https://docs.oracle.com/javase/6/docs/technotes/tools/windows/keytool.html | |
cd %~dp0 | |
set JAVA_HOME=C:\BuildAgent\jre | |
set KEYTOOL=%JAVA_HOME%\bin\keytool | |
set KEYSTORE=%JAVA_HOME%\lib\security\cacerts | |
set PASSWORD=changeit | |
echo "Importing StartSSL certificates into %KEYSTORE%" > run.log | |
rem C:\BuildAgent>jre\bin\keytool -list -keystore .\conf\ssl\build.cloudapp.net.pfx -storetype pkcs12 |
### Server management tools preview (next month): https://blogs.technet.microsoft.com/servermanagement/2016/02/09/introducing-server-management-tools/ | |
### View the online docs | |
start https://docs.microsoft.com/en-us/powershell/azuread/v2/azureactivedirectory | |
### Find the module | |
Find-Module AzureAD | Select-Object * | |
<# | |
Version Name Repository Description |
<# | |
Script showing how to create a KeyVault vault and enable logging | |
(GUIDs redacted) | |
#> | |
New-AzureRmResourceGroup -Name cmartRG0614 -Location westus | |
<# | |
ResourceGroupName : cmartRG0614 | |
Location : westus | |
ProvisioningState : Succeeded |
### | |
### Without splatting | |
### | |
Get-Process -Name dns -ComputerName localhost | |
### | |
### With splatting | |
### | |
$myparamas = @{ |
### Load ADAL | |
Add-Type -Path "${env:ProgramFiles(x86)}\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Services\Microsoft.IdentityModel.Clients.ActiveDirectory.dll" | |
# Set AAD client ID for the client app | |
$clientId = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" | |
$resourceAppIdURI = "https://TestWebApi01.azurewebsites.net" | |
$authority = "https://login.windows.net/MyAadDirectory.onmicrosoft.com" | |
# Create Authentication Context tied to Azure AD Tenant | |
$authContext = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext" -ArgumentList $authority |
#Create the cert | |
New-SelfSignedCertificate -DnsName 'foo.azurewebsites.net' -CertStoreLocation cert:\CurrentUser\My -KeyAlgorithm RSA -KeyLength 2048 -KeyExportPolicy Exportable #-KeyUsage DigitalSignature,nonRepudiation,keyEncipherment | |
#Look for the cert | |
dir Cert:\CurrentUser\My | |
#Export the cert to a PFX file | |
$mypwd = ConvertTo-SecureString -String "WhoFedTheDogCorn?" -Force –AsPlainText | |
dir Cert:\CurrentUser\My | Where Subject -EQ 'CN=foo.azurewebsites.net' | Export-PfxCertificate -ChainOption BuildChain -Password $mypwd -FilePath E:\Scratch\fooCert.pfx |
Function Test-DownloadUri { | |
<# | |
.SYNOPSIS | |
Tests that a url is valid | |
.DESCRIPTION | |
Returns a status code from an http request of a url. Used to verify that download links work. | |
.PARAMETER Uri | |
The url that we are checking is valid | |
.INPUTS | |
N/A |