Skip to content

Instantly share code, notes, and snippets.

View tpai's full-sized avatar
💭
kumo

tonypai tpai

💭
kumo
View GitHub Profile
@tpai
tpai / README.md
Last active January 24, 2024 10:35
Upgrading Docker-Compose from V1 to V2 with Ansible

install docker compose v2

mkdir -p /usr/local/lib/docker/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v2.24.2/docker-compose-linux-x86_64 -o /usr/local/lib/docker/cli-plugins/docker-compose
sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
docker compose version

Ref: https://docs.docker.com/compose/install/linux/#install-the-plugin-manually

@tpai
tpai / README.md
Last active January 9, 2024 10:20
A simple Python script for calling GA4 API
@tpai
tpai / walkthrough.md
Created December 31, 2023 05:15
my walkthrough of clmystery

find all clues with 'CLUE:' prefix in crimescene

Suspect:

  • 6' tall male
  • membership cards: Rotary_Club, Delta SkyMiles, the local library, the Museum of Bash History

Witness:

  • A woman named Annabel
  • blond spiky hair
  • New Zealand accent
@tpai
tpai / README.md
Last active April 16, 2023 15:23
This script allows you to extract English text from images using Python.
  1. Install the required packages by running pip install -r requirements.txt in your terminal.
  2. Run the command export TESSDATA_PREFIX=/usr/local/tessdata in your terminal to set the Tesseract data path.
  3. Download the English language data from here and place it to the tessdata folder above.
  4. Run main.py
@tpai
tpai / pitr.sh
Last active January 12, 2024 01:14 — forked from LS80/pitr.sh
Demo PostgreSQL 13 Point-in-time Recovery with Docker
#!/bin/bash
VERSION=13
function cleanup() {
docker rm -f master replica >&/dev/null
rm -Rf $(pwd)/data $(pwd)/wal_archive
}
function wait_until_ready() {
@tpai
tpai / obs.css
Last active June 19, 2022 03:06
OBS YouTube chatroom style with Traditional Chinese font
@charset "UTF-8";
@import url("https://fonts.googleapis.com/css?family=Noto+Sans+TC:400,500&display=swap");
body {
background-color: transparent !important;
font-family: "Noto Sans TC", sans-serif !important;
overflow-y: hidden !important;
}
@tpai
tpai / bamboofox-ctf.js
Created January 20, 2021 01:36
javascript ctf
const express = require("express");
const cookieParser = require('cookie-parser')
var crypto = require('crypto');
const secret = require("./secret.json");
const app = express();
app.use(cookieParser(secret.FLAG));
let canvas = {
...Array(128).fill(null).map(() => new Array(128).fill("#FFFFFF"))
const dayjs = require("dayjs");
module.exports = {
watchFundingTrades: async (ws, { symbol }, cb) => {
ws.onFundingTradeEntry({ symbol }, trade => {
const params = getParams(trade);
const { datetime, rate, apy, period, amount } = params;
console.log(
`${datetime}\t${rate.toFixed(6)}\t${apy.toFixed(
6
var root = document.querySelector('#v-game-countdown').nextSibling;
var rootObserver = new MutationObserver((mutations) => mutations.map(mutation => {
[].slice.call(document.querySelectorAll('.v-game-target img')).map((target) => {
target.click();
});
}));
rootObserver.observe(root, {
childList: true
});
const root = document.querySelector('#kolor-kolor');
const rootObserver = new MutationObserver((mutations) => mutations.map(mutation => {
[].slice.call(document.querySelectorAll('#kolor-options li a')).map((option) => {
if (option.style.backgroundColor === mutation.target.style.backgroundColor) {
option.click();
}
});
}));
rootObserver.observe(root, {
attributes: true,