Skip to content

Instantly share code, notes, and snippets.

@rcguy
rcguy / ownCloud.sh
Last active Aug 29, 2015
Non-Interactive Script that adds the ownCloud apt repository, installs ownCloud, then creates a MySQL user & database for it
View ownCloud.sh
#!/bin/bash
# Installs ownCloud and setup the MySQL Database on Ubuntu 14.10
# Tested on: Ubuntu Server 14.10 - x64 + x86 / 2 Cores / 2GB RAM / 20 GB SSD / VPS
# ==> USER VARIABLES <==
# mysql variables
MYSQL_ROOT_PASS="root"
DB_NAME="owncloud"
DB_USER="owncloud"
DB_USER_PASS="owncloud"
@rcguy
rcguy / MediaWiki.sh
Last active Aug 29, 2015
Non-Interactive Script that installs MediaWiki, LAMP, and sets up the MySQL Database on Ubuntu 14.10
View MediaWiki.sh
#!/bin/bash
# Installs MediaWiki, LAMP, and setup the MySQL Database on Ubuntu 14.10
# Tested on: Ubuntu Server 14.10 - x64 / 2 Cores / 2GB RAM / 20 GB SSD / VPS
# ==> USER VARIABLES <==
MYSQL_ROOT_PASSWORD="root"
DB_NAME="mediawiki"
DB_USER="mediawiki"
DB_USER_PASSWORD="mediawiki"
@rcguy
rcguy / insurgency.sh
Last active Aug 29, 2015
Installs INSURGENCY (2014) Dedicated Server on Ubuntu
View insurgency.sh
#!/bin/bash
# Name: install-insurgency.sh
# Version: 1.0
# Author: rcguy
# Updated: 03.09.2015
# Tested on: Ubuntu Server 14.10 x64 / 2 Cores / 2GB RAM / 20 GB SSD
# ==> USER VARIABLES <==
STEAM_USER="steam" # user to run the game-server
@rcguy
rcguy / playAudio.html
Last active Aug 29, 2015
play audio using a button/javascript on an html webpage
View playAudio.html
<!DOCTYPE html>
<html>
<audio id="audio1" src="audio1.ogg" autobuffer></audio>
<script>
var aid = document.getElementById("audio1");
aid.volume = 0.2;
function EvalSound(soundobj) {
var thissound=document.getElementById(soundobj);
@rcguy
rcguy / build-rtl.sh
Last active Aug 29, 2015
compile rtl-sdr for the raspberrypi
View build-rtl.sh
#!/bin/bash
sudo apt-get update
sudo apt-get upgrade
sudo printf 'blacklist dvb_usb_rtl28xxu\nblacklist rtl2832\nblacklist rtl2830' > /etc/modprobe.d/nortl.conf
sudo apt-get install git-core git cmake libusb-1.0-0-dev build-essential -y
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
@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) {
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"
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"
@rcguy
rcguy / webmin.sh
Last active Jan 15, 2017
Non-Interactive Script that adds the Webmin apt repository then installs Webmin and dependencies
View webmin.sh
#!/bin/bash
# Adds the Webmin apt repository then installs Webmin and dependencies
# Tested on: Ubuntu Server 14.10 - x64 + x86 / 2 Cores / 2GB RAM / 20 GB SSD / VPS
# ==> MAIN PROGRAM <==
set -e
cat >>/etc/apt/sources.list.d/webmin.list <<EOF
# webmin
deb http://download.webmin.com/download/repository sarge contrib
EOF
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