Skip to content

Instantly share code, notes, and snippets.

@robinwl
robinwl / provision.sh
Last active July 3, 2017 13:33
Vagrant shell provisioner for creating a LAMP-stack
##
# Shell provisioner for LAMP
# Tested on Ubuntu 12.04
##
# Detect environment
source /etc/os-release
# Set non-interactive mode
export DEBIAN_FRONTEND=noninteractive
@robinwl
robinwl / provision-adnasa.sh
Last active August 29, 2015 14:07
Vagrant shell provisioner that installs RVM, Ruby, Bundler, Node.js, redis & MongoDB
# Set non-interactive mode
export DEBIAN_FRONTEND=noninteractive
# Update package mirrors and update base system
apt-get update
apt-get -y dist-upgrade
# Install packages
apt-get -y install git tree curl
@robinwl
robinwl / Vagrantfile
Created December 19, 2014 23:12
Vagrant docker fig
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "robin/trusty64"
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.provision "shell", inline: $shell
if Vagrant.has_plugin?("vagrant-vbguest") then
config.vbguest.auto_update = false
@robinwl
robinwl / interfaces
Created December 25, 2014 18:16
Ubuntu network interfaces virtualbox
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp
@robinwl
robinwl / Vagrantfile
Created January 16, 2015 19:16
Vagrantfile Trusty64
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "robin/trusty64"
config.vm.hostname = "trusty64"
config.vm.provision "shell", inline: $shell
if Vagrant.has_plugin?("vagrant-vbguest") then
config.vbguest.auto_update = false
end
@robinwl
robinwl / vhost.conf
Last active August 29, 2015 14:13
nginx vhost template
server {
##
# Basic config
##
listen 80;
listen 443 ssl spdy;
server_name _;
@robinwl
robinwl / Vagrantfile
Last active August 29, 2015 14:13
Vagrant-docker skel
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "robin/trusty64"
config.vm.hostname = "docker"
config.vm.provision "shell", inline: $shell
if Vagrant.has_plugin?("vagrant-vbguest") then
@robinwl
robinwl / gist:6e0eba6e4bc8dbf04c4c
Last active August 29, 2015 14:20
linux-dash nginx
server {
listen 80 default_server;
root /var/www/html/;
index index.html index.htm;
server_name _;
location / {
try_files $uri $uri/ =404;
}
@robinwl
robinwl / cache_params
Created May 1, 2015 07:41
nginx as TLS terminator/reverse cache proxy for Apache & ownCloud 8.x
proxy_cache_bypass $cookie_nocache $arg_nocache$arg_comment; # Defines conditions under which the response will not be taken from a cache. If at least one value of the string parameters is not empty and is not equal to “0” then the response will not be taken from the cache.
proxy_cache_bypass $http_pragma $http_authorization;
proxy_cache_key $scheme$proxy_host$request_uri; # Defines a key for caching.
proxy_cache_lock on; # When enabled, only one request at a time will be allowed to populate a new cache element identified according to the proxy_cache_key directive by passing a request to a proxied server.
proxy_cache_methods GET HEAD; # If the client request method is listed in this directive then the response will be cached. “GET” and “HEAD” methods are always added to the list, though it is recommended to specify them explicitly.
proxy_cache_min_uses 1; # Sets the number of requests after which the response will be cached.
@robinwl
robinwl / smartctl_hddtemp_
Created May 2, 2015 17:22
HDD temperature in Munin with smartmontools
#!/bin/bash
#
# Configuration
# -------------
# [smartctl_hddtemp_*]
# user root
# group root
# env.attribute 194 # Id of SMART attribute, you probably want to use 194. http://en.wikipedia.org/wiki/S.M.A.R.T.#Known_ATA_S.M.A.R.T._attributes
# env.warning 50 # The environment variables "warning" and "critical" sets the temperature from which Munin starts to warn.
# env.critical 55