Skip to content

Instantly share code, notes, and snippets.

View lmasiero's full-sized avatar

Lucas Masiero lmasiero

View GitHub Profile
@lmasiero
lmasiero / auto-ovpn.sh
Last active October 17, 2022 21:14 — forked from thanhtunguet/auto-ovpn.sh
Auto reconnect OpenVPN
#!/bin/bash
function getStatus () {
ifconfig | grep $1 && return 1
return 0
}
getStatus tun0
if [[ $? == 0 ]];
then
# Source: https://gist.github.com/f0d35ef2260208b15ddd390007fdd552
######################################################################
# Production-Ready Kubernetes Clusters Using Crossplane Compositions #
# https://youtu.be/uMC2QQfMctg #
######################################################################
# Referenced videos:
# - Crossplane - GitOps-based Infrastructure as Code through Kubernetes API: https://youtu.be/n8KjVmuHm7A
# - How To Shift Left Infrastructure Management Using Crossplane Composites: https://youtu.be/AtbS1u2j7po
@lmasiero
lmasiero / VPC Excerpt
Created January 3, 2022 13:09 — forked from ian-hancock/VPC Excerpt
VPC Excerpt
resource "aws_default_security_group" "this" {
count = var.create_vpc && var.manage_default_security_group ? 1 : 0
vpc_id = aws_vpc.this[0].id
dynamic "ingress" {
for_each = var.default_security_group_ingress
content {
self = lookup(ingress.value, "self", null)
cidr_blocks = compact(split(",", lookup(ingress.value, "cidr_blocks", "")))
@lmasiero
lmasiero / aws.md
Created December 2, 2021 15:57 — forked from colinvh/aws.md
AWS Region Names

Alternative naming schemes for AWS regions

Purpose

The intent is to define terse, standards-supported names for AWS regions.

Schemes

@lmasiero
lmasiero / delete_all_object_versions.sh
Created August 13, 2020 13:02 — forked from weavenet/delete_all_object_versions.sh
Delete all versions of all files in s3 versioned bucket using AWS CLI and jq.
#!/bin/bash
bucket=$1
set -e
echo "Removing all versions from $bucket"
versions=`aws s3api list-object-versions --bucket $bucket |jq '.Versions'`
markers=`aws s3api list-object-versions --bucket $bucket |jq '.DeleteMarkers'`
@lmasiero
lmasiero / rPi3-ap-setup.sh
Last active December 2, 2021 15:58 — forked from Lewiscowles1986/rPi3-ap-setup.sh
Raspberry Pi 3 access-point-setup
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
if [[ $# -lt 1 ]];
then echo "You need to pass a password!"