Skip to content

Instantly share code, notes, and snippets.

@HeraclesJam
HeraclesJam / unifi_ubuntu_2004.sh
Created April 18, 2022 07:25 — forked from davecoutts/unifi_ubuntu_2004.sh
Install Ubiquiti Unifi Controller on Ubuntu 20.04
# Install Ubiquiti Unifi Controller on Ubuntu 20.04.
# As tested on a fresh install of ubuntu-20.04.1-live-server, August 22nd 2020.
# Thanks to https://gist.github.com/tmuncks for posting the updated install steps.
sudo apt update
sudo apt install --yes apt-transport-https
echo 'deb https://www.ui.com/downloads/unifi/debian stable ubiquiti' | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list
sudo wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ui.com/unifi/unifi-repo.gpg
@HeraclesJam
HeraclesJam / [aria2] init script
Created February 17, 2017 15:04
讓 aria2 成為背景服務
#!/bin/sh
### BEGIN INIT INFO
# Provides: aria2
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Aria2 Downloader
@HeraclesJam
HeraclesJam / [aria2] aria2.conf
Last active March 27, 2023 03:58
aria2.conf 設定檔的範例
## Basic Options ##
# 下載目錄
dir=/mnt/usb
# 進度紀錄
input-file=/mnt/usb/.aria2/aria2.session
# 同時進行任務數
max-concurrent-downloads=10
# 斷線續傳
continue=true
@HeraclesJam
HeraclesJam / [Raspbian Jessie] use shairport-sync to build AirPlay Speaker
Created April 29, 2016 06:02
用 shairport-sync 在 Raspberry Pi 上實作 AirPlay 功能
git clone https://github.com/mikebrady/shairport-sync.git
sudo apt-get -y install build-essential git autoconf automake libtool libdaemon-dev libasound2-dev libpopt-dev libconfig-dev avahi-daemon libavahi-client-dev libssl-dev libpolarssl-dev libsoxr-dev
cd shairport-sync
autoreconf -i -f
./configure --with-alsa --with-stdout --with-pipe --with-avahi --with-ssl=openssl --with-metadata --with-systemd
make
getent group shairport-sync &> /dev/null || sudo groupadd -r shairport-sync > /dev/null
getent passwd shairport-sync &> /dev/null || sudo useradd -r -M -g shairport-sync -s /usr/bin/nologin -G audio shairport-sync > /dev/null
sudo make install
sudo systemctl restart shairport-sync && sudo systemctl status shairport-sync
@HeraclesJam
HeraclesJam / [CentOS 7] Upgrade kernel from ELRepo repository
Last active March 10, 2016 19:20
從 ELRepo 套件庫升級 CentOS 7 的核心
sudo rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
sudo yum -y --enablerepo=elrepo-kernel install kernel-ml