Skip to content

Instantly share code, notes, and snippets.

View tomislacker's full-sized avatar

Ben Tomasik tomislacker

View GitHub Profile
AWSTemplateFormatVersion: "2010-09-09"
Description: Subnet IP Monitor
Parameters:
Name:
Type: String
Default: "Subnet-IP-Monitor"
Tag:
Type: String
Description: Subnet Tag to filter
@reinvanoyen
reinvanoyen / terminal-prompt-git-branch-zsh.md
Last active April 30, 2024 21:16
Add Git Branch Name to Terminal Prompt (MacOS zsh)

Add Git Branch Name to Terminal Prompt (zsh)

Updated for MacOS with zsh

  • Catalina
  • Big Sur
  • Monterey
  • Ventura
  • Sonoma

screenshot

@ranman
ranman / update_lambdas_lol.py
Last active November 18, 2019 22:40
enable python3.8 in all region
import boto3
session = boto3.Session(profile_name='default')
regions = session.get_available_regions(service_name='lambda')
for region in regions:
print(region)
aws_lambda = session.client('lambda', region_name=region)
try:
paginator = aws_lambda.get_paginator('list_functions').paginate()
for page in paginator:
for function in page['Functions']:
@fire-eggs
fire-eggs / betterbookmarks.py
Last active February 26, 2024 04:28
Python 3 - takes the Chrome Bookmarks file, and creates a better "Export Bookmarks" HTML page.
# Massages a Chrome bookmarks file into an HTML file.
#
# Features:
# - Folders are ordered alphabetically
# - Bookmarks are ordered alphabetically (by description)
# - Bookmarks are shown first, followed by folders
# - Folders can be expanded or collapsed. Initially collapsed.
# - Folders are indented nicely
# - A button is provided to expand/collapse all folders
#
@lizthegrey
lizthegrey / attributes.rb
Last active February 24, 2024 14:11
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@dabit3
dabit3 / Router.vue
Last active December 4, 2023 21:36
Using AWS Amplify Vue with routing
const router = new Router({
routes: [
{
path: '/',
name: 'Home',
component: Home,
meta: { requiresAuth: true}
},
{
path: '/notes',
@troyfontaine
troyfontaine / README.md
Last active October 15, 2023 09:58
Ubiquiti USG config.gateway.json Syntax

Ubiquiti USG Advanced Configuration

Overview

Integrated DNS Overview

When using a USG with Ubiquiti's Unifi Controller software (version 5.6 and earlier), the functionality of integrating the hostnames of clients (when they request a DHCP lease) into local DNS does not appear to work as you would find with Consumer grade routers. To work around this limitation, we can add static host mappings to a configuration file that will be provisioned to the USG when either a configuration change is made or we force provisioning to the USG itself.

Non-GUI Supported Dynamic DNS Providers

I've added in the necessary syntax for adding Cloudflare DDNS to the USG for VPN/Services setup courtesy of this post by britannic on the Ubiquiti Forums.

Configuration File

@earljon
earljon / aws_route53_delete.sh
Created August 15, 2017 08:58
Delete a Route 53 Record Set in AWS CLI
#!/bin/sh
# NOTE:
# Make sure that the value of Name, Type, TTL are the same with your DNS Record Set
HOSTED_ZONE_ID=<YOUR_HOSTED_ZONE_ID>
RESOURCE_VALUE=<YOUR_DNS_RESOURCE_VALUE-ex:IP or dns>
DNS_NAME=<YOUR_DNS_NAME-ex: subdomain.domain.com>
RECORD_TYPE=<DNS_RECORD_TYPE-ex: A, CNAME>
TTL=<TTL_VALUE>
@speshak
speshak / Output
Last active May 9, 2017 15:45
Convert CIDR networks into string glob (like what ssh_config expects)
10.255.0.0/11
['10.224.*',
'10.225.*',
'10.226.*',
'10.227.*',
'10.228.*',
'10.229.*',
'10.230.*',
'10.231.*',
'10.232.*',
@mojodna
mojodna / 0_register_planet.sql
Last active May 18, 2022 17:51
Sample OSM Athena queries
--
-- This will register the "planet" table within your AWS account
--
CREATE EXTERNAL TABLE planet (
id BIGINT,
type STRING,
tags MAP<STRING,STRING>,
lat DECIMAL(9,7),
lon DECIMAL(10,7),
nds ARRAY<STRUCT<ref: BIGINT>>,