Skip to content

Instantly share code, notes, and snippets.

Jennelle Crothers techbunny

Block or report user

Report or block techbunny

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
@techbunny
techbunny / ImpLab_AzureFiles
Last active Aug 29, 2015
The Imperfect Lab: Azure Files
View ImpLab_AzureFiles
# Created a new storage account:
New-AzureStorageAccount -StorageAccountName <storageaccountname> -Location ‘West US’
# Captured the Access Key as a variable:
$storageAccessKey = (Get-AzureStorageKey –StorageAccountName <storageaccountname>).Primary
# Created a security context with the access key:
$storageContext = New-AzureStorageContext <storageaccountname> $storageAccessKey
# Created a new share:
@techbunny
techbunny / ImpLab_DeployVMs
Created Dec 23, 2014
The Imperfect Lab: Deploying VMs
View ImpLab_DeployVMs
# Set Your Subscription and Storage Account
Set-AzureSubscription -SubscriptionName "Visual Studio Ultimate with MSDN" -CurrentStorageAccount "imperfectstore"
# Set basic variables for your VM. In this case, this is the adminstrator name and password, as well as the name of the Windows Server 2012 R2 image available at the time of this exercise. You'll want to make sure to get the current name of whatever OS you want to install.
$un = "adminname"
$pwd = "secretpassword"
$image = "a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-R2-201411.01-en.us-127GB.vhd"
# Pick up that VM image the full list with:
@techbunny
techbunny / ImpLab_StaticIPs
Created Dec 23, 2014
The Imperfect Lab: Static IPs
View ImpLab_StaticIPs
# You can double check that an address is free with:
Test-AzureStaticVNetIP –VNetName ImperfectNet –IPAddress 192.168.1.5
# To set the static address, I used:
Get-AzureVM -ServiceName ImperfectCore -Name DC-Cloud1 | Set-AzureStaticVNetIP -IPAddress "192.168.1.4" | Update-AzureVM
# Kick off the addition of my second domain controller in this domain, I used:
Install-ADDSDomainController -Credential (Get-Credential) -DatabasePath 'C:\Windows\NTDS' -DomainName 'imperfectlab.com'
-InstallDns:$true -LogPath 'C:\Windows\NTDS' -NoGlobalCatalog:$false -SiteName 'ImperfectNet' -SysvolPath 'C:\Windows\SYSVOL'
-NoRebootOnCompletion:$true -Force:$true -Verbose
@techbunny
techbunny / ImpLab_EarlySnippets
Created Dec 23, 2014
The Imperfect Lab: Early Post Snippets
View ImpLab_EarlySnippets
# Setting Keys for Azure VNET-to-VNET Connectivity
Set-AzureVNetGatewayKey -VNetName YourVNETName -LocalNetworkSiteName TheOppositeLocalNet -SharedKey abc123xyz
Set-AzureVNetGatewayKey -TheOtherVNetName YourVNETName -LocalNetworkSiteName TheOtherLocalNet -SharedKey abc123xyz
# Connect Remotely to VMs
$uri = Get-AzureWinRMUri -ServiceName $cloudServiceName -Name $Name
$cred = Get-Credential
Enter-PSSession -ConnectionUri $uri -Credential $cred
# Install Active Directory
@techbunny
techbunny / ImpLab_ManageTweaks
Created Dec 26, 2014
The Imperfect Lab: VM Manageablity Tweeks
View ImpLab_ManageTweaks
# To add VMs to Availability Sets
Get-AzureVM -ServiceName "<cloudservicename>" -Name "<servername>"
| Set-AzureAvailabilitySet -AvailabilitySetName "<AVSetName>"
| Update-AzureVM
# To availability sets that exist in your subscription
(Get-AzureService).servicename
| foreach {Get-AzureVM -ServiceName $_ }
| select name,AvailabilitySetName
View gist:4f9fa5258c807288f918
SOURCE Storage Account
----------------------
Access Key -
URL -
DESTINATION Storage Account
----------------------------
Access Key -
URL -
@techbunny
techbunny / ITCamp_Labs1-3
Last active Jun 18, 2017
Azure IT Camp Snippets
View ITCamp_Labs1-3
#-----------------------------------------------
# Lab 1: Building the Foundation
# Section: Connect to Azure with Powershell
#----------------------------------------------
Add-AzureAccount # This prompts you for your Azure Subscription Account Credentials, and logs you in.
Get-AzureSubscription | FT SubscriptionName # Get the list of Subscriptions your has access to.
Get-AzureLocation | FT DisplayName # Show the datacenter region location names. (You will use the one you chose for your network location.)
View clientwebapp.json
{
"apiVersion": "v1",
"kind": "Pod",
"metadata": {
"name": "clientwebapp",
"labels": {
"name": "clientwebapp"
}
},
"spec": {
@techbunny
techbunny / windowsnodejs.json
Last active Jul 14, 2017
Windows Container with Node.js
View windowsnodejs.json
{
"apiVersion": "v1",
"kind": "Pod",
"metadata": {
"name": "node-con-cra",
"labels": {
"name": "node-con-cra"
}
},
"spec": {
View rhm.json
{
"apiVersion": "v1",
"kind": "Pod",
"metadata": {
"name": "receivehubmessages",
"labels": {
"name": "receivehubmessages"
}
},
"spec": {
You can’t perform that action at this time.