Skip to content

Instantly share code, notes, and snippets.

View lyshie's full-sized avatar

HSIEH, Li-Yi (SHIE, Li-Yi) lyshie

View GitHub Profile
@lyshie
lyshie / README.md
Last active July 2, 2024 09:22
Batch convert docx/doc to pdf with powershell (課程計畫上傳PDF使用)

如何使用 docx2pdf 工具將 docx/doc 檔案批次轉換為 pdf

  • 下載 docx2pdf
  • 解壓縮後,將 docx2pdf.cmddocx2pdf.ps1 檔案放置於最上層目錄
  • 執行 docx2pdf.cmd
@lyshie
lyshie / config-deb-i386.json
Last active June 1, 2024 22:01
Scratch Desktop (Scratch 3.0 Offline Editor) on GNU/Linux
{
"src": "/tmp/scratch-desktop/",
"dest": "/tmp/",
"arch": "i386",
"icon": "/tmp/scratch-desktop/resources/Icon.png",
"categories": [
"Education"
]
}
@lyshie
lyshie / API.md
Last active March 5, 2024 08:02
台灣公路 CCTV 列表
@lyshie
lyshie / scratch_3_text.css
Last active March 15, 2023 10:59
放大 Scratch 3 字型 (Enlarge font size in Scratch 3)
/*
1. Install Stylus (https://chrome.google.com/webstore/detail/stylus/clngdbkpkpeebahjckkjfobafhncgmne)
2. URL: Regular expression (https://scratch.mit.edu/projects/.*editor.*)
*/
/*
* {
font-family: "微軟正黑體" !important;
}
*/
@lyshie
lyshie / pdf-outline.md
Created August 2, 2022 14:56
Replace all font glyphs in a PDF by converting them to outline shapes

1. Fix missing fonts

$ pdftocairo [original.pdf] -pdf [tmp.pdf]

2. Convert all used fonts to outline shapes

$ gs -o [file-with-outlines.pdf] -dNoOutputFonts -sDEVICE=pdfwrite [tmp.pdf]
@lyshie
lyshie / BackupAndroid.md
Last active November 16, 2021 20:32
Backup Android device via SSHelper and rsync
  • Install SSHelper or 08.30.2018 Version 11.9
  • mount Android device via sshfs
    $ printf "admin\n" | sshfs root@192.168.0.101:/ ~/mnt -o port=2222,password_stdin
    
  • use rsync to backup all files
    $ rsync -avH --progress ~/mnt/storage/extSdCard/DCIM .
    
  • passwordless login
@lyshie
lyshie / glyph.sh
Last active June 6, 2021 06:23
Convert TTF (True Type Font) to PNG
#!/bin/sh
chars=$(cat ../10.txt | fold -w1 | sort | uniq)
for c in $chars; do
convert -background none -fill red -font /opt/local/fonts/lyshie/TW-Kai-98_1.ttf -pointsize 64 label:"$c" "$c.png"
done
@lyshie
lyshie / ttt.py
Created May 7, 2021 07:59
Tic-Tac-Toe
#!/usr/bin/env python3
def newBoard(board):
full_board = ['-'] * 9
full_board[:len(board)] = board[:len(board)]
return full_board
@lyshie
lyshie / ungrab.sh
Created March 12, 2021 00:11
Release keyboard and mouse from VirtualBox
#!/bin/sh
setxkbmap -option grab:break_actions
xdotool key XF86Ungrab