Skip to content

Instantly share code, notes, and snippets.

View Oschangkai's full-sized avatar

KaiYi Oschangkai

View GitHub Profile
@Oschangkai
Oschangkai / apitable.env
Last active April 28, 2024 07:58
docker-compose --env-file apitable.env up -d
ENV_FILE=apitable.env
IMAGE_PULL_POLICY=always
IMAGE_REGISTRY=ghcr.io/oschangkai
IMAGE_BACKEND_SERVER=apitable/backend-server:latest
IMAGE_GATEWAY=apitable/openresty:latest
IMAGE_INIT_DB=apitable/init-db:latest
IMAGE_ROOM_SERVER=apitable/room-server:latest
IMAGE_WEB_SERVER=apitable/web-server:latest
@Oschangkai
Oschangkai / coc-upgrade-table-copy.js
Created January 3, 2022 15:13
One click to copy price, time and host level into plain text
// https://www.cocservice.top/update/
var pricePos = 7; // 王 = 7
var timePos = 8; // 王 = 8
var hostLevelPos = 9; // 王 = 9
var table = document.getElementsByClassName('mdui-table mdui-table-hoverable less-padding-table table-text-center update-data')[0];
var head = Array.from(table.children[0].children[0].children);
var data = Array.from(table.children[1].children);
@Oschangkai
Oschangkai / azure_sql_firewall.sh
Last active August 25, 2021 10:14
Create & Delete firewall rule to Azure SQL (for Azure DevOps deploy using az-cli)
## Set these variables to Azure DevOps Pipeline ##
# subscriptionId, resourceGroupName, serverName
### TASK: Create Firewall Rule ###
# Pick variables
subscriptionId=$(subscriptionId)
resourceGroupName=$(resourceGroupName)
serverName=$(serverName)
@Oschangkai
Oschangkai / pycacheClean.sh
Created December 10, 2020 02:49
Clean __pycache__ folder and files on any platform
python -Bc "import pathlib; [p.unlink() for p in pathlib.Path('.').rglob('*.py[co]')]"
python -Bc "import pathlib; [p.rmdir() for p in pathlib.Path('.').rglob('__pycache__')]"
# ref: https://stackoverflow.com/questions/28991015/python3-project-remove-pycache-folders-and-pyc-files
@Oschangkai
Oschangkai / jcb.js
Last active July 1, 2024 05:35
JCB ezcard
// ==UserScript==
// @name ezcard-helper
// @namespace http://tampermonkey.net/
// @version 2024.07.01
// @description 懂的都懂
// @author Oschangkai
// @match https://ezweb.easycard.com.tw/Event01/JCBLoginServlet
// @match https://ezweb.easycard.com.tw/Event01/JCBLoginRecordServlet
// @grant none
// ==/UserScript==
@Oschangkai
Oschangkai / hash_and_certEncrypt.js
Last active October 2, 2019 05:56
Using Certificates Encryption and Decryption hash with Node.js crypto Package
const fs = require('fs'),
crypto = require('crypto');
function loadKey(file) {
return fs.readFileSync(file, 'utf8');
}
let
prvKey = loadKey('./privateKey.pem'),
pubKey = loadKey('./publicKey.pem'),