Skip to content

Instantly share code, notes, and snippets.

m-radzikowski /
Last active March 19, 2023 20:59
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...]
j33ty / print-memory.go
Created May 22, 2019 20:54
Go print current memory
View print-memory.go
package main
import (
func main() {
// Print our starting memory usage (should be around 0mb)
miguelmota / cmd.go
Created October 7, 2018 21:29
Golang cobra example
View cmd.go
package cmd
import (
server ""
View golang convert interface to map
package main
import (
func main() {
b := []byte(`{"key":"value"}`)
Ryanb58 /
Last active March 24, 2023 14:39
How to install telnet into a alpine docker container. This is useful when using the celery remote debugger in a dev environment.
>>> docker exec -it CONTAINERID /bin/sh
/app # telnet
/bin/sh: telnet: not found

/app # apk update
v3.7.0-243-gf26e75a186 []
v3.7.0-229-g087f28e29d []
matthewpalmer / pod.yaml
Last active February 16, 2023 18:32
Example Kubernetes pod for the multi-container sidecar design pattern
View pod.yaml
# Example YAML configuration for the sidecar pattern.
# It defines a main application container which writes
# the current date to a log file every five seconds.
# The sidecar container is nginx serving that log file.
# (In practice, your sidecar is likely to be a log collection
# container that uploads to external storage.)
# To run:
h4cc / Makefile
Last active July 11, 2021 10:32
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:
drandarov-io / D.R.Y. - Reuse Gradle repository definition
Last active May 28, 2019 18:26
D.R.Y. - Reuse Gradle repository definition
View D.R.Y. - Reuse Gradle repository definition
This works however:
#### build.gradle
buildscript {
// Repository Configuration
ext.repos = {
maven { url '' }
romaninsh / lambda-vpc-internet-access-cloudformation.yml
Last active December 22, 2021 00:26
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
whereisaaron /
Last active January 3, 2023 17:14
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