Skip to content

Instantly share code, notes, and snippets.

View deluge_install.sh
#!/bin/bash
# Installs deluge daemon + webui and systemd start scripts
# Tested on: Ubuntu Server 16.04.1 x64 / 4 Cores / 4GB RAM / 20 GB SSD
USER="rcguy"
# update the system first
sudo apt update && sudo apt upgrade -y
# add the deluge ppa so we get the most recent version
sudo add-apt-repository ppa:deluge-team/ppa
@rcguy
rcguy / vnstati.html
Created Aug 14, 2018
A simple webpage to show vnStati images
View vnstati.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>vnStati</title>
<link rel="shortcut icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAM1BMVEUAAAAABTMAAzMAADMAAzMAAzMAADEABTIAAzQAAzMAADMAAzMAADcAADAAACQAAzMAAAD4qojgAAAAD3RSTlMAN7kP8MgqOGPnGeAcIAcMvjsxAAAAAWJLR0QAiAUdSAAAAAlwSFlzAAAN1wAADdcBQiibeAAAAAd0SU1FB+IIDgUPHjyrz5wAAADASURBVFjD7dbZCsQgDIVhu9pt2vd/2ynacbokkJxAr5LLwP8hiGAIxFR1EyxTtVtnEfZ+swipNwhHDwulB4VTDwmXHhBuvVp49EqB6FUC2SsEphcLbC8V+vibIWdjWcRJdRUhZmDWVQ44IAKWT5oVBua8jQ444MB7wJof7gID9DjgAA5M/2/OmIGhLHoJ0HTsz6utREdgBWHPCuKeERQ9Kah6QlD2D0Hd3wSgvwhQfxLAvghwfwiGPgmmfhdqsv8CjMksPRWDjloAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTgtMDgtMTRUMDU6MTU6MzArMDI6MDCHAotxAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE4LTA4LTE0VDA1OjE1OjMwKzAyOjAw9l8zzQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAASUVORK
View rtorrent.service
[Unit]
Description=rTorrent Daemon
After=network.target
[Service]
Type=forking
KillMode=none
User=username
Group=username
ExecStartPre=-/bin/rm -f /home/username/.rtorrent/session/rtorrent.lock
View nginx.service
# Stop dance for nginx
# =======================
#
# ExecStop sends SIGSTOP (graceful stop) to the nginx process.
# If, after 5s (--retry QUIT/5) nginx is still running, systemd takes control
# and sends SIGTERM (fast shutdown) to the main process.
# After another 5s (TimeoutStopSec=5), and if nginx is alive, systemd sends
# SIGKILL to all the remaining processes in the process group (KillMode=mixed).
#
# nginx signals reference doc:
View irssi.service
[Unit]
Description=irssi daemon
After=network.target
[Service]
Type=forking
User=%i
ExecStart=/usr/bin/screen -dmS autodl irssi
ExecStop=/usr/bin/screen -S autodl -X stuff '/quit\n'
WorkingDirectory=%h
View nginx-min.sh
#!/bin/bash
# Dependencies
# * checkinstall: package the .deb
# * libpcre3, libpcre3-dev: required for HTTP rewrite module
# * zlib1g zlib1g-dbg zlib1g-dev: required for HTTP gzip module
# vars
OPENSSL_VER="1.1.0c"
NGINX_VER="1.11.8"
@rcguy
rcguy / rtorrent.sh
Last active Aug 14, 2018
a simple bash script to compile and build .deb packages for xmlrpc-c, libtorrent, and rtorrent
View rtorrent.sh
#!/bin/bash
# ==> VARIABLES <==
# Software Versions
LIBTORRENT_VER="0.13.6"
RTORRENT_VER="0.9.6"
XMLRPC_VER="1.39.12"
PKG_RELEASE="3"
PREFIX="/usr"
View nginx.sh
#!/bin/bash
# Dependencies
# * checkinstall: package the .deb
# * libpcre3, libpcre3-dev: required for HTTP rewrite module
# * zlib1g zlib1g-dbg zlib1g-dev: required for HTTP gzip module
# vars
OPENSSL_VER="1.1.0c"
NGINX_VER="1.11.8"
View compile-nginx.sh
#!/bin/bash
# Dependencies
# * checkinstall: package the .deb
# * libpcre3, libpcre3-dev: required for HTTP rewrite module
# * zlib1g zlib1g-dbg zlib1g-dev: required for HTTP gzip module
# vars
PAGESPEED_VER="1.11.33.2"
OPENSSL_VER="1.0.2h"
@rcguy
rcguy / lazyload.js
Created Oct 15, 2015
lazyload.js (c) Lorenzo Giuliani
View lazyload.js
/* lazyload.js (c) Lorenzo Giuliani
* MIT License (http://www.opensource.org/licenses/mit-license.html)
*
* expects a list of:
* `<img src="blank.gif" data-src="my_image.png" width="600" height="400" class="lazy">`
*/
!function(window){
var $q = function(q, res){
if (document.querySelectorAll) {