Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash -x
# set -x
export AWS_DEFAULT_REGION=us-east-1
lang=en
account_id=$(aws sts get-caller-identity | jq -r '.Account')
aws support describe-trusted-advisor-checks \
--language $lang \
@CoolHandDev
CoolHandDev / git-pushing-multiple.rst
Created April 16, 2019 23:07 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@CoolHandDev
CoolHandDev / AesUtil.js
Created December 29, 2018 01:44 — forked from AndiDittrich/AesUtil.js
Node.js - AES Encryption/Decryption with AES-256-GCM using random Initialization Vector + Salt
// AES Encryption/Decryption with AES-256-GCM using random Initialization Vector + Salt
// ----------------------------------------------------------------------------------------
// the encrypted datablock is base64 encoded for easy data exchange.
// if you have the option to store data binary save consider to remove the encoding to reduce storage size
// ----------------------------------------------------------------------------------------
// format of encrypted data - used by this example. not an official format
//
// +--------------------+-----------------------+----------------+----------------+
// | SALT | Initialization Vector | Auth Tag | Payload |
// | Used to derive key | AES GCM XOR Init | Data Integrity | Encrypted Data |
@CoolHandDev
CoolHandDev / Makefile
Created January 13, 2018 00:59 — forked from prwhite/Makefile
Add a help target to a Makefile that will allow all targets to be self documenting
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Everything below is an example
target00: ## This message will show up when typing 'make help'
@echo does nothing
@CoolHandDev
CoolHandDev / graceful.go
Created January 10, 2018 00:50 — forked from peterhellberg/graceful.go
*http.Server in Go 1.8 supports graceful shutdown. This is a small example.
package main
import (
"context"
"log"
"net/http"
"os"
"os/signal"
"time"
)
@CoolHandDev
CoolHandDev / cmd-to-websocket.go
Created November 11, 2017 22:54 — forked from rochacon/cmd-to-websocket.go
Stream a command stderr and stdout throught websockets
package main
import (
"bufio"
"fmt"
"github.com/gorilla/websocket"
"io"
"log"
"net/http"
"os/exec"
@CoolHandDev
CoolHandDev / jenikns_ci_on_osx.md
Created January 8, 2017 22:39 — forked from ostinelli/jenkins_ci_on_osx.md
Setup Jenkins CI on OSX.

Jenkins CI on OSX

Instructions on how to setup a secured Jenkins CI on a Mac.

Download & Install dependencies

All of these operations are done with your admin user.

Developer tools

Install the command line developer tools.