Skip to content

Instantly share code, notes, and snippets.

View lucduong's full-sized avatar

Luc lucduong

View GitHub Profile
lucduong /
Created February 20, 2022 11:14 — forked from troyfontaine/
Signing your Git Commits using GPG on MacOS Sierra/High Sierra

Methods of Signing with GPG

Last updated March 28, 2021

There are now two ways to approach this:

  1. Using gpg and generating keys
  2. Using Kryptonite by

This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

View trans-zero-cloud9-public-key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDg7+iTiLom9shOyOHiuv1fEKJeW8+uo+0IGlRVWjO14seX2LTz4zInoB+70OPJh0y49shJMOwOIN0gM2kFCr8bTt+e2n/nKGyQosqX4aEKrMkTZ3pKhrcruFmzlEjzqu7TEz70frxkXv0lS2mZcdvuRZJj9g+N5upEM+K9G30RLwrzgM055d6xlHKa8TNFfQ7E8WPJhYdLBpk442KMy4nSgq1z/J7okrIsfnBJ6DdyaqLV0Sffvuvte9ekopobDXwTcvidp138HaFvrqS3nbxGa/pOv7oxrOie2h7AelBZ9kxhFqlI6HJ2YPsUMUWmr4R0+70ZaVqkmCbJHGfsSa11rwl9UpN4tJKTaXVpVQ1FH3g+7ruUatUYqfKcHKSFV89Ami63XLSrIPH3cAfe0OmaBzbusAvKEXa4Z1eYeqsoOCIJLM9I0FX+caDDkwddMRfeRiJyLDFZnhDEaBxV81xO6aKSweVDdSVT34a5mlPbYIT7WTh7o9B2PIkK6W3s8dRrZl2qEvrONPhgmlfxLOBz3Ltx9Jh0Xnbls/gjZbznafzQk3MXLUTmb0OhnG1zKsHXHX4Kk2KMa7s7X6P5TWISiFiLwR3QCMh4ie6H7tVWpImnXZ5Qw8086C/TzWZ81EQz5NZ7z8WBFtBKoUCCffPdgYaI4BoS2WWWVkj8/P4YDQ==
lucduong / sed cheatsheet
Created April 4, 2021 23:45 — forked from freewind/sed cheatsheet
magic of sed -- find and replace "text" in a string or a file
View sed cheatsheet
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
lucduong / package.json
Created March 27, 2021 12:57
Tôi học nodejs như thế nào
View package.json
"name": "demo-nodejs",
"version": "1.0.0",
"description": "Demo NodeJS",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"author": "Luc Duong",
"license": "MIT"
lucduong / CacheComposer.ts
Created March 22, 2021 23:24 — forked from abdavid/CacheComposer.ts
Cache composing in MoleculerJS
View CacheComposer.ts
POC of cache composing.
The idea behind this madnes was to compose multiple layers of LRU type caches,
with the first layer being local (LRUMemcache) with a 1:1 with configured TTL, and for each subsequent tier 1:n of the configured ttl.
In effect that would mean that when a cached item gets shifted out of the first layer due to being regarded as the least recently used,
it would still exising in the second layer giving it a grace period of sorts before deleting the cache entry from all layers.
BUT WHY you may ask?
lucduong / dnsmasq.conf
Created July 3, 2020 10:53 — forked from ruanbekker/dnsmasq.conf
Tinkering with Loki, Promtail, Grafana, Prometheus, Nginx and Dnsmasq
View dnsmasq.conf
lucduong /
Last active August 14, 2019 04:10
Shell Snippets
check_service_completed() {
state=$(docker service ps $service_name | awk 'FNR == 2 {print $6}')
if [ "$state" = "no such service: $service_name" ]; then
if [ "$state" = "Complete" ]; then
echo "Y"
echo "N"
lucduong / webpack-moleculer-service-plugin.js
Created July 24, 2019 16:22
View webpack-moleculer-service-plugin.js
'use strict';
const path = require('path');
const fs = require('fs');
const YAML = require('yaml');
function WebpackMoleculerServicePlugin(options) {
options = options || {};
if (typeof options === 'string') {
this.options = { output: options };
lucduong / .gitconfig
Last active January 9, 2019 04:24
Git Config
View .gitconfig
st = status
ci = commit -v
co = checkout
up = pull origin
info = remote -v
d = diff
df = diff
dfc = diff --cached
dc = diff --cached
lucduong / pm2_python.json
Created November 22, 2017 12:44
pm2 guide
View pm2_python.json
"apps": [{
"name": "impactool",
"cwd": ".",
"args": [
"env": {