Skip to content

Instantly share code, notes, and snippets.

@itsuwari
Last active July 25, 2022 17:01
Show Gist options
  • Save itsuwari/00b90a80c0cce89c63efed1b43487141 to your computer and use it in GitHub Desktop.
Save itsuwari/00b90a80c0cce89c63efed1b43487141 to your computer and use it in GitHub Desktop.
Install openresty with Fancyindex
#!/bin/bash
#Install base pakages
sudo apt-get -y update && apt upgrade -y
sudo apt-get -y install ntpdate man man-db mtr ipset iperf3 dnsmasq python3-pip curl aria2 python3-lxml \
fuse build-essential git zip libpcre3-dev libevent-dev libssl-dev libcurl4-openssl-dev libgd-dev libgeoip-dev libpq-dev libxslt1-dev \
software-properties-common autotools-dev cdbs debhelper dh-autoreconf dpkg-dev gettext libev-dev libpcre3-dev libudns-dev pkg-config fakeroot devscripts \
autoconf libtool pkg-config python3-dev libssl-dev
sudo apt-get autoremove -y
# Update time
ntpdate pool.ntp.org
pip3 install you-get pony requests tinydb youtube-dl bs4 cfscrape hanziconv transmissionrpc pymysql
# Install rclone
curl -O https://downloads.rclone.org/rclone-current-linux-amd64.zip
unzip rclone-current-linux-amd64.zip
cd rclone-*-linux-amd64
sudo cp rclone /usr/bin/
sudo chown root:root /usr/bin/rclone
sudo chmod 755 /usr/bin/rclone
sudo mkdir -p /usr/local/share/man/man1
sudo cp rclone.1 /usr/local/share/man/man1/
sudo mandb
cd ..
rm rclone* -f
rm rclone* -rf
# Install BBR
modprobe tcp_bbr
echo "tcp_bbr" >> /etc/modules-load.d/modules.conf
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
sysctl -p
BUILDROOT=$(pwd)
# Download Nginx QUIC
wget https://hg.nginx.org/nginx/archive/tip.tar.gz
tar xzvf tip.tar.gz && rm tip.tar.gz
cd nginx*
# Download Fancyindex
git clone https://github.com/aperezdc/ngx-fancyindex
./auto/configure \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-client-body-temp-path=/var/lib/nginx/body \
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
--http-log-path=/var/log/nginx/access.log \
--http-proxy-temp-path=/var/lib/nginx/proxy \
--http-scgi-temp-path=/var/lib/nginx/scgi \
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
--lock-path=/var/lock/nginx.lock \
--pid-path=/var/run/nginx.pid \
--with-pcre-jit \
--with-http_stub_status_module \
--with-http_secure_link_module \
--with-http_auth_request_module \
--with-http_addition_module \
--with-http_auth_request_module \
--with-file-aio \
--with-http_dav_module \
--with-threads \
--with-stream \
--with-stream_ssl_module \
--with-stream_ssl_preread_module \
--with-http_gunzip_module \
--with-http_geoip_module \
--with-http_gzip_static_module \
--with-http_realip_module \
--with-http_stub_status_module \
--with-http_ssl_module \
--with-http_sub_module \
--with-http_v2_module \
--add-module=./ngx-fancyindex
make
sudo make install
sudo apt-get -y autoclean
sudo apt-get -y autoremove
#Make transmission
cd ~
wget 'https://github.com/transmission/transmission/releases/download/3.00/transmission-3.00.tar.xz'
tar xvf transmission-*.xz && rm tran*.xz
cd transmission*
CFLAGS="-Os -march=native" ./configure --enable-lightweight --enable-daemon --enable-utp
make
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment