Skip to content

Instantly share code, notes, and snippets.

View scarolan's full-sized avatar
🤸‍♂️
In whatever position one is in...one must find balance. -BKS Iyengar

Sean Carolan scarolan

🤸‍♂️
In whatever position one is in...one must find balance. -BKS Iyengar
View GitHub Profile
#!/bin/sh
lolcat <<EOF
' ..
,xNX :WO:
.dXWWWX :WWWW.
.lKWWWWWWX :WWWW. :.
.lKWWWWWWWWk, :WWWW. OWKl.
0WWWWWWW0c :WWWW. OWWW0
0WWWWXo. ; :WWWW. OWWW0
0WWWW' ,kWX :WWWW. OWWW0
@scarolan
scarolan / network_troubleshooting.md
Last active August 9, 2019 17:42
Useful network troubleshooting commands

Handy Network Troubleshooting Commands

Nmap

Nmap is an all-purpose network and port scanner. It can scan hundreds of hosts and ports quickly, across a variety of protocols and situations. Here are a few basic commands that you can use:

Check that ports 8200 and 8201 are listening on a host. The Pn flag tells nmap to skip the preliminary ping to see if the host is up.

nmap -p 8200,8201 10.0.1.10 -Pn
resource "azurerm_network_security_group" "catapp-sg" {
name = "${var.prefix}-sg"
location = "${var.location}"
resource_group_name = "${azurerm_resource_group.myresourcegroup.name}"
security_rule {
name = "HTTP"
priority = 100
direction = "Inbound"
access = "Allow"
@scarolan
scarolan / setup.ps1
Created January 5, 2019 15:55
Does some setup and housekeeping on the workstation.
# Post-install steps for HashiCorp training workstation
git config --global core.autocrlf false
install-module posh-git -AllowClobber
variable "key_name" {
default = "terraformdemo"
}
resource "tls_private_key" "example" {
algorithm = "RSA"
rsa_bits = 4096
}
resource "aws_key_pair" "generated_key" {
provisioner "remote-exec" {
inline = ["echo 'Hello World'"]
connection {
type = "ssh"
user = "ec2-user"
private_key = "${file("${var.private_key_path}")}"
}
}
provider "aws" {
assume_role {
role_arn = "arn:aws:iam::582482956935:role/build-automation"
session_name = "Automation"
}
region = "us-west-2"
}
@scarolan
scarolan / main.tf
Last active November 14, 2018 17:42
challenge 04 answer
provider "azurerm" {
version = "= 1.4"
}
terraform {
required_version = ">= 0.11.7"
}
variable "name" {
default = "seanc03"
@scarolan
scarolan / install_vault_consul.sh
Created October 18, 2018 19:37
Installs HashiCorp Vault with Consul as Storage backend
#!/bin/sh
#
# Once you have stood up your three Vault instances, run the script on each
# machine with your three IP addresses as script arguments. Put the IP address
# of the local machine *first* in the list.
#
# Once the script is complete you should be able to start Vault and Consul:
#
# systemctl start consul
# systemctl start vault
function vencrypt() {
INPUTFILE=$1
vault write -format=json transit/encrypt/my-key plaintext=@<(base64 -i $INPUTFILE) | jq -r '.data|.ciphertext'
}
function vdecrypt() {
INPUTFILE=$1
vault write -format=json transit/decrypt/my-key ciphertext=$(cat $INPUTFILE ) | jq -r '.data|.plaintext' | base64 -i -d
}