Skip to content

Instantly share code, notes, and snippets.

View LeeiFrankJaw's full-sized avatar

Lei Zhao LeeiFrankJaw

View GitHub Profile
@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 / 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-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 / 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-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-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-squid.sh
Last active August 14, 2018 10:14
Compile Squid from Source for Ubuntu 16.04.3 LTS
wget http://www.squid-cache.org/Versions/v3/3.5/squid-3.5.27.tar.xz
tar xvf squid-3.5.27.tar.xz
cd squid-3.5.27/
./configure --prefix=/usr/local \
--exec-prefix='${prefix}' \
--localstatedir=/var \
--libexecdir='${prefix}/libexec/squid' \
--datadir='${prefix}/share/squid' \
--sysconfdir=/etc/squid \
--with-default-user=proxy \
@LeeiFrankJaw
LeeiFrankJaw / get-python.sh
Last active February 13, 2018 15:54
Build python from source
git clone git@github.com:python/cpython.git
cd cpython/
git checkout v3.6.4
sudo apt build-dep python3.5
# git checkout v2.7.14
# sudo apt build-dep python2.7
./configure
# For python2, the default config won't install pip.
# ./configure --with-ensurepip
make
@LeeiFrankJaw
LeeiFrankJaw / get-mu.sh
Last active March 12, 2019 19:50
Install mu from source repo
#!/bin/bash
git clone git@github.com:djcb/mu.git
cd mu/
git checkout v1.0
sudo apt install automake autoconf-archive libglib2.0-dev libxapian-dev libgmime-2.6-dev libunwind-dev
./autogen.sh
# compile with Clang
# CC=clang CXX=clang++ LDFLAGS='-fuse-ld=lld' ./autogen.sh
make
@LeeiFrankJaw
LeeiFrankJaw / get-orgmode.sh
Last active January 24, 2018 07:59
Install org-mode from repo
git clone https://code.orgmode.org/bzg/org-mode.git
cd org-mode/
git checkout release_9.1.6
make compile info
emacs -L lisp/ -L contrib/lisp/ --batch -f batch-byte-compile contrib/lisp/*.el