Skip to content

Instantly share code, notes, and snippets.

@ssprasad100
ssprasad100 / cf_create_or_update.py
Created December 24, 2019 11:15 — forked from svrist/cf_create_or_update.py
Update or create a CloudFormation stack given a name and template + params'
'Update or create a stack given a name and template + params'
from __future__ import division, print_function, unicode_literals
from datetime import datetime
import logging
import json
import sys
import boto3
import botocore
@ssprasad100
ssprasad100 / start-mongo-replset.sh
Created November 5, 2019 06:37 — forked from leetreveil/start-mongo-replset.sh
Shell scripts to create a mongodb replica set and sharded cluster locally
#!/bin/bash
# shell script to create a simple mongodb replica set (tested on osx)
set -e
red=$(tput setaf 1)
green=$(tput setaf 2)
yellow=$(tput setaf 3)
default=$(tput sgr0)
@ssprasad100
ssprasad100 / REAME.md
Created June 25, 2019 10:46 — forked from romansklenar/REAME.md
How to set up your VPS with Chef Solo

How to set up your VPS with Chef Solo

1. What is it?

There are many different provisioning tools out there, the most popular of which are Chef and Puppet. Chef uses Ruby, Puppet uses a DSL (Domain Specific Language), there are others that use simple bash too, but today we're going to focus on Chef Solo.

2. Dependencies

To get Chef working properly on your local machine you need a few things.

Make sure you use Ruby 1.9.x and not Ruby 2.x as you will get errors with the json 1.6.1 gem on 2.x. Use rbenv or RVM to manage several different Rubies on the one machine.

## generate Certificate Signing Request (CSR) with certutil
$FedServiceName = "sts.clancampbell.id.au"
$RequestPolicy = @"
[Version]
Signature="`$Windows NT$"
[NewRequest]
Subject = "CN=$FedServiceName,OU=ICT,O=ClanCampbell,L=Brisbane,S=Queensland,C=AU"
Exportable = FALSE ; TRUE = Private key is exportable
KeyLength = 2048 ; Valid key sizes: 1024, 2048, 4096, 8192, 16384
KeySpec = 1 ; Key Exchange – Required for encryption
@ssprasad100
ssprasad100 / CloudFormation-PowerShell-Creds.ps1
Created May 10, 2019 08:43 — forked from naamancampbell/CloudFormation-PowerShell-Creds.ps1
Generates and distributes encrypted passwords for use with PowerShell scripts used in CloudFormation templates.
<#
.SYNOPSIS
Generates and distributes encrypted passwords for use with PowerShell scripts used in CloudFormation templates.
.DESCRIPTION
The CloudFormation-PowerShell-Creds script is designed to be run prior to running a CloudFormation stack
then called again from within the CloudFormation template. The purpose is to avoid the use of cleartext
passwords in CloudFormation templates/PowerShell scripts.
There are three main components of this script:
@ssprasad100
ssprasad100 / powershell-commands.ps1
Created May 10, 2019 08:42 — forked from naamancampbell/powershell-commands.ps1
aws-cloudformation-awsmad - Automating the setup of an Office 365-enabled AWS Directory Services Microsoft Active Directory - as per https://aws.amazon.com/blogs/security/how-to-enable-your-users-to-access-office-365-with-aws-microsoft-active-directory-credentials/
# ADMgmt
## install chocolatey
Set-ExecutionPolicy Bypass; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
## install firefox
choco install -y firefox
## install AD Tools
Import-Module ServerManager
Add-WindowsFeature RSAT-AD-Tools
## create testing accounts
New-ADOrganizationalUnit -Name "Groups" -Path "OU=CLANCAMPBELL,DC=clancampbell,DC=id,DC=au"