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 / gist:12c3737ce999b0f4ac435c2e738a7451
Last active August 16, 2017 11:31 — forked from samhocevar/gist:00eec26d9e9988d080ac
Configure sshd on MSYS2 and run it as a Windows service
#!/bin/sh
#
# msys2-sshd-setup.sh — configure sshd on MSYS2 and run it as a Windows service
#
# Please report issues and/or improvements to Sam Hocevar <[email protected]>
#
# Prerequisites:
# — MSYS2 itself: http://sourceforge.net/projects/msys2/
# — admin tools: pacman -S openssh cygrunsrv mingw-w64-i686-editrights
#
@lyshie
lyshie / test_dcs.sh
Last active September 9, 2017 16:13
Connection test for dcs.tn.edu.tw
# IPv4
curl -# -v -4 http://chpsxoops.dcs.tn.edu.tw/1gb 2>&1 > /dev/null
# IPv6
curl -# -v -6 http://chpsxoops.dcs.tn.edu.tw/1gb 2>&1 > /dev/null
@lyshie
lyshie / aqi.html
Created September 9, 2017 16:16
AQI (Air Quality Index) for Tainan
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title></title>
<script src="//code.jquery.com/jquery-latest.min.js"></script>
</head>
@lyshie
lyshie / pm25.html
Created September 9, 2017 16:18
EDIMAX Airbox (PM2.5)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>PM2.5</title>
</head>
<body>
@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 / code_org_print_cards.css
Last active October 30, 2017 01:12
Code.org 列印登入卡片,節省紙張使用與方便裁剪。
div.all_cards {
margin: 0px !important;
}
div.signin_card {
margin: 0px !important;
padding: 1px !important;
}
div.signin_card dl:nth-child(1) {
@lyshie
lyshie / README.md
Last active December 15, 2017 12:56
Linux 下使用 BLE (Bluetooth Low Energy) 與 Micro:bit 溝通

安裝 Gobot

$ go get -d -u gobot.io/x/gobot/...

安裝 gort

$ cd /tmp
$ wget https://s3.amazonaws.com/gort-io/0.9.0/gort_0.9.0_linux_amd64.tar.gz
$ tar xvfz gort_0.9.0_linux_amd64.tar.gz
@lyshie
lyshie / terminal_free_20ms_before.py
Last active December 27, 2017 15:00
Micro:bit hangs at read_analog() - MicroPython
# Add your Python code here. E.g.
from microbit import *
uart.init(115200)
x = 0
pin0.write_analog(80)
sleep(1000)
while True:
@lyshie
lyshie / gitbook-to-rpm.md
Last active July 17, 2018 07:00
Convert GitBook from deb to rpm (tested on Fedora 26/27)

Convert deb to rpm

$ sudo alien -r --keep-version gitbook-editor-7.0.12-linux-x64.deb
$ rpmrebuild -pe gitbook-editor-7.0.12-1.x86_64.rpm

Delete unnecessary lines in rpm spec

Requires:      libnode.so()(64bit)
Requires:      libffmpeg.so()(64bit)
@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 [email protected]:/ ~/mnt -o port=2222,password_stdin
    
  • use rsync to backup all files
    $ rsync -avH --progress ~/mnt/storage/extSdCard/DCIM .
    
  • passwordless login