Skip to content

Instantly share code, notes, and snippets.

View fkztw's full-sized avatar
📺
Hello World!

Frank Zheng fkztw

📺
Hello World!
  • Taiwan
  • 06:32 (UTC +08:00)
View GitHub Profile
@fkztw
fkztw / True Trello Printer
Created December 26, 2017 15:35 — forked from mathiasrw/True Trello Printer
Ever wanted to print your Trello board? Export as JSON and paste it into the code.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>True Trello Printer</title>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<style>
body{margin:15%;}
.panel-body{
@fkztw
fkztw / collect_twitter_direct_messages.py
Last active October 24, 2022 22:34
Get tweets I saved (by sending DM to my bot account)
#!/usr/bin/env python3
import urllib
import twitter
# Fill these contants by yourself.
CONSUMER_KEY = ""
CONSUMER_SECRET = ""
@fkztw
fkztw / cli.md
Created December 12, 2017 17:18 — forked from phrawzty/2serv.py
simple http server to dump request headers
$ curl -s -H "X-Something: yeah" localhost:8000 > /dev/null
$ python serv.py
ERROR:root:User-Agent: curl/7.37.1
Host: localhost:8000
Accept: */*
X-Something: yeah

我也被電腦駭客勒索過
李家同·MONDAY, MAY 15, 2017

大概兩年以前,我出門的時候就發現檔案怪怪的,當時我沒有注意就去研究室了。後來回家以後發現好多檔案都毀掉了,我趕緊找我的學生問是怎麼回事,他們說我的電腦中毒了,而且要付多少錢的彼特幣,不然檔案都會毀掉。當然我不會去付勒索的錢,我的學生就說沒有辦法了,只有重灌OS,幾天以後我就有了一個新而乾淨的電腦。

大家一定好奇,我的檔案毀了怎麼辦。我的確是有相當重要的檔案,比方說我正在寫兩本書,一本是有關string matching,另外一本有關analog circuit。如果這些檔案全部毀掉,那我真是很可憐,可是我一點損失都沒有,因為我將我的檔案早就存到雲端系統去了。這個雲端系統當然是國產的,它有很多的優點,遠遠超過外國的雲端系統,對我這個做研究的人來講,這是我最好的選擇。所以就算駭客想勒索我,我根本不怕。

當然我損失了一批音樂的檔案,那批檔案都放在我的硬碟裡。但是我有一個習慣,喜歡將好聽的音樂放進隨身碟,因為我的車上可以用隨身碟,這些檔案恢復起來也很容易,何況因為這些也是來自我購買的唱片,了不起就將這些唱片拿出來重新弄。

我曾經聽過一個故事,有某頂尖大學的電機系學生,他們的研究結果都放在自己的電腦內,沒有想到有小偷進來將所有的電腦全部偷走,這些學生欲哭無淚。這當然是很多年前的事,可是當時我就已經將所有我的重要檔案放入雲端了。

@fkztw
fkztw / gtts-chinese.py
Last active July 9, 2017 20:15
在座的各位都是谷歌小姐
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# USAGE: `$ cat $text_file | python3 gtts-chinese.py`
import os
import sys
from gtts import gTTS
@fkztw
fkztw / fix_virtualenvs.sh
Last active November 12, 2020 07:09
A simple script to fix and reinstall all modules for each virtualenv of a user after upgrading whole system Python. https://blog.m157q.tw/posts/2015/10/07/fix-virtualenv-after-an-upgrade-of-python/
#!/usr/bin/env bash
VIRTUALENVS_ROOT_DIR="${HOME}/.virtualenvs"
ACTIVE_SH_PATH="/bin/activate"
for dir in `find ${VIRTUALENVS_ROOT_DIR} -type d -maxdepth 1`
do
if [[ ${dir} == ${VIRTUALENVS_ROOT_DIR} ]]; then
continue
fi
=============================================
- Discovered by: Dawid Golunski
- http://legalhackers.com
- dawid (at) legalhackers.com
- CVE-2016-6662
- Release date: 12.09.2016
- Severity: Critical
=============================================
@fkztw
fkztw / find_smallest_cycel.py
Created May 22, 2016 04:59 — forked from apua/find_smallest_cycel.py
說到比對就想到 regexp....
"""
Given cyclic list with elements integers.
Find the smallest cycle.
>>> find_smallest_cycle([10, 3, 999, 24, 10, 3, 999, 24, 10, 3])
[10, 3, 999, 24]
"""
def origin(mylist):
def make_tuple(list_a):
return list(set(map(tuple,list_a)))
[關於研究]
用了一年多做專題,有一些自己對於研究上的想法
1. 自己是可以做研究的
2. 我想做的研究是真的可以為人所用,
而不是先射箭再畫靶的紙上談兵。
如果一個研究題目不能為人所用,
過了三五年,它就是廢紙一張。