Skip to content

Instantly share code, notes, and snippets.

View donhenton's full-sized avatar

Don Henton donhenton

View GitHub Profile
@crypticmind
crypticmind / README.md
Last active November 15, 2024 16:46
Setup lambda + API Gateway using localstack
@benfogel
benfogel / install-docker-compose.sh
Created April 26, 2018 03:55
Installing docker-compose on Amazon Linux AMI
sudo yum update
sudo yum install -y docker
sudo usermod -a -G docker ec2-user
sudo curl -L https://github.com/docker/compose/releases/download/1.21.0/docker-compose-`uname -s`-`uname -m` | sudo tee /usr/local/bin/docker-compose > /dev/null
sudo chmod +x /usr/local/bin/docker-compose
sudo service docker start
sudo chkconfig docker on
@li0nel
li0nel / ecr.yaml
Last active March 26, 2023 05:47
CloudFormation template for ECR
# One Docker registry that we will use both for the Laravel application
# image and our Nginx image.
# Note that if you give a name to the repository, CloudFormation can't
# update it without a full replacement.
ECR:
Type: AWS::ECR::Repository
Properties:
# RepositoryName: !Sub ${AWS::StackName}-nginx
RepositoryPolicyText:
Version: "2012-10-17"
@ryu1kn
ryu1kn / Makefile
Last active March 19, 2023 13:02
Encrypt/decrypt with AWS KMS using AWS cli
# How to encrypt/decrypt your text/blob secret with AWS KMS with AWS cli
KEY_ID=alias/my-key
SECRET_BLOB_PATH=fileb://my-secret-blob
SECRET_TEXT="my secret text"
ENCRYPTED_SECRET_AS_BLOB=encrypted_secret_blob
DECRYPTED_SECRET_AS_BLOB=decrypted_secret_blob # Result of decrypt-blob target
encrypt-text:
@wesbos
wesbos / async-await.js
Created February 22, 2017 14:02
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}
@haxpor
haxpor / blender_cube_creation.py
Created January 15, 2017 17:38
Blender Python script to create a new cube, rename it along with set its to new location
import bpy
def strVector3( v3 ):
return str(v3.x) + "," + str(v3.y) + "," + str(v3.z)
# create a new cube
bpy.ops.mesh.primitive_cube_add()
# newly created cube will be automatically selected
cube = bpy.context.selected_objects[0]
@mikoim
mikoim / README.md
Last active November 25, 2024 14:00
[Updated! Aug 14 2020] YouTube recommended encoding settings on ffmpeg (+ libx264)

Parameters

Container: MP4

Parameter YouTube recommends setting
-movflags faststart moov atom at the front of the file (Fast Start)

Video codec: H.264

@thornbill
thornbill / .gitlab-ci.yml
Created November 22, 2016 21:29
Example Node GitLab CI Yamlfile
# Official framework image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/node/tags/
image: node:6
before_script:
- npm install
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
@kekru
kekru / Docker connect to remote server.md
Last active January 1, 2025 10:31
Connect to another host with your docker client, without modifying your local Docker installation

Run commands on remote Docker host

This is how to connect to another host with your docker client, without modifying your local Docker installation or when you don't have a local Docker installation.

Enable Docker Remote API

First be sure to enable the Docker Remote API on the remote host.

This can easily be done with a container.
For HTTP connection use jarkt/docker-remote-api.

#!/usr/bin/env bash
usage="Usage: $(basename "$0") region stack-name [aws-cli-opts]
where:
region - the AWS region
stack-name - the stack name
aws-cli-opts - extra options passed directly to create-stack/update-stack
"