Skip to content

Instantly share code, notes, and snippets.

View tamsky's full-sized avatar

Marc Tamsky tamsky

View GitHub Profile
FROM ubuntu
RUN apt-get update && apt-get install -y openssh-client
RUN ssh-add -l 2>&1 | tee -a /tmp/ssh-agent.out || true
RUN cat /tmp/ssh-agent.out
@tamsky
tamsky / apt-rdepends-tree
Created September 30, 2019 22:24 — forked from damphat/apt-rdepends-tree
debian dependency tree
#! /bin/bash
# Description: show dependency tree
# Author: damphat
if [ $# != 1 ]; then
echo 'Usage: apt-rdepends-tree <package>'
echo 'Required packages: apt-rdepends'
exit 1
fi
1) ==== Autossh using systemd ====
Example from
https://gist.github.com/drmalex07/c0f9304deea566842490
2) =============
Install autossh
SRE and DevOps share similar foundational principles;
SRE could be seen as a refined implementation of DevOps,
although SRE existed before the coinage of the term DevOps.
SRE contains ownership, oversight and responsibilities that differ from DevOps.
@tamsky
tamsky / gist:fec898d753d6eb84713ac1683867a3bd
Last active April 23, 2019 22:24
an HA design for prometheus pushgateway
pushgateway clients (eg: lambda functions) push to api-gateway.
api gateway invokes a lambda "receiver" function which
- reads pushgateway event, and writes that event data to SNS
(decoupled event queue is implemented via SNS)
a lambda reader that triggers based on SNS queue depth
- writes SNS events to dynamodb (TTL optional)
@tamsky
tamsky / gist:3014acc474448121e5974d3a6f19877b
Last active April 15, 2019 20:36
# docker run -it --rm --entrypoint bash amazon/aws-codebuild-local
# yum makecache fast ; yum install -y less file binutils
Apr 15 20:24:14 Updated: file-libs-5.34-3.37.amzn1.x86_64
Apr 15 20:24:14 Installed: file-5.34-3.37.amzn1.x86_64
Apr 15 20:26:33 Installed: binutils-2.25.1-31.base.66.amzn1.x86_64
@tamsky
tamsky / gist:851a3ea3e153d1d6421b70320587c7c3
Created April 15, 2019 20:29
# docker run -it --rm --entrypoint bash amazon/aws-codebuild-local
Apr 15 20:24:14 Updated: file-libs-5.34-3.37.amzn1.x86_64
Apr 15 20:24:14 Installed: file-5.34-3.37.amzn1.x86_64
Apr 15 20:26:33 Installed: binutils-2.25.1-31.base.66.amzn1.x86_64
@tamsky
tamsky / example.sh
Last active April 13, 2019 07:37
bash hint for executing $0
( cd ${dest_path} && $0 )
vs
( cd ${dest_path} && $(realpath "${BASH_SOURCE[0]}") )
@tamsky
tamsky / terraform.tf
Created April 11, 2019 22:17
boilerplate
# Set the backend
terraform {
backend "s3" {
encrypt = true
}
}
# Get most recent AMI_ID for base
data "aws_ami" "base_ami" {
most_recent = true