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 / 4way_player.sh
Last active July 25, 2019 15:00
四錄行車記錄器播放工具
#!/bin/sh
######## 影片路徑 (L左 R右 F前 B後)
VID_L="/run/media/lyshie/SE1/DCIM/VID_L"
VID_R="/run/media/lyshie/SE1/DCIM/VID_R"
VID_F="/run/media/lyshie/SE/DCIM/VID_F"
VID_B="/run/media/lyshie/SE/DCIM/VID_B"
######## 檔案名稱
######## /run/media/lyshie/SE/DCIM/VID_F/VID_20190616_204734.(ts|kml) => 2019-06-16 20:47:34
@lyshie
lyshie / COVID19-EDU.md
Last active April 10, 2020 11:22
因應 COVID-19 線上學習資源彙整
@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 / Howto_Block_Content_Farm.md
Last active June 24, 2020 08:39
如何封鎖內容農場及搜尋結果

如何封鎖內容農場及搜尋結果?

為您的瀏覽器安裝「擴充功能」或「附加元件」

請安裝「封鎖內容農場」或「終結內容農場」,當您不小心連結到內容農場時,將會出現警告頁面避免繼續閱讀。

進一步在 Google 搜尋結果中排除內容農場,建議安裝「uBlacklist」,並將「內容農場」網站清單匯入,之後就再也不會出現在搜尋結果了。

建議封鎖清單

@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 / 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 / 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 / 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 / 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