Skip to content

Instantly share code, notes, and snippets.

@frncmx
frncmx / main.go
Last active January 31, 2019 16:38
A Bad and Good Example for Handling Goroutine shutdowns with Context
// A GOOD example for dealing with worker goroutine shutdowns
// run: https://play.golang.org/p/hdwaMQY_K9Q
package main
import (
"context"
"fmt"
"time"
)
@frncmx
frncmx / Dockerfile
Last active November 8, 2017 19:35
Docker CMD and SIGTERM
FROM ubuntu:precise
COPY sigterm-exp /app/
CMD /app/sigterm-exp
2017/07/22 19:04:10 [INFO] Terraform version: 0.10.0 dev
2017/07/22 19:04:10 [INFO] Go runtime version: go1.8.3
2017/07/22 19:04:10 [INFO] CLI args: []string{"/home/frncmx/code/bin/terraform", "apply"}
2017/07/22 19:04:10 [DEBUG] Attempting to open CLI config file: /home/frncmx/.terraformrc
2017/07/22 19:04:10 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2017/07/22 19:04:10 [INFO] CLI command args: []string{"apply"}
2017/07/22 19:04:10 [INFO] command: empty terraform config, returning nil
2017/07/22 19:04:10 [DEBUG] command: no data state file found for backend config
2017/07/22 19:04:10 [DEBUG] New state was assigned lineage "9bf0be63-92de-49ee-833c-612cb4d9d6bd"
2017/07/22 19:04:10 [INFO] command: backend initialized: <nil>

Keybase proof

I hereby claim:

  • I am frncmx on github.
  • I am frncmx (https://keybase.io/frncmx) on keybase.
  • I have a public key ASCHyDyz5jJfnrZ5uFFmLvr0EjwQB8vL51KZOBOzO0WXgwo

To claim this, I am signing this object:

@frncmx
frncmx / history.sh
Last active November 3, 2015 10:40
My way of bash history.
# file: /etc/profile.d/history.sh
# author: pragmaticfrank@gmail.com
# This profile will give you a Bash history with the following capabilities:
# - Write everything to disk at every prompt
# => No more lost history in a broken session
# - Never forget anything, use unlimited history
# - Store everything once, work like a set data-structure
# => limit the growth a little, make search easier
# - Use peco for advanced search capabilities (fuzzy search)
@frncmx
frncmx / .vimrc
Created October 17, 2015 19:27
My vim configuration.
set nocompatible
execute pathogen#infect()
filetype plugin indent on
syntax on
set hidden
" Better command-line completion
set wildmenu