Skip to content

Instantly share code, notes, and snippets.

@JF6
JF6 / createVPN.sh
Last active July 17, 2017 20:53
Creare a S2S VPN on Linux Mint
#RFC 3947 ==> https://datatracker.ietf.org/doc/rfc3947/?include_text=1
echo -n Please type the Shared Key:
read sharedKey
echo $sharedKey
activeInterface=$(ip route get 8.8.8.8 | awk '{print $5; exit}')
activeSubnet=$(ip route | grep $activeInterface | grep kernel | awk '{print $1; exit}')
leftip=$(ip route | grep $activeInterface | grep kernel | awk '{print $9; exit}')
@JF6
JF6 / gist:26d0acf6a529c2d6cb00938851154dfa
Last active July 11, 2017 14:55
Get IPAddress from an Azure Gateway (Mint / CLI 2.0)
az network public-ip list --resource-group GW4 | jq -r '.[].ipAddress' | sed /null/d
az network vnet-gateway list --resource-group GW4 | jq -r ".[].id
az network public-ip list --resource-group GW4 | jq 'if (.[].id=="/subscriptions/7638783c-a1ee-47d6-a06e-cba7ffd4d6bb/resourceGroups/GW4/providers/Microsoft.Network/publicIPAddresses/GW4-IP") then .[].ipAddress else null end'
#Get the IP Address from a AZR VPN Gateway
id=$(az network vnet-gateway list --resource-group GW4 | jq -r '.[].ipConfigurations[].publicIpAddress.id')
ip=$(az network public-ip list --resource-group GW4 | jq -r '.[] | select(.id=="'$id'") | .ipAddress')
sed -e "s/right=[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+/right=$ip/" ./ipsec.conf
@JF6
JF6 / MongoDB.ps1
Created March 24, 2017 14:00
DSC script for mongoDB installation - quick and dirty
#Adapted from https://gist.github.com/tugberkugurlu/11212976
#Used in ARM template deployment
configuration MongoDB {
#param (
# [string[]]$ComputerName = $env:ComputerName
#)
Import-DSCResource -ModuleName xDisk
Import-DSCResource -ModuleName cDisk