Skip to content

Instantly share code, notes, and snippets.

View yunghoy's full-sized avatar

Youngho Lee yunghoy

  • Vancouver, Canada
View GitHub Profile
sudo apt-get update && sudo apt-get install -yqq daemonize dbus-user-session fontconfig
sudo daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target
exec sudo nsenter -t $(pidof systemd) -a su - $LOGNAME
@yunghoy
yunghoy / clause.ts
Last active January 12, 2020 16:11
React
const TimerComponent = (props) => {
const [time, setTime] = useState((new Date()).toLocaleString('en'));
setInterval(() => {
setTime((new Date()).toLocaleString('en'));
}, 1000);
};
const NameComponent = (props) => {
const [name, setName] = useState("Peter");
@yunghoy
yunghoy / types.ts
Last active January 12, 2020 15:11
Typescript types.
From the codes I wrote 3 years ago. Find code from my cloud storage.
interface KeyValue1 {
[key: string]: string[];
}
const test1: KeyValue1 = {
"key1": ["value1"],
"key2": ["value2"],
};
console.log(JSON.stringify(test1));
https://github.com/tensorflow/tensorflow/issues/20500
@yunghoy
yunghoy / tensorflow_self_check.py
Created December 18, 2018 13:27 — forked from mrry/tensorflow_self_check.py
[DEPRECATED] TensorFlow on Windows self-check
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
$ kubectl label node apseo-fo4-t05.ea.com node-role.kubernetes.io/util=true
nodeSelector:
node-role.kubernetes.io/util: "true"
openssl rsa -in ssl.key.encrypted -out ssl.key.decrypted
$ docker inspect k8s_kube-apiserver_kube-apiserver-yuyi_kube-system_c162395858e62bdd4565683dda93d7f9_0 | grep port
"--insecure-port=0",
"--secure-port=6443",
"--insecure-port=0",
"--secure-port=6443",
curl http://localhost:6443

curl --insecure https://localhost:6443/api/v1
$ docker inspect k8s_kube-apiserver_kube-apiserver-yuyi_kube-system_c162395858e62bdd4565683dda93d7f9_0 | grep port
"--insecure-port=0",
"--secure-port=6443",
"--insecure-port=0",
"--secure-port=6443",
curl http://localhost:6443

curl --insecure https://localhost:6443/api/v1
https://github.com/kubernetes/dashboard
$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml
$ kubectl -n kube-system describe secrets `kubectl -n kube-system get secrets | awk '/clusterrole-aggregation-controller/ {print $1}'` | awk '/token:/ {print $2}'
$ kubectl proxy
$ kubectl get svc -n kube-system
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kube-dns ClusterIP 10.96.0.10 <none> 53/UDP,53/TCP 39m
kubernetes-dashboard ClusterIP xxx.xxx.xxx.xxxx <none> 443/TCP 31m