Skip to content

Instantly share code, notes, and snippets.

View LeeiFrankJaw's full-sized avatar

Lei Zhao LeeiFrankJaw

View GitHub Profile
@LeeiFrankJaw
LeeiFrankJaw / get-getdns.sh
Last active April 24, 2018 07:00
Install getdns on Ubuntu 16.04 LTS
git clone git@github.com:getdnsapi/getdns.git
cd getdns/
git checkout v1.4.1
git submodule update --init
sudo apt install libunbound-dev libidn2-0-dev
libtoolize -ci
autoreconf -fi
./configure
make
sudo make install
@LeeiFrankJaw
LeeiFrankJaw / get-stubby.sh
Last active January 6, 2020 10:36
Install Stubby on Ubuntu 16.04 LTS
# In fact, getdns repo has stubby as a submodule and there is no need
# to clone a separate repo.
git clone git@github.com:getdnsapi/stubby.git
cd stubby/
# please refer to
# [get-getdns.sh](https://gist.github.com/LeeiFrankJaw/0068ea73267c165ee4bef091fc3822f2)
# for how to install the getdns dependency.
sudo apt install libyaml-dev
autoreconf -vfi
./configure
@LeeiFrankJaw
LeeiFrankJaw / get-openssh.sh
Created April 25, 2018 14:40
Install OpenSSH from source repo
git clone git://anongit.mindrot.org/openssh.git
cd openssh/
sudo apt build-dep openssh-client
git checkout V_7_7_P1
autoreconf
# Use the following command for clang compiler
# CC=clang LDFLAGS='-fuse-ld=lld -rtlib=compiler-rt' ./configure
./configure
make
# hack for solving "Privilege separation user sshd does not exist" error
@LeeiFrankJaw
LeeiFrankJaw / get-pyodbc.sh
Last active May 10, 2018 15:30
Install pyodbc over msodbcsql on the old Ubuntu 14.04 LTS
#!/usr/bin/env bash
# The library pyodbc requires unixodbc headers to compile, but the
# version of the unixodbc-dev provided by trusty mismatches that of
# unixodbc from the repository provided by Microsoft, so here I
# manually install the unixODBC with all things needed.
wget ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.1.tar.gz
tar xvf unixODBC-2.3.1.tar.gz
cd unixODBC-2.3.1/
./configure --disable-gui \
@LeeiFrankJaw
LeeiFrankJaw / print_password.sh
Last active October 5, 2018 14:50
Get mysql password set by mysql_config_editor
my_print_defaults -s client
# See also `mysql_config_editor`
@LeeiFrankJaw
LeeiFrankJaw / get-sql-server.sh
Last active June 6, 2018 12:17
Install SQL Server on Ubuntu 16.04.4 LTS
#!/usr/bin/env bash
sudo tee /etc/apt/sources.list.d/sql-server-xenial.list <<EOF
deb [arch=amd64] https://packages.microsoft.com/ubuntu/16.04/mssql-server-2017 xenial main
EOF
sudo tee /etc/apt/sources.list.d/microsoft-prod.list <<EOF
deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main
EOF
@LeeiFrankJaw
LeeiFrankJaw / iPhone-mencoder.sh
Last active October 3, 2019 12:11
Make iPhone compatible video with mencoder
mencoder input -o output.mp4 \
-of lavf -lavfopts format=mp4 \
-ovc x264 -x264encopts bframes=0:global_header \
# -ss 5:00 -endpos 5:00 \
-oac lavc -lavcopts acodec=ac3
# NOTE: THE OPTION -ovc copy SIMPLY DOES NOT WORK AND MENCODER CANNOT
# USE LIBAVCODEC PROPERLY. DO NOT WASTE TIME ON MENCODER LEARN ffmpeg
# INSTEAD.
@LeeiFrankJaw
LeeiFrankJaw / README.md
Last active October 16, 2018 09:10
Set up Gitlab Development Kit on Trisquel 8

Set up Gitlab Development Kit on Trisquel 8

  • Login as non-root user.

  • Install ruby with required version (2.4.4 at the time I wrote this), the gitlab site recommends using a ruby version manager (such as RVM, rbenv,

@LeeiFrankJaw
LeeiFrankJaw / install.sh
Last active November 3, 2018 10:36
Set up pagure on Trisquel 8
#!/bin/sh
# Please refer to the manual section from the site
# https://pagure.io/pagure
# python3-gdbm is not found in trisquel by default but preinstalled on
# ubuntu.
sudo apt install python3-dev python3-pip python3-venv python3-gdbm \
libgit2-dev redis-server libjpeg-dev libffi-dev
@LeeiFrankJaw
LeeiFrankJaw / combine.sh
Last active March 4, 2020 20:03
Convert HLS stream from m3u8 to MP4
# Convert HLS stream from m3u8 to MP4
gst-launch-1.0 -v mp4mux name=mux ! filesink location=output.mp4 filesrc location=GOPR7003.m3u8 ! hlsdemux ! decodebin name=decoder decoder. ! queue ! videoconvert ! x264enc ! mux. decoder. ! queue ! audioconvert ! voaacenc ! mux.
# Combine normal TS files into MP4
cvlc -v segment-*.ts \
--sout='#gather:file{dst=output.mp4}' \
--sout-keep \