Skip to content

Instantly share code, notes, and snippets.

View jeffbrl's full-sized avatar

Jeff Loughridge jeffbrl

View GitHub Profile
@jeffbrl
jeffbrl / simple_test_v2.robot
Last active October 26, 2021 15:40
Simple test of a calculator function with the robot framework - v2
*** Settings ***
Documentation Check arithmetic operations
Resource ${EXEC_DIR}/resources/keywords.txt
# currently only prints to output.xml
Suite Setup math.setup
Suite Teardown math.teardown
*** Variables ***
@jeffbrl
jeffbrl / user-data.sh
Created September 28, 2021 19:42
User data for Ubuntu 20.04 Apache2 Basic HTTP Example
#!/bin/bash -xe
apt-get -y update
apt-get install -y apache2
echo `hostname` > /var/www/html/index.html
echo '<br><br>' >> /var/www/html/index.html
# create ~ 12K of random text
base64 /dev/urandom | head -c 10000 >> /var/www/html/index.html
@jeffbrl
jeffbrl / ansible_user.conf.j2
Created December 30, 2016 23:45
Ansible playbook to create ansible user on junos device with private key authentication
system {
login {
user ansible {
class super-user;
authentication {
ssh-rsa "{{ ansible_public_key }}";
}
}
}
}
@jeffbrl
jeffbrl / terraform_s3_backend.tf
Created December 22, 2020 16:49
Terraform template to create S3 backend with DynamoDB lock
# Adapted from tips at https://blog.gruntwork.io/how-to-manage-terraform-state-28f5697e68fa
provider "aws" {
region = "us-east-1"
}
resource "aws_s3_bucket" "terraform_state" {
bucket = "uniqueBuckeName"
# Enable versioning so we can see the full revision history of our
# state files
@jeffbrl
jeffbrl / keybase.md
Created November 1, 2020 14:24
keybase.md

Keybase proof

I hereby claim:

  • I am jeffbrl on github.
  • I am jbl2 (https://keybase.io/jbl2) on keybase.
  • I have a public key ASDzY1kXVhRrICyL8LKOAHX_wAHqxYWVL3MzY0_OiDZ24go

To claim this, I am signing this object:

@jeffbrl
jeffbrl / vpc-ingress-routing.yaml
Created April 7, 2020 21:37
VPC Ingress Routing CloudFormation
AWSTemplateFormatVersion: 2010-09-09
Description: >-
AWS CloudFormation template to deploy a VPC with VPC Ingress Routing
Parameters:
KeyName:
Description: Name of an existing EC2 KeyPair to enable SSH access to the instances
Type: String
AmazonLinuxAMI:
Type: "AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>"
Default: "/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2"
@jeffbrl
jeffbrl / lambda_internet.py
Created April 7, 2020 00:32
Lambda function to check for Internet access
import logging
import os
import socket
logger = logging.getLogger()
logger.setLevel(logging.INFO)
# use static IP of public DNS (e.g., 8.8.8.8)
IP = os.environ['ip']
@jeffbrl
jeffbrl / vpc-full-mesh-tgw.tf
Last active January 16, 2020 00:58
Terraform templates for Regional Full VPC Mesh with the AWS Transit Gateway
module "vpc-one" {
source = "terraform-aws-modules/vpc/aws"
version = "1.53.0"
name = "terraform-vpc-one"
cidr = "10.1.0.0/16"
azs = ["ap-northeast-1a", "ap-northeast-1c"]
@jeffbrl
jeffbrl / find_cisco_amis.sh
Created October 25, 2019 18:50
Finding Cisco CSR AMIs for AWS EC2
aws ec2 describe-images --filters "Name=name,Values=cisco-CSR*" \
--query 'Images[].[ImageId,Name]' --output text --region us-west-1 | grep -m5 "ami-"
@jeffbrl
jeffbrl / prepare_droplet.sh
Created July 22, 2014 00:02
One time configuration of DigitalOcean droplet for IPv6 connectivity in docker containers
#!/bin/bash
#
# Jeff Loughridge
# July 2014
# jeffl at brooksconsulting-llc.com
# enable IPv6 forwarding and ND proxying
echo net.ipv6.conf.all.proxy_ndp=1 >> /etc/sysctl.conf
echo net.ipv6.conf.all.forwarding=1 >> /etc/sysctl.conf