Skip to content

Instantly share code, notes, and snippets.

030 /
Created Mar 7, 2022 — forked from tennix/
Convert Grafana dashboard json to jsonnet
#!/usr/bin/env python
import json
from jinja2 import Template
# git clone
# cd tidb-docker-compose
# git clone -b table
# python > pd.jsonnet
# jsonnet -J grafonnet-lib pd.jsonnet > config/dashboards/generated-pd.json
with open('config/dashboards/pd.json', 'r') as f:
data = json.load(f)
030 / print-memory.go
Created Feb 7, 2022 — forked from j33ty/print-memory.go
Go print current memory
View print-memory.go
package main
import (
func main() {
// Print our starting memory usage (should be around 0mb)
030 /
Created Apr 13, 2021 — forked from m-radzikowski/
Minimal safe Bash script template - see the article with full description:
#!/usr/bin/env bash
set -Eeuo pipefail
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
030 /
Created Nov 6, 2020 — forked from whereisaaron/
Extract a crt file (PEM), key file, and chain bundle from a PFX file, prompts for password or use PFXPASSWORD environment variable
# Extract the key, certficiate, and chain in PEM format from a PFX format file
# Must supply the input pfx file
if [ "${PFX_PATH}" == "" ]; then
echo "Must supply pfx file path"
exit 1
030 / lambda-vpc-internet-access-cloudformation.yml
Created Jun 25, 2019 — forked from romaninsh/lambda-vpc-internet-access-cloudformation.yml
CloudFormation template implementing Private network which can be used by Serverless to deploy Lambda into VPCs an maintaining internet access
View lambda-vpc-internet-access-cloudformation.yml
# Add the following to your existing VPC CF stack
# create 2 subnets, lambdas like to be in multiple subnets
Type: AWS::EC2::Subnet
VpcId: !Ref VPC
AvailabilityZone: !Select [ 0, !GetAZs ]
CidrBlock: !Ref Private1CIDR

How to setup AWS lambda function to talk to the internet and VPC

I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.

So it might be really unintuitive at first but lambda functions have three states.

  1. No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
  2. VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
  3. VPC with NAT, The best of both worlds, AWS services and web.
030 / Makefile
Created May 17, 2019 — forked from h4cc/Makefile
Ubuntu 18.04 Bionic Beaver - Basic packages i usually install
View Makefile
# Ubuntu 18.04 (Bionic Beaver)
# Basic packages i usually install.
# Author: Julius Beckmann <>
# Upgraded Script from 17.04:
# Upgraded Script from 16.04: