Skip to content

Instantly share code, notes, and snippets.

View valberg's full-sized avatar

Víðir Valberg Guðmundsson valberg

View GitHub Profile
@halfd
halfd / gist:6670541
Created September 23, 2013 13:39
Maintenance mode in NGINX - the quick hack. Turn on/off by placing HTML file in relevant folder
# Variable used for multiple IF hack
set $is_maintenance "";
# Check for notice HTML file
if (-f /var/www/django/kontrafon/templates/maintenance.html) {
set $is_maintenance M;
}
# Use this to circumvent maintenance message
if ($remote_addr != "1.2.3.4") {
@sshine
sshine / gist:4142387
Created November 25, 2012 04:23
Printing at DIKU
#!/bin/sh
PRINTER=s2a
COPIES=1
ARGS=""
HOST=tyr
DRY=0
if ! opts=$(getopt -o p:n:r:h:fd24 -l fit,duplex,host:,range:,dry -- "$@")
then
echo "Usage: dprint [-p printer] [-n copies] [--fit] [--duplex] [-2 | -4]"