Skip to content

Instantly share code, notes, and snippets.

View LeeiFrankJaw's full-sized avatar

Lei Zhao LeeiFrankJaw

View GitHub Profile
@LeeiFrankJaw
LeeiFrankJaw / get-trojan.sh
Last active June 2, 2020 04:14
Install trojan from source under Ubuntu 18.04
git clone '[email protected]:trojan-gfw/trojan.git'
sudo apt install cmake default-libmysqlclient-dev libboost-program-options-dev libboost-system-dev libssl-dev
# Oops, the boost version shipped with Ubuntu 18.04 is too old for trojan.
wget 'https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.bz2'
tar xvf boost_1_72_0.tar.bz2 -C /usr/local/
cd trojan/
git checkout v1.14.1
cmake -D CMAKE_INSTALL_PREFIX:PATH=/usr/local -D BOOST_ROOT:PATH=/usr/local/boost_1_72_0/ .
@LeeiFrankJaw
LeeiFrankJaw / get-v2ray.sh
Created March 10, 2020 15:55
Install v2ray on Ubuntu 18.04 from source
# Refer to https://www.v2ray.com/developer/intro/compile.html
@LeeiFrankJaw
LeeiFrankJaw / get-craftcms.sh
Created July 2, 2020 15:32
Install Craft CMS on Ubuntu 18.04 LTS
# With Apache
# apt install php composer
# Without Apache
apt install php-fpm composer
# Install dependencies
apt install php-curl php-xml php-mbstring php-imagick php-mysql
# With PostgreSQL
@LeeiFrankJaw
LeeiFrankJaw / get-ocserv.sh
Created July 9, 2020 21:00
Install ocserv 0.11.9 from source under Debian 10.4
git clone https://gitlab.com/openconnect/ocserv.git
cd ocserv/
apt install autoconf pkg-config libev-dev libwrap0-dev libpam0g-dev liblz4-dev libseccomp-dev libreadline-dev libnl-route-3-dev libkrb5-dev liboath-dev libradcli-dev libsystemd-dev protobuf-c-compiler gperf libprotobuf-c-dev libtalloc-dev libhttp-parser-dev libpcl1-dev libopts25-dev liblockfile-bin nuttcp lcov libuid-wrapper libpam-wrapper libnss-wrapper libsocket-wrapper gss-ntlmssp libpam-oath autogen
sh autogen.sh
./configure
make
make install
@LeeiFrankJaw
LeeiFrankJaw / compress.sh
Created June 19, 2023 02:58
Compress Apple HEVC HDR Videos
for i in *.mp4; do
ffmpeg -i "$i" -c:v libx265 -crf 30 -c:a copy -color_primaries bt2020 -colorspace bt2020nc -color_trc arib-std-b67 -map_metadata 0 -max_muxing_queue_size 1024 -n Compressed/${i::-4}.mp4;
done
@LeeiFrankJaw
LeeiFrankJaw / hocr2djvused.py
Last active June 19, 2023 03:06 — forked from char101/hocr2djvused.py
Converter from tesseract hocr to djvused commands (python 3, tested with tesseract 5.0.0 alpha)
import os
import re
import sys
from io import StringIO
from lxml import etree
SPECIAL_CHARACTERS = {
7: 'a', # BELL
8: 'b', # BS