Skip to content

Instantly share code, notes, and snippets.

View JanneMattila's full-sized avatar

Janne Mattila JanneMattila

View GitHub Profile
@JanneMattila
JanneMattila / SolverInit.txt
Created October 28, 2014 18:48
My Pocket Solitaire MapReduce solver seed file
65536 1
@JanneMattila
JanneMattila / MapReduceLocal.bat
Created October 28, 2014 20:08
My Pocket Solitaire MapReduce local development script file
type SolverInit.txt | SolverMapper.exe | SolverReducer.exe
@JanneMattila
JanneMattila / MapReduceLocalConcept.bat
Created October 28, 2014 21:01
My Pocket Solitaire MapReduce concept in local development
type SolverInit.txt |^
SolverMapper.exe | sort | SolverReducer.exe |^
SolverMapper.exe | sort | SolverReducer.exe |^
SolverMapper.exe | sort | SolverReducer.exe |^
SolverMapper.exe | sort | SolverReducer.exe |^
SolverMapper.exe | sort | SolverReducer.exe |^
SolverMapper.exe | sort | SolverReducer.exe |^
SolverMapper.exe | sort | SolverReducer.exe |^
SolverMapper.exe | sort | SolverReducer.exe |^
SolverMapper.exe | sort | SolverReducer.exe |^
@JanneMattila
JanneMattila / Solve.bat
Created October 28, 2014 21:16
My Pocket Solitaire MapReduce solver launcher batch
@powershell.exe -NoProfile -InputFormat none -ExecutionPolicy unrestricted -File %~dp0Solve.ps1
@JanneMattila
JanneMattila / Get-AzurePublishSettingsFileCommand
Last active August 29, 2015 14:08
Download Azure publishing settings file using Azure PowerShell
# Get Azure publish settings file using this command:
Get-AzurePublishSettingsFile
@JanneMattila
JanneMattila / Solve.ps1
Last active August 29, 2015 14:08
My Pocket Solitaire MapReduce solver using PowerShell and Azure HDInsight automation
$startTime = Get-Date
Function Log ($message) {
$currentTime = Get-Date
$currentDelta = ($currentTime - $startTime).ToString("hh\:mm\:ss")
Write-Output "${currentDelta}: $message"
}
# Variables for setting up the Azure:
$subscriptionName = "Visual Studio Professional with MSDN"
@JanneMattila
JanneMattila / Input32-part-00000
Created October 29, 2014 18:51
My Pocket Solitaire MapReduce solver output from level 32
6442450943 10215411760019992 OQDPKIPD2PUWGUXVZXUWMKXJJLP2AIHJ1M5W7Y6XR4WYMK4RJLCKSQBJQELJJB
8589410303 10215411760019992 EQHJAIPDNPQOSQ4R1YR4CA7YXZ2PAIJHM1LJ1YQEFD6XYWGIP25WDPP2UW2PPN
8589869055 40861647040079968 SQ4RWYR47YZXUWFRMKXV5WJL1M6XMKP2HJGUAIUW2PPDRFCKKIQ3DPOQBJJX3Q
8589926399 10215411760019992 OQDPGIUGWU5WXVZX7YXZ1YR4JHGIFRMKRFTRCKRFPDACCKDF6XUWFRQSWY4RRT
8589934589 10215411760019992 SQ4RWYR47YZXUWFRMKXV5WJL1M6XMKP2HJGUAIUW2PPDRFCKKIQ3DPOQBJJXX6
@JanneMattila
JanneMattila / FindSPN.ps1
Last active August 25, 2016 13:12
Find service principal (SPN)
$spn = (Get-AzureRmADServicePrincipal -SearchString "yourspnname")[0]
$spn.ApplicationId
@JanneMattila
JanneMattila / deploy-initial.ps1
Created August 25, 2016 13:11
Clip from deploy-initial.ps1
Write-Host Creating resource group...
New-AzureRmResourceGroup -Name $ResourceGroupName -Location $Location -Verbose
Write-Host Creating key vault...
New-AzureRmKeyVault `
-VaultName $VaultName `
-EnabledForDeployment `
-EnabledForTemplateDeployment `
-ResourceGroupName $ResourceGroupName `
-Location $Location -Verbose
@JanneMattila
JanneMattila / AddUserToKeyVault.ps1
Created August 25, 2016 13:14
Add user to Key Vault
$me = Get-AzureRmADUser -SearchString "your name"
Set-AzureRmKeyVaultAccessPolicy `
-VaultName $VaultName `
-ResourceGroupName $ResourceGroupName `
-UserPrincipalName $me.UserPrincipalName `
-PermissionsToKeys all `
-PermissionsToSecrets all