This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var observer = new IntersectionObserver(function (entries) { | |
// isIntersecting is true when element and viewport are overlapping | |
// isIntersecting is false when element and viewport don't overlap | |
if (entries[0].isIntersecting === true) | |
console.log(entries[0].target.id); | |
}, { threshold: [0] }); | |
// Observe all H2 headings and get their id printed into the console whenever they are in focus | |
document.querySelectorAll("h2").forEach(function (item) { | |
observer.observe(document.querySelector("#" + item.id)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# very basic but you can see the gist of it: | |
aws cloudformation list-types --type RESOURCE --visibility PUBLIC | \ | |
jq '.TypeSummaries[].TypeName' | \ | |
cut -d\" -f2 | \ | |
while read a | |
do | |
aws cloudcontrol list-resources --type-name $a 2>/dev/null| \ | |
jq '.ResourceDescriptions[].Identifier' | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This sample code triggers the problem if run against a large directory structure (+50K objects) | |
// I added some instrumention to check how many connections were being resued versus created new | |
// Please change the table name in line 283 and path in line 286 | |
package main | |
import ( | |
"context" | |
"crypto/md5" | |
"strings" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ldd /var/task/node_modules/puppeteer/.local-chromium/linux-869685/chrome-linux/chrome | grep not | \ | |
cut -d= -f1 | while read a | |
do | |
yum provides $a | head -2 | tail -1 | cut -d\ -f1 | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:18.04 | |
ARG openssl_arch=linux-x86_64 | |
ENV RUSTUP_HOME=/usr/local/rustup \ | |
CARGO_HOME=/usr/local/cargo \ | |
PATH=/usr/local/cargo/bin:$PATH \ | |
DEBIAN_FRONTEND=noninteractive | |
RUN apt-get update \ | |
&& apt-get -y install curl wget lsb-release wget software-properties-common \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Config file to add a Prometheus receiver - not fully as I can't make it scrape another process yet | |
extensions: | |
health_check: | |
receivers: | |
prometheus: | |
config: | |
scrape_configs: | |
- job_name: "otel-collector" | |
scrape_interval: 5s |
For general guidance follow this great write up: https://www.atlassian.com/git/tutorials/dotfiles
git init --bare $HOME/.cfg
alias dotfiles='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import boto3 | |
import argparse | |
class Args(object): | |
import argparse | |
parser = argparse.ArgumentParser( | |
description='Allows user to execute a local script using SSM Run Commands') |