Skip to content

Instantly share code, notes, and snippets.

View csprabala's full-sized avatar

Chandrasekhar Prabala csprabala

  • United States
View GitHub Profile
#!/bin/bash
HOSTNAME="*.internal.cloudapp.net"
LOCATION=${1?Error: no location provided}
PASSPHRASE=${2?Error: no passphrase provided}
HOSTIP=${3?Error: no host ip provided}
openssl genrsa -aes256 -passout pass:$PASSPHRASE -out ca-key.pem 4096
openssl req -new -x509 -days 365 -key ca-key.pem -sha256 -out ca.pem -passin pass:$PASSPHRASE -subj "/L=$LOCATION/CN=$HOSTNAME"
openssl genrsa -out server-key.pem 4096
@csprabala
csprabala / Script1.ps1
Created March 19, 2017 15:55
Run one ps script from another in the same folder
& ((Split-Path $MyInvocation.MyCommand.Path) + "\Script2.ps1") $subscription_id $rg_name $rg_location $template_file_path $parameters_file_path
@csprabala
csprabala / yaml_to_config.py
Last active February 28, 2017 16:23
Convert yaml configuration data to python object
# pip install pyyaml
from yaml import load, dump
yaml_file = open('configuration.yaml', 'r')
data = load(yaml_file)
configuration = namedtuple('struct', data.keys())(*data.values())
yaml_file.close()