Skip to content

Instantly share code, notes, and snippets.

View lnquy's full-sized avatar
🐶
Daydreaming

Quy Le lnquy

🐶
Daydreaming
View GitHub Profile
@lnquy
lnquy / golang-tls.md
Created June 24, 2017 16:19 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
package main
import (
"fmt"
"io"
"os"
)
var path = "/Users/novalagung/Documents/temp/test.txt"
@lnquy
lnquy / GitHub-Forking.md
Created July 26, 2017 02:56 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@lnquy
lnquy / bashrc.md
Last active July 29, 2017 03:31 — forked from ankurk91/bash_profile.md
:octocat: Git branch name in Linux Terminal

Git tip: Show Git branch name in Linux terminal

1. Add these lines in your ~/.bashrc file
# Show git branch name
force_color_prompt=yes
color_prompt=yes
parse_git_branch() {
 git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/'
}
# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.4.0/protoc-3.4.0-linux-x86_64.zip
# Unzip
unzip protoc-3.4.0-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
# Move protoc3/include to /usr/local/include/
@lnquy
lnquy / latency.txt
Created September 21, 2017 04:42 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@lnquy
lnquy / index.js
Created October 13, 2017 06:58 — forked from homaily/index.js
Lambda download and cache gzipped file from s3
'use strict';
console.log('// loading function');
const aws = require('aws-sdk');
const s3 = new aws.S3({apiVersion: '2006-03-01'});
const gzip = require('zlib').createGunzip();
const fs = require('fs');
@lnquy
lnquy / useragentswitcher.xml
Created October 31, 2017 14:19
Massive list of user agents for User Agent Switcher by Chris Pederik http://forums.chrispederick.com/categories/user-agent-switcher
<useragentswitcher>
<folder description="Browsers - Windows">
<folder description="Legacy Browsers">
<useragent description="Arora 0.6.0 - (Vista)" useragent="Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/527 (KHTML, like Gecko, Safari/419.3) Arora/0.6 (Change: )" appcodename="" appname="" appversion="" platform="" vendor="" vendorsub=""/>
<useragent description="Avant Browser 1.2" useragent="Avant Browser/1.2.789rel1 (http://www.avantbrowser.com)" appcodename="" appname="" appversion="" platform="" vendor="" vendorsub=""/>
<useragent description="Chrome 4.0.249.0 (Win 7)" useragent="Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.0 Safari/532.5" appcodename="" appname="" appversion="" platform="" vendor="" vendorsub=""/>
<useragent description="Chrome 5.0.310.0 (Server 2003)" useragent="Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.310.0 Safari/532.9" appcodename="" appname=""
@lnquy
lnquy / oozie-local-installation.md
Last active October 2, 2023 08:27
Build Apache Oozie from source and run on local Hadoop standalone (one-node-cluster).
@author: Quy Le ([email protected])
@lastModified: 2018 Mar 28
@version: 0.0.2

Prerequisites

  • Linux OS: I'm using Ubuntu 16.10 x64.
@lnquy
lnquy / ghc.sh
Last active July 13, 2020 18:53
Shell script to fork Github repo and start contributing
#!/bin/bash
set -e
# -------------------------------------------------------------------------------------
# Shell script to quickly setup environment to start contributing on a Github project.
#
# Usage:
# ghc URL_to_Github_project
#
# Examples: