Skip to content

Instantly share code, notes, and snippets.

View yunghoy's full-sized avatar

Youngho Lee yunghoy

  • Vancouver, Canada
View GitHub Profile
@yunghoy
yunghoy / gist:a425f91824d26461bb2e3653bc56ebbf
Last active June 2, 2022 00:34
AMQP library (RabbitMQ) - async/await
alias babel-node='babel-node --presets stage-0'
------ RECV ------
// babel-node recv2.js "#"
// babel-node recv2.js "kern.*"
const amqp = require('amqplib');
const args = process.argv.slice(2);
if (args.length == 0) {
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