Skip to content

Instantly share code, notes, and snippets.

m-radzikowski /
Last active Dec 1, 2021
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...]
miguelmota / cmd.go
Created Oct 7, 2018
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 Dec 1, 2021
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 Sep 13, 2021
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 Jul 11, 2021
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
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 Apr 4, 2021
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 Aug 23, 2021
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
peterforgacs /
Last active Oct 31, 2021
Running Windows 10 on AWS EC2

Running Windows 10 on AWS EC2

Downloading the image

Download the windows image you want.

AWS vmimport supported versions: Microsoft Windows 10 (Professional, Enterprise, Education) (US English) (64-bit only)

So Home wont work.