Skip to content

Instantly share code, notes, and snippets.

View Soontao's full-sized avatar
😊
I may be slow to respond.

Theo Sun Soontao

😊
I may be slow to respond.
View GitHub Profile
@Soontao
Soontao / TheoCAChain.crt
Created January 28, 2023 03:41
Theo Private CA Chain
-----BEGIN CERTIFICATE-----
MIIF8TCCA9mgAwIBAgIJAMTsVMXFWTBOMA0GCSqGSIb3DQEBCwUAMIGNMQswCQYD
VQQGEwJDTjEQMA4GA1UECAwHU2ljaHVhbjEQMA4GA1UEBwwHQ2hlbmdkdTEaMBgG
A1UECgwRVGhlbyBTdW4gUGVyc29uYWwxGTAXBgNVBAMMEFRoZW8gUGVyc29uYWwg
Q0ExIzAhBgkqhkiG9w0BCQEWFHRoZW8uc3VuQG91dGxvb2suY29tMCAXDTIwMDEx
NTEzNTQwMFoYDzIxMTkxMjIyMTM1NDAwWjCBjTELMAkGA1UEBhMCQ04xEDAOBgNV
BAgMB1NpY2h1YW4xEDAOBgNVBAcMB0NoZW5nZHUxGjAYBgNVBAoMEVRoZW8gU3Vu
IFBlcnNvbmFsMRkwFwYDVQQDDBBUaGVvIFBlcnNvbmFsIENBMSMwIQYJKoZIhvcN
AQkBFhR0aGVvLnN1bkBvdXRsb29rLmNvbTCCAiIwDQYJKoZIhvcNAQEBBQADggIP
ADCCAgoCggIBAOMAOaw0sAFgcECsia88pH/89EsD13Vv8rumgoZjtneO7vPqURt2
@Soontao
Soontao / setNodeMirror.sh
Last active July 31, 2023 11:29 — forked from hetykai/setNodeMirror.sh
change npm mirror for china developer
npm set registry https://registry.npmmirror.com
npm set disturl https://npmmirror.com/mirrors/node && \
npm set sass_binary_site https://npmmirror.com/mirrors/node-sass && \
npm set PUPPETEER_DOWNLOAD_BASE_URL=https://npmmirror.com/mirrors/ && \
npm set chromedriver_cdnurl https://npmmirror.com/mirrors/chromedriver && \
npm set operadriver_cdnurl https://npmmirror.com/mirrors/operadriver && \
npm set phantomjs_cdnurl https://npmmirror.com/mirrors/phantomjs && \
npm set selenium_cdnurl https://npmmirror.com/mirrors/selenium && \
curl -o- https://cdn.jsdelivr.net/gh/nvm-sh/nvm/install.sh |bash
@Soontao
Soontao / proxy.py.generate.keypair.sh
Created April 7, 2022 05:44
Generate HTTPS certificate for proxy
python3 -m proxy.common.pki gen_private_key --private-key-path https-key.pem
python3 -m proxy.common.pki remove_passphrase --private-key-path https-key.pem
python3 -m proxy.common.pki gen_public_key --private-key-path https-key.pem --public-key-path https-cert.pem
# ==========================================================
# NPM
# ==========================================================
npm set registry https://r.npm.taobao.org # 注册模块镜像
npm set disturl https://npm.taobao.org/dist # node-gyp 编译依赖的 node 源码镜像
## 以下选择添加
npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass # node-sass 二进制包镜像
{
"format_version": 1,
"imports": [
{
"target_table": "CUSTOM_A_DB_PEOPLE",
"source_data": {
"data_type": "CSV",
"file_name": "custom.a.db-People.csv",
"has_header": true,
"type_config": {
@Soontao
Soontao / rss-reader.yml
Last active May 7, 2022 04:13
RSS stack for docker stack
version: '3.7'
services:
rsshub:
image: theosun/rsshub:latest
restart: always
command: node --max-old-space-size=250 lib/index.js
environment:
NODE_ENV: "production"
LOGGER_LEVEL: "warn"
@Soontao
Soontao / ehcra.md
Last active February 25, 2021 07:17
enable hana cloud remote access

defaultly, SAP CF Runtime will only allow HANA connection from cloud private virtual network.

but in development, developers want to inspect database by some local tools, or developers want to debug application in local with HANA DB, here is the guide how to configure the connection ip range of HANA Cloud

  1. go to your cloud foundry instance
  2. choose SAP HANA Cloud
  3. Actions -> Manage Service Instnace
  4. In the SAP HANA Cloud Central, choose the correct HANA instance, click the right Action Button, the click Edit
  5. Connections -> Allow all IP addresses
// main.js
const cluster = require('cluster')
if (cluster.isMaster) {
console.log("starting...");
for (var i = 0; i < 4; i++) {
@Soontao
Soontao / debounce.js
Created January 5, 2021 05:57
debounce function
function debounce(func, wait) {
var timer;
return function () {
var context = this, args = arguments;
clearTimeout(timer);
timer = setTimeout(function () {
timer = null;
func.apply(context, args);
}, wait);
};