Skip to content

Instantly share code, notes, and snippets.

@WeiTang114
WeiTang114 / global-artifact-passing.yaml
Last active November 10, 2018 17:51
global-artifact-passing.yaml
# This example shows that the consume-artifact steps in the loop will
# wrongly get "AAA" as global-art output, while it should get "BBB" and
# "CCC" which are generated by loop-echo later than "AAA" generated by
# generate-artifact-A.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: global-artifact-passing-
spec:
entrypoint: global-artifact-example
@WeiTang114
WeiTang114 / random_quaternion.py
Created August 19, 2017 16:45
Uniformly sample quaternion with numpy.
import numpy as np
def rand_quat():
q = np.random.normal(0.0, 1.0, 4)
q = q / np.linalg.norm(q)
return q
@WeiTang114
WeiTang114 / dockerpgrep.sh
Last active March 21, 2017 05:54
Find container ID and name by a process name (or part of the command).
#!/bin/bash
DOCKERUSER='ns1-root'
KEY="$1"
function usage() {
echo "Usage: $0 <keyword>"
}
if [[ $# -lt 1 ]]; then
@WeiTang114
WeiTang114 / nvv.sh
Created March 13, 2017 06:43
Show username after each process in nvidia-smi.
#!/bin/bash
# Show username after each process in nvidia-smi
# like:
# ...
# +------------------------------------------------------+
# | Processes: GPU Memory |
# | GPU PID Type Process name Usage |
# |======================================================|
# | 0 150752 C python 830MiB | User: user1
# | 1 2185 C /usr/bin/python 1090MiB | User: user2