Skip to content

Instantly share code, notes, and snippets.

I'm back

Jayson LP Chen eit

I'm back
View GitHub Profile
eit / tmux.conf
Created Feb 22, 2022 — forked from brianredbeard/tmux.conf
A better starting tmux config. Live like screen, but better
View tmux.conf
# make CTRL+a the 'prefix' ala screen.
bind C-a send-prefix
set -g prefix C-a
# get rid of the tmux standard of CTRL+b
unbind C-b
set -s escape-time 1
set -g base-index 1
setw -g pane-base-index 1
# make it easy to reload the config (CTRL+r)
eit /
Created Feb 17, 2022 — forked from npearce/
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See:

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
View wordpress-social-sahre.html
.js-social-share {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
padding-left: 0;
line-height: 1;
eit / ffmpeg-wrapper
Created Dec 20, 2020 — forked from BenjaminPoncet/ffmpeg-wrapper
Synology VideoStation ffmpeg wrapper with DTS, EAC3 and TrueHD support (Installation instructions in 1st comment)
View ffmpeg-wrapper
echo "$(date '+%Y-%m-%d %H:%M:%S') - ${streamid} - $1" >> /tmp/ffmpeg.log
echo "$1" | fold -w 120 | sed "s/^.*$/$(date '+%Y-%m-%d %H:%M:%S') - ${streamid} - = &/" >> /tmp/ffmpeg.log
eit / execution-time.js
Created Sep 17, 2020 — forked from VanDalkvist/execution-time.js
How to Measure Execution Time in Node.js
View execution-time.js
var start = new Date();
var hrstart = process.hrtime();
setTimeout(function (argument) {
// execution time simulated with setTimeout function
var end = new Date() - start,
hrend = process.hrtime(hrstart);"Execution time: %dms", end);"Execution time (hr): %ds %dms", hrend[0], hrend[1]/1000000);
eit /
Last active Aug 30, 2018
no loops and handles both SI units and binary units
public static String humanReadableByteCount(long bytes, boolean si) {
int unit = si ? 1000 : 1024;
if (bytes < unit) return bytes + " B";
int exp = (int) (Math.log(bytes) / Math.log(unit));
String pre = (si ? "kMGTPE" : "KMGTPE").charAt(exp-1) + (si ? "" : "i");
return String.format("%.1f %sB", bytes / Math.pow(unit, exp), pre);
View III-backend
Minimum Qualifications
* Bachelor or Master in Computer Science, Electrical Engineering, or related technical fieds.
* Knowledge and hands-on experience of Nodejs and python language.
* Good knowledge of Docker including build, development, deploy, and docker-compose.
* Experience of using open source project.
* Experience of git version control system.
* Maintenance of unix-like server including NIS, NFS, apache, nginx, docker, gitlab, gitlab-runner, elasticsearch, postgres,
Preferred Qualifications
* Experience on development on Linux based systems
View 國王的新衣.txt
eit / gist:74d8970cc086b097333078ae525ce50c
Created Jun 26, 2018 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.
View gist:74d8970cc086b097333078ae525ce50c

Client-side SSL

For excessively paranoid client authentication.

Using self-signed certificate.

Create a Certificate Authority root (which represents this server)

Organization & Common Name: Some human identifier for this server CA.

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
eit / Edubots-dedicated-tw.swagger.json
Last active Dec 28, 2017
swagger.json for swagger-ui
View Edubots-dedicated-tw.swagger.json
"swagger": "2.0",
"info": {
"version": "v1",
"title": "Edubots情緒rule專用api",
"description": "用於edubots機器人,透過連網方式取得情緒規則與表情圖集等資料,與使用者互動"
"tags": [ {
"name" : "emotion rule",
"description" : "情緒規則api"