Skip to content

Instantly share code, notes, and snippets.

Avatar

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

View GitHub Profile
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 Mar 12, 2021
Release keyboard and mouse from VirtualBox
View ungrab.sh
#!/bin/sh
setxkbmap -option grab:break_actions
xdotool key XF86Ungrab
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)
@lyshie
lyshie / yt-mp4.sh
Created Oct 6, 2020
Download mp4 file with subtitles from YouTube
View yt-mp4.sh
youtube-dl --write-sub --sub-lang en --sub-format vtt --embed-subs -f 137+140 'https://youtu.be/wCio_xVlgQ0'
View distribute.py
#!/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 Apr 10, 2020
因應 COVID-19 線上學習資源彙整
View COVID19-EDU.md
@lyshie
lyshie / API.md
Last active Dec 11, 2020
台灣公路 CCTV 列表
View API.md
@lyshie
lyshie / README.md
Last active Jul 2, 2019
Batch convert docx/doc to pdf with powershell (課程計畫上傳PDF使用)
View README.md

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

  • 下載 docx2pdf
  • 解壓縮後,將 docx2pdf.cmddocx2pdf.ps1 檔案放置於最上層目錄
  • 執行 docx2pdf.cmd
@lyshie
lyshie / 4way_player.sh
Last active Jul 25, 2019
四錄行車記錄器播放工具
View 4way_player.sh
#!/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