Skip to content

Instantly share code, notes, and snippets.

View typebrook's full-sized avatar
💭
Adapting new job

Hsieh Chin Fan typebrook

💭
Adapting new job
View GitHub Profile
@typebrook
typebrook / .gitignore
Last active July 30, 2022 03:22
Slide for coscup 2022
dist/
plugin/
css/
*.html
assets/
@typebrook
typebrook / .env.template
Last active February 4, 2023 02:15
Invoice API
CARD_TYPE=
CARD_NO=
APPID=
CARD_ENCRYPT=
input/
output/
upload/
**/.git
@typebrook
typebrook / Makefile
Created May 15, 2022 05:24
Panorama solution with hugin
.ONESHELL:
all:
GID=`getent group gitea | cut -d: -f3` \
docker-compose up -d
down:
GID=`getent group gitea | cut -d: -f3` \
docker-compose down
install:
sudo systemctl enable gitea.service
@typebrook
typebrook / .gitignore
Last active April 15, 2023 09:10
Panorama solution2 for insta360 images (deprecated)
*.insp
*.jpg
@typebrook
typebrook / Makefile
Created May 5, 2022 04:06
Panorama solution for insta360 images (deprecated)
.ONESHELL:
test: xmap.pgm ymap.pgm
ffmpeg -y -i test.jpg -i xmap.pgm -i ymap.pgm -filter_complex remap out.jpg
exiftool -UsePanoramaViewer=TRUE -ProjectionType="equirectangular" out.jpg
which SimplePanoramaViewer 2>/dev/null && SimplePanoramaViewer out.jpg
pgm: dualfisheye2equirectangular
cd $<
gcc -o projection projection.c -lm
@typebrook
typebrook / README.md
Last active June 2, 2022 07:57
1922 SMS message statistics
# Backup telephony data as telephony.ab
adb backup -apk com.android.providers.telephony -f telephony.ab &>/dev/null

# Extract .ab file with tail, pigz and tar
# Notice we need to ignore the first 24 bytes and then fo decoding
tail -c +25 telephony.ab | pigz -d | tar -xf -

# Get JSON data with files: XXXXXXsms_backup
for sms in **/*sms_backup; do 
@typebrook
typebrook / cnn_news.sh
Last active January 4, 2023 13:26
Coninuouly print news from RSS
#! /bin/sh
RSS_URL=http://feeds.bbci.co.uk/news/rss.xml
#RSS_URL=http://feeds.bbci.co.uk/news/rss.xml
PRINT_INTERVAL=${PRING_INTERVAL:-30}
FETCH_INTERVAL=${FETCH_INTERVAL:-600}
RSS=$(mktemp)
LOCK=$(mktemp)
@typebrook
typebrook / .env.template
Last active October 31, 2023 07:01
Docker Compose for nginx and gitea
GITEA_DATA_DIR=/tmp/gitea
@typebrook
typebrook / Makefile
Last active February 4, 2023 02:52
Extract fields from county raw data #gis #gov #taiwan
kaohsiung.csv:
curl -Lo $@ https://data.kcg.gov.tw/dataset/7b142b2b-4d92-4a22-ac63-339c95bb0dfc/resource/d6e12411-8655-40ff-a2b2-ea3791c7c586/download/firehydrantonground.csv
taipei.csv:
curl -L https://data.taipei/api/getDatasetInfo/downloadResource\?id\=c106a00b-5a21-4393-b213-475a0ece9f2b\&rid\=b9f8154d-c627-48a8-b3ef-512ed9cde9e7 \
| iconv -f BIG-5 -t UTF-8 >$@
taoyuan_97.csv:
curl -Lo raw.json https://data.tycg.gov.tw/opendata/datalist/datasetMeta/download\?id\=3fd4a492-bcae-45be-8184-aa6fad506701\&rid\=ea487112-ef5b-481a-b49a-26f52dc04b93
echo 'FID,類別碼,識別碼,高程,x,y' >$@