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 / mermaid.md
Created September 15, 2022 03:58
Test mermaid diagram
gantt
dateFormat  YYYY-MM-DD
title Adding GANTT diagram to mermaid
excludes weekdays 2014-01-10

section A section
Completed task            :done,    des1, 2014-01-06,2014-01-08
Active task               :active,  des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
@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