Skip to content

Instantly share code, notes, and snippets.

geerlingguy /
Last active Dec 31, 2021
Ansible Role Test Shim Script
# Ansible role test shim.
# Usage: [OPTIONS] ./tests/
# - distro: a supported Docker distro version (default = "centos7")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - role_dir: the directory where the role exists (default = $PWD)
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)
Saissaken / Update git fork with
Last active Jan 12, 2022
Update git fork with tags
View Update git fork with
# Repo: someuser/myframework
# Fork: superteam/myframework
# Track:
git clone
cd myframework
git remote add upstream
# Update:
git fetch upstream
espaciomore /
Last active Nov 6, 2021
Watch command for Git Bash
while(true); do
echo -e "${OUTPUT[@]}"

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.

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

andrewmilson / file-upload-multipart.go
Last active Jan 13, 2022
Golang multipart/form-data File Upload
View file-upload-multipart.go
package main
import (
docwhat / example1
Created Dec 7, 2015
choco install dotnet3.5 fails (but succeeds?)
View example1
PS C:\Users\Administrator> choco install dotnet3.5 -debug -yes
Chocolatey is running on Windows v 6.3.9600.0
Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
Command line: "C:\ProgramData\chocolatey\choco.exe" install dotnet3.5 -debug -yes
Received arguments: install dotnet3.5 -debug -yes
NOTE: Hiding sensitive configuration data! Please double and triple
check to be sure no sensitive data is shown, especially if copying
output to a gist for review.
tomcatzh / readwrite.go
Created Apr 1, 2015
Golang readline and writeline
View readwrite.go
func readLines(path string) ([]string, error) {
file, err := os.Open(path)
if err != nil {
return nil, err
defer file.Close()
var lines []string
scanner := bufio.NewScanner(file)
for scanner.Scan() {
jpillora / smtp-gmail-send.go
Last active Nov 11, 2021
Send email using Go (Golang) via GMail with net/smtp
View smtp-gmail-send.go
package main
import (
func main() {
send("hello there")
madevelopers / readzip.go
Created Jan 29, 2015
golang: Read zip file
View readzip.go
package main
import (
type myCloser interface {
Close() error