Skip to content

Instantly share code, notes, and snippets.

@gregjhogan
gregjhogan / boxstarter-dev-install
Last active August 29, 2015 14:05
Development Machine Boxstarter Script
# command to run: (if IE is not your default browser, open the URL below in IE)
# START http://boxstarter.org/package/nr/url?https://gist.github.com/active-low/2d9a126ccfdaa67bb291/raw/boxstarter-dev-install
# or if you install boxstarter first you can run:
# Install-BoxstarterPackage -PackageName https://gist.github.com/active-low/2d9a126ccfdaa67bb291/raw/boxstarter-dev-install
#$Boxstarter.RebootOk=$true # Allow reboots?
#$Boxstarter.NoPassword=$false # Is this a machine with no login password?
#$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot
Update-ExecutionPolicy Unrestricted
# command to run: (if IE is not your default browser, open the URL below in IE)
# START http://boxstarter.org/package/nr/url?https://gist.github.com/gregjhogan/4f4bd7e1d785be096fa4/raw/boxstarter-dev-local-iis-config
# or if you install boxstarter first you can run:
# Install-BoxstarterPackage -PackageName https://gist.github.com/gregjhogan/4f4bd7e1d785be096fa4/raw/boxstarter-dev-local-iis-config
Update-ExecutionPolicy Unrestricted
cinst DotNet4.6
cinst IIS-WebServerRole -source windowsfeatures
@gregjhogan
gregjhogan / info.aspx
Last active September 30, 2015 20:25
ASP.NET info page
<%@ Page Language="C#" AutoEventWireup="true" Trace="true" TraceMode="SortByCategory" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>ASP.NET Diagnostic Page</title>
</head>
<body>
<form id="form1" runat="server">
<h2>Environment Variables</h2>
<pre>
@gregjhogan
gregjhogan / osx-for-hackers.sh
Last active September 30, 2015 20:25
OSX config
# Copied from https://gist.github.com/brandonb927/3195465 (OSX for Hackers: Yosemite/Mavericks Edition)
# command to run:
# curl -s -L https://gist.github.com/active-low/4df489b9f61e89f04314/raw/osx-for-hackers.sh | bash -s
echo "osx-for-hackers"
###############################################################################
# General UI/UX
###############################################################################
@gregjhogan
gregjhogan / azure-vm-storage-pool.ps1
Last active September 30, 2015 20:25
Azure VM Storage Pool
# 1. add four or more virtual data disks (no caching) to a vm
# 2. run the following commands in the vm to turn them all into a single storage pool
New-StoragePool –FriendlyName StoragePool1 –StorageSubsystemFriendlyName "Storage Spaces*" –PhysicalDisks (Get-PhysicalDisk –CanPool $True)
$disks = Get-StoragePool –FriendlyName StoragePool1 -IsPrimordial $false | Get-PhysicalDisk
New-VirtualDisk -StoragePoolFriendlyName StoragePool1 –FriendlyName VirtualDisk1 -ResiliencySettingName Simple –NumberOfColumns $disks.Count –UseMaximumSize –Interleave 256KB
Get-VirtualDisk –FriendlyName VirtualDisk1 | Get-Disk | Initialize-Disk –Passthru | New-Partition –AssignDriveLetter –UseMaximumSize | Format-Volume –AllocationUnitSize 65536
# 3. in the future you can dynamically add capacity by adding additional disks (no idea how)
# command to run: (if IE is not your default browser, open the URL below in IE)
# START http://boxstarter.org/package/nr/url?https://gist.github.com/active-low/d2a2528019e35595255f/raw/boxstarter-dev-azure-vm
# or if you install boxstarter first you can run:
# Install-BoxstarterPackage -PackageName https://gist.github.com/active-low/d2a2528019e35595255f/raw/boxstarter-dev-azure-vm
Update-ExecutionPolicy Unrestricted
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
Enable-MicrosoftUpdate
Enable-RemoteDesktop
@gregjhogan
gregjhogan / azure-cli-storage
Last active August 29, 2015 14:22
Azure X-Platform CLI Examples
export HTTP_PROXY=[http://example.com:8080]
azure storage account connectionstring show [storage-account-name]
export AZURE_STORAGE_CONNECTION_STRING='[connection-string-from-previous-command]'
azure storage blob list --account-name [storage-account-name] --container [container-name]
@gregjhogan
gregjhogan / azure-ps-storage
Last active August 29, 2015 14:22
Azure Powershell Examples
[System.Net.WebRequest]::DefaultWebProxy = new-object System.Net.WebProxy("http://exmaple.com:8080")
Add-AzureAccount
Set-AzureSubscription -CurrentStorageAccountName '[storage-account-name]' -SubscriptionName '[subscription-name]'
Get-AzureStorageContainer
@gregjhogan
gregjhogan / jenkins-groovy-job-run
Created June 16, 2015 04:05
Jenkins Groovy Examples
def job = Jenkins.getInstance().getItem("build name")
def build = job.getBuildByNumber(12345)
@gregjhogan
gregjhogan / script.sh
Last active August 29, 2015 14:26
azure elasticsearch cluster
# azure vm list|grep LTS (to find latest ubuntu server image)
azure vm create es-cluster b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04_2-LTS-amd64-server-20150706-en-us-30GB --location "Central US" --vm-name es-node-0 --vm-size ExtraSmall --ssh 22 --userName <username>
ssh es-cluster.cloudapp.net
# install java8
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update