Skip to content

Instantly share code, notes, and snippets.

Daniel Grenemark desek

Block or report user

Report or block desek

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View customScript.sh
#!/bin/bash
docker run -d --net=host --name iota-node -p 14265:14265 -p 14777:14777/udp -p 15777:15777 -v iota.ini:/iri/iota.ini iotaledger/iri:latest
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm i -g iota-pm
View manageDataDisk.ps1
# Version should be 6.3* indicating Windows Server 2012 R2
If ([System.Environment]::OSVersion.Version.ToString() -like "6.3*")
{
# Windows Product Types. Script should only run on Server OS.
# 1: Workstation
# 2: Domain Controller
# 3: Server
If ((Get-WmiObject Win32_OperatingSystem -ErrorAction SilentlyContinue).ProductType -eq 3)
{
$Disks = Get-PhysicalDisk -CanPool $true -ErrorAction SilentlyContinue
View TemplateParameterObject.xml
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">
<Obj RefId="0">
<TN RefId="0">
<T>System.Collections.Specialized.OrderedDictionary</T>
<T>System.Object</T>
</TN>
<DCT>
<En>
<S N="Key">siteName</S>
<S N="Value">wa-test-cmn-beta1</S>
@desek
desek / Bug-Example-TemplateParameterObject.ps1
Created Jun 11, 2015
New-AzureResourceGroup TemplateParameterObject bug
View Bug-Example-TemplateParameterObject.ps1
$galleryTemplate = Get-AzureResourceGroupGalleryTemplate -Identity $galleryTemplateId
$galleryTemplateJson = Invoke-RestMethod -Uri $GalleryTemplate.DefinitionTemplatesText
$siteLocation = "westeurope","eastus" | Out-GridView -PassThru -Title 'Location'
$webAppSize = $galleryTemplateJson.parameters.sku.allowedValues | Out-GridView -PassThru -Title 'Web Application size'
$dbSize = $galleryTemplateJson.parameters.databaseSku.allowedValues | Out-GridView -PassThru -Title 'Database size'
$KeySalt = [guid]::NewGuid().Guid.Replace("-","")
$TemplateParameterObject = [ordered]@{
siteName = $webAppName
hostingPlanName = "{0}-HostingPlan" -f $webAppName
@desek
desek / Update Azure Powershell one liner.ps1
Created May 16, 2015
Update Azure Powershell one liner
View Update Azure Powershell one liner.ps1
iex (Invoke-RestMethod -Uri https://api.github.com/gists/dfe515f4ef0b14e6be15).files.'Update-AzurePowershell.ps1'.content
@desek
desek / Update-AzurePowershell.ps1
Last active Aug 29, 2015
Update Azure Powershell module with Powershell
View Update-AzurePowershell.ps1
# Get latest azure-powershell
$AzureModule = Get-Module -Name Azure* -ListAvailable
$LatestRelease = Invoke-RestMethod -Uri https://api.github.com/repos/Azure/azure-powershell/releases/latest -Method GET
If (-not($AzureModule) -or $AzureModule.Version.ToString() -ne $LatestRelease.name)
{
$Asset = $LatestRelease.assets | Where-Object {$_.name -like "*.msi"}
$OutFile = "{0}\{1}" -f $env:TEMP, $Asset.name
Invoke-WebRequest -Uri $Asset.browser_download_url -OutFile $Outfile -Method Get
Start-Process -FilePath msiexec.exe -ArgumentList @("/i $OutFile /qb") -Wait -PassThru
}
@desek
desek / aaassembliesandmodules.txt
Last active Aug 29, 2015
Azure Automation Assmeblies and Available Modules 2014-12-02
View aaassembliesandmodules.txt
Scriptblock {
[appdomain]::CurrentDomain.GetAssemblies() | Format-Table ImageRuntimeVersion, FullName
Get-Module -ListAvailable | Format-Table Name, Version
}
ImageRuntimeVersion FullName
------------------- --------
v4.0.30319 mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyTok...
v4.0.30319 Orchestrator.Sandbox, Version=7.2.0.0, Culture=neutral, ...
v4.0.30319 Orchestrator.Shared, Version=7.2.0.0, Culture=neutral, P...
@desek
desek / xmlconflooping.ps1
Last active Aug 29, 2015
XmlConf Looping
View xmlconflooping.ps1
$XmlData = @'
<HostGroups>
<HostGroup Name="All Hosts">
<HostGroup Name="Oslo">
<LogicalNetworkDefinitions>
<LogicalNetworkDefinition name="LM Oslo">
<LogicalNetwork>Live Migration</LogicalNetwork>
<Subnet>192.168.5.0/24</Subnet>
<VlanID>5</VlanID>
</LogicalNetwork>
@desek
desek / assignSchedulesToRunbook.ps1
Created Nov 27, 2014
Assign Schedule(s) to Runbook
View assignSchedulesToRunbook.ps1
# Set Azure Automation Account Name
$PSDefaultParameterValues += @{"*-AzureAutomation*:AutomationAccountName"=$AzureAutomationAccount.AutomationAccountName}
# Select one Runbook
$Runbook = Get-AzureAutomationRunbook | Out-GridView -PassThru
# Select one/multiple Schedule(s)
$Schedules = Get-AzureAutomationSchedule | Out-GridView -PassThru
# Assign Schedules to Runbook
@desek
desek / GAASoutput.txt
Last active Aug 29, 2015
Generate Azure Automation Schedule(s) Output
View GAASoutput.txt
PS C:\> GenerateAzureAutomationSchedules -AutomationAccount $AzureAutomationAccount -Verbose
VERBOSE: Found 35 Azure Automation Schedule(s) with same Hour Interval.
VERBOSE: Creted Azure Automation Schedule for "Every 1 Hour(s) at minute 0".
VERBOSE: Azure Automation Schedule for "Every 1 Hour(s) at minute 2" already exists.
VERBOSE: Azure Automation Schedule for "Every 1 Hour(s) at minute 4" already exists.
VERBOSE: Azure Automation Schedule for "Every 1 Hour(s) at minute 5" already exists.
VERBOSE: Azure Automation Schedule for "Every 1 Hour(s) at minute 6" already exists.
VERBOSE: Azure Automation Schedule for "Every 1 Hour(s) at minute 8" already exists.
VERBOSE: Azure Automation Schedule for "Every 1 Hour(s) at minute 10" already exists.
VERBOSE: Azure Automation Schedule for "Every 1 Hour(s) at minute 12" already exists.
You can’t perform that action at this time.