Skip to content

Instantly share code, notes, and snippets.

Avatar

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

View GitHub Profile
@lyshie
lyshie / config-deb-i386.json
Last active September 9, 2023 22:00
Scratch Desktop (Scratch 3.0 Offline Editor) on GNU/Linux
View config-deb-i386.json
{
"src": "/tmp/scratch-desktop/",
"dest": "/tmp/",
"arch": "i386",
"icon": "/tmp/scratch-desktop/resources/Icon.png",
"categories": [
"Education"
]
}
@lyshie
lyshie / API.md
Last active August 12, 2023 03:19
台灣公路 CCTV 列表
View API.md
@lyshie
lyshie / scratch_3_text.css
Last active March 15, 2023 10:59
放大 Scratch 3 字型 (Enlarge font size in Scratch 3)
View scratch_3_text.css
/*
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
View pdf-outline.md
@lyshie
lyshie / BackupAndroid.md
Last active November 16, 2021 20:32
Backup Android device via SSHelper and rsync
View BackupAndroid.md
  • 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
View glyph.sh
#!/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
View ttt.py
#!/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
View ungrab.sh
#!/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
View rogue-dhcp-detector.py
#!/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)