Skip to content

Instantly share code, notes, and snippets.

Avatar

Hsieh Chin Fan typebrook

View GitHub Profile
@typebrook
typebrook / Makefile
Created Oct 26, 2022
China Air Forces
View Makefile
origin.pdf:
curl -Lo $@ https://airuniversity.af.edu/Portals/10/CASI/documents/Research/PLARF/2022-10-24%20PLARF%20Organization.pdf
origin.txt: origin.pdf
pdftotext $# $@
grep: origin.txt
grep -Pzo '(.+\n)*Geo:.+\n(.+\n)*\n' origin.txt
@typebrook
typebrook / pass.edit
Last active Oct 3, 2022
Rofi script for password-store
View pass.edit
#! /bin/sh
ROFI_ARGS=( '-font' 'Hack 22' )
ENTRIES="$(find ~/.password-store -name '*gpg' -printf %P\\n | sed 's/.gpg$//')"
# Give rofi available passwords and exit
if [ $# -eq 0 ]; then
echo "$ENTRIES"
exit 0
@typebrook
typebrook / mermaid.md
Created Sep 15, 2022
Test mermaid diagram
View mermaid.md
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 Jul 30, 2022
Slide for coscup 2022
View .gitignore
dist/
plugin/
css/
*.html
assets/
View .env.template
CARD_TYPE=
CARD_NO=
APPID=
CARD_ENCRYPT=
View .dockerignore
input/
output/
upload/
@typebrook
typebrook / Makefile
Created May 15, 2022
Panorama solution with hugin
View Makefile
.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 Jul 25, 2022
Panorama solution2 for insta360 images
View .gitignore
*.insp
*.jpg
@typebrook
typebrook / Makefile
Created May 5, 2022
Panorama solution for insta360 images
View Makefile
.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 Jun 2, 2022
1922 SMS message statistics
View README.md
# 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