Skip to content

Instantly share code, notes, and snippets.

@chsjiang
chsjiang / DOCKERFILE
Created August 10, 2023 21:21 — forked from MatthewJamesBoyle/DOCKERFILE
production go dockerfile
FROM golang:1.21.0-bullseye as builder
COPY . /workdir
WORKDIR /workdir
ENV CGO_CPPFLAGS="-D_FORTIFY_SOURCE=2 -fstack-protector-all"
ENV GOFLAGS="-buildmode=pie"
RUN go build -ldflags "-s -w" -trimpath ./cmd/app
@chsjiang
chsjiang / Netfilter-IPTables-Diagrams.md
Created September 3, 2021 18:56 — forked from nerdalert/Netfilter-IPTables-Diagrams.md
Linux NetFilter, IP Tables and Conntrack Diagrams

Linux NetFilter, IP Tables and Conntrack Diagrams

IPTABLES TABLES and CHAINS

IPTables has the following 4 built-in tables.

1) Filter Table

Filter is default table for iptables. So, if you don’t define you own table, you’ll be using filter table. Iptables’s filter table has the following built-in chains.

@chsjiang
chsjiang / init.vim
Created June 26, 2020 07:49 — forked from prkstaff/init.vim
My NeoVim config + Dracula theme + NerdTree
"*****************************************************************************
"" Vim-PLug core
"*****************************************************************************
if has('vim_starting')
set nocompatible " Be iMproved
endif
let vimplug_exists=expand('~/.config/nvim/autoload/plug.vim')
let g:vim_bootstrap_langs = "javascript,php,python,ruby"
@chsjiang
chsjiang / Jenkinsfile
Created September 22, 2019 20:48 — forked from patrickwmcgee/Jenkinsfile
Jenkins Pipeline Example: jenkins-pipeline + Go + glide.sh + multibranch pipeline
#!groovy
/**
* This is an example Jenkins pipeline Jenkinsfile for building and testing a private Github Go project that uses glide.sh.
* This style of Pipeline works with the Jenkins Git plugin and multibranch pipeline projects. In a multi-branch project configuring
* a webhook for push and pull request is needed from the Github repository to get builds to automatically start after a push.
*/
pipeline {
agent {
label 'your-agent-goes-here'
}
@chsjiang
chsjiang / README.md
Created August 15, 2019 19:13 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


# Cluster management tools.
export CLUSTER_NAME ?= $(shell cat tmp/current 2>/dev/null || echo $$(whoami)-dev)
export MACHINE_TYPE ?= n1-standard-2
export DISK_SIZE ?= 100
export MAX_NODES ?= 10
export NETWORK ?= dev
export PROJECT ?= foobar
export VERSION ?= latest
export ZONE ?= us-west1-a
@chsjiang
chsjiang / reinvent-2018-session-videos.md
Created December 27, 2018 21:16 — forked from LukasMusebrink/reinvent-2018-session-videos.md
Links to YouTube videos of AWS re:Invent 2018 sessions

The current list contains 438 sessions. The list will be updated regularly, at least once a day during reinvent. Last update: 2018-12-02 06:58 +00:00

Title Description Video
[NEW LANUCH!] Building modern apps using Amazon DynamoDB transactions (DAT374) DynamoDB transactions enables developers to maintain correctness of their data at scale by adding atomicity and isolation guarantees for multi-item conditional ... IMAGE ALT TEXT{:target="_blank"}
[NEW LAUNCH!] AWS License Manager Deep Dive (CMP393) AWS License Manager is a new service that makes it easy to bring your existing licenses to the AWS cloud and reduce licensing costs. This service offers a ... [IMAGE ALT TEXT](http://www.youtube.com/watch?v=r7pdaM3OAAQ "AWS re:Invent 2018: [NEW LA
@chsjiang
chsjiang / README.md
Created March 2, 2018 06:09 — forked from oodavid/README.md
Backup MySQL to Amazon S3

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

@chsjiang
chsjiang / tmux.cheat
Created January 23, 2018 19:35 — forked from afair/tmux.cheat
Tmux Quick Reference & Cheat sheet - 2 column format for less scrolling!
========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^b w
New -s <session> Create ^b c
Attach att -t <session> Rename ^b , <name>
Rename rename-session -t <old> <new> Last ^b l (lower-L)
Kill kill-session -t <session> Close ^b &
type PayloadCollection struct {
WindowsVersion string `json:"version"`
Token string `json:"token"`
Payloads []Payload `json:"data"`
}
type Payload struct {
// [redacted]
}