Skip to content

Instantly share code, notes, and snippets.

@happyman
happyman / xuite_mt2md.php
Created July 27, 2023 23:34
Xuite blog 備份檔轉換成 hugo md 程式
<?php
require('vendor/autoload.php');
use League\HTMLToMarkdown\HtmlConverter;
/* 將 xuite 的 mt text 轉換為 hugo 的 md 檔
requirement: https://github.com/thephpleague/html-to-markdown
注意: 檔名 blog_YYYYmmdd.md based on date, 也就是 mt 檔案中的 DATE 欄位. 若一天有兩篇則要另外改寫此程式處理.
md 會放在 posts/
images 會放在 assets/
@happyman
happyman / conv2mp4-py
Created January 3, 2023 06:43
conv2mp4 (python3) version
#!/usr/bin/python
"""----------------------------------------------------------------------------------
Imports (do not change)
----------------------------------------------------------------------------------"""
import datetime
import os
import os.path
import subprocess
import sys
import requests
@happyman
happyman / soptima.ps1
Last active October 21, 2021 04:25
login OPTIMA by KiTTY
##
## KiTTY can do auto-login, and initial command.
##
## start first Kitty to get OTP
$app = Start-Process -FilePath C:\Users\happyman\Desktop\kitty_portable-0.74.4.13.exe -ArgumentList '-load soptima' -passthru
Write-Output "get OTP and sleep 15 secs"
Start-Sleep -s 15
taskkill /PID $app.Id /f
Write-Output "re-spawn kitty soptima"
$otp = (python .\otp.py)