This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os/exec" | |
) | |
func main() { | |
// NOTE: mycmd will contain a byte array, not string output | |
mycmd, _ := exec.Command("ls", "-lGa", "/").Output() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "James", | |
"hash_512": "02c56351888fa73ff825ffd65526b264ebefe7916fa5d8d5c58e766bfdd1de8e85b68bf12599b9d21eca6683d4abfa8616acfa6834e7c478e394374a7b015898", | |
"hash_256": "9621e7b29ee7509cb6140e96245ab956cdc3a9d474062ec4cd2af334cc179935" | |
}, | |
{ | |
"name": "Mary", | |
"hash_512": "1cfdb0f78ae767f055f1bc2bd7bb2f913e19419710c6969766ea2c43f1f56061403bb95853df6ae3fd3c263b631a8f0337a0977d7cc0464664d3b060b21f64c9", | |
"hash_256": "cdb285a9a3c1ab32647e27c94be4e525cbe8415079042bb0f8fb3ab1c88afef3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Call this script: | |
foreach ($Region in (Get-AWSRegion).Region) { | |
Set-DefaultAWSRegion -Region $Region | |
iex (iwr https://gist.githubusercontent.com/pcgeek86/42764099021c0b1baa7f32d48afef4c2/raw).Content | |
} | |
#> | |
Get-LMFunctionList | Remove-LMFunction -Force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Author: Trevor Sullivan | |
Date: 2015-03-29 | |
Description: Microsoft Azure Disk objects offer the full URL to the cloud-based VHD | |
however, the Storage Account name is not exposed independently. We can | |
use PowerShell's Add-Member command to parse the URL and offer up the | |
Storage Account as its own property on each Disk object. | |
#> | |
Select-AzureSubscription -SubscriptionName 'Visual Studio Ultimate with MSDN'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Wait-AzureVMDscConfiguration { | |
<# | |
.Synopsis | |
Waits for a DSC configuration to complete on an Azure Virtual Machine. | |
.Parameter ServiceName | |
The name of the Azure Cloud Service containing the Virtual Machine. | |
.Parameter Name | |
The name of the Azure Virtual Machine inside the Cloud Service container. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use these commands to install MySQL Shell utility into a container running | |
# the official MySQL distribution via Docker Hub. | |
# | |
# docker pull mysql:8.0.26 | |
# export CONTAINER_ID=$(docker run --detach --env MYSQL_ROOT_PASSWORD=12345 mysql:8.0.26) | |
# docker exec --interactive --tty $CONTAINER_ID bash | |
apt update && apt-get install httpie --yes | |
# Use the Debian or Ubuntu package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Trevor Sullivan <trevor@trevorsullivan.net> | |
export VERSION='v9.12.0' | |
export FILENAME="balena-cli-$VERSION-linux-x64" | |
export URL="https://github.com/balena-io/balena-cli/releases/download/$VERSION/$FILENAME.zip" | |
sudo apt update | |
sudo apt install httpie unzip --yes | |
cd $HOME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
- Creates an Amazon Web Services (AWS) Virtual Private Cloud (VPC) in the us-west-2 (Oregon) region. | |
- VPC contains two public subnets and two private subnets. | |
- NAT Gateway is created to handle outbount Internet traffic from private subnets. | |
- Internet Gateway is created to handle in/outbound Internet traffic for public subnets. | |
- iex (iwr https://gist.githubusercontent.com/pcgeek86/523b3b7c80eb25bd7f993354509268d0/raw).Content | |
#> | |
function Add-EC2NameTag { | |
<# | |
.Synopsis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Author: Trevor Sullivan <trevor@trevorsullivan.net> | |
# Install pip3 package manager for Python 3.x | |
sudo apt install python3-pip --yes | |
# Upgrade pip3 | |
sudo -H pip3 install --upgrade pip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Object = [PSCustomObject]@{ | |
FirstName = 'Trevor' | |
LastName = 'Sullivan' | |
} | |
$Object | |
$Object.PSObject.TypeNames.Add('Person') | |
$FormatData = @' | |
<?xml version="1.0" encoding="utf-8" ?> |