Skip to content

Instantly share code, notes, and snippets.

@jianliao
jianliao / remap_docker_user_to_host_user.md
Created October 16, 2021 04:00 — forked from heyfluke/remap_docker_user_to_host_user.md
remap docker user to host user.

Problem

When I use docker to work with the shared workspace with host under Ubuntu, I find that files created by docker user is owned by root. This is not the same with macOS.

Maybe this is becuase docker is run by root user and the default user mapping mechanism is to map container-root to host-user or host-root. So can I map the container-root or container-any-user to host-current-user?

Fortunately the latest docker supports the re-map the container user to any host user via Linux namespace. Refer to this.

Linux namespace

@jianliao
jianliao / vault-token-role-via-api.sh
Created September 14, 2021 19:29 — forked from greenbrian/vault-token-role-via-api.sh
HashiCorp Vault Token Role overview
# start vault in dev mode
VAULT_UI=true vault server -dev -dev-root-token-id="password"
# write some secrets for our example usage
curl --request POST \
--silent \
--header "X-Vault-Token: password" \
--header "Content-Type: application/json" \
--data '{ "options": { "cas": 0 }, "data": { "username": "administrator", "password": "hunter2" } }' \
http://127.0.0.1:8200/v1/secret/data/dev | jq '.'
Angular CLI version Angular version Node.js version TypeScript version
- 2.x 6.0.x or later minor version 2.0.x
1.0.6 4.x 6.9.x or later minor version 2.2.x
1.1.3 4.x 6.9.x or later minor version 2.3.x
1.2.7 4.x 6.9.x or later minor version 2.3.x
1.3.2 4.2.x or later minor version 6.9.x or later minor version 2.4.x
1.4.10 4.2.x or later minor version 6.9.x/8.9.x or later minor version 2.4.x
(1.5.6) 5.0.x 6.9.x/8.9.x or later minor version 2.4.x
1.5.6 5.1.x 6.9.x/8.9.x or later minor version 2.5.x
1.6.7 5.2.x or later minor version 6.9.x/8.9.x or later minor version 2.5.x
@jianliao
jianliao / Build git from source on Adobe Jenkins slave instance
Last active November 4, 2019 04:00 — forked from avivey/download and build git
install git from source (For Ubuntu)
cd ~
sudo apt-install unzip make autoconf libcurl4-gnutls-dev gettext gcc zlib1g-dev
wget -O git.zip https://github.com/git/git/archive/master.zip
unzip git.zip
cd git-*
make configure
./configure --prefix=/usr --without-tcltk
make all
/**
* Pass in an element and its CSS Custom Property that you want the value of.
* Optionally, you can determine what datatype you get back.
*
* @param {String} propKey
* @param {HTMLELement} element=document.documentElement
* @param {String} castAs='string'
* @returns {*}
*/
const getCSSCustomProp = (propKey, element = document.documentElement, castAs = 'string') => {
@jianliao
jianliao / shadow-dom.md
Created August 7, 2018 15:36 — forked from praveenpuglia/shadow-dom.md
Everything you need to know about Shadow DOM

I am moving this gist to a github repo so more people can contribute to it. Also, it makes it easier for me to version control.

Please go to - https://github.com/praveenpuglia/shadow-dom-in-depth for latest version of this document. Also, if you find the document useful, please shower your love, go ⭐️ it. :)

Shadow DOM

Heads Up! It's all about the V1 Spec.

In a nutshell, Shadow DOM enables local scoping for HTML & CSS.

@jianliao
jianliao / tensorflow_1_6_high_sierra_gpu.md
Last active March 16, 2018 21:47 — forked from orpcam/tensorflow_1_6_rc1_high_sierra_gpu.md
Tensorflow 1.6.0 on macOS High Sierra 10.13.3 with GPU Acceleration