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 / 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 / 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
@lyshie
lyshie / rogue-dhcp-detector.py
Last active January 27, 2021 07:17 — forked from partytime/rogue-dhcp-detector.py
rogue dhcp detector
#!/usr/bin/python
import sys
from os import geteuid
from scapy.all import *
#check for root
if geteuid() != 0:
print("This must be run as root")
exit(1)
@lyshie
lyshie / yt-mp4.sh
Created October 6, 2020 14:41
Download mp4 file with subtitles from YouTube
youtube-dl --write-sub --sub-lang en --sub-format vtt --embed-subs -f 137+140 'https://youtu.be/wCio_xVlgQ0'
@lyshie
lyshie / distribute.py
Created May 28, 2020 07:45
Distribute
#!/usr/bin/env python3
def partition(num, group):
parts = dict()
m = int(num / group)
r = num - m * group
parts = [m + 1] * (r) + [m] * (group - r)
@lyshie
lyshie / COVID19-EDU.md
Last active April 10, 2020 11:22
因應 COVID-19 線上學習資源彙整
@lyshie
lyshie / API.md
Last active March 5, 2024 08:02
台灣公路 CCTV 列表
@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