Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Create swapfile if not already present. Default size is 2 GB.
if [ ${SWAP_SIZE_MEGABYTES:=2048} -eq 0 ];then
echo No swap size given, skipping.
else
if [ -e /swapfile ];then
echo /swapfile already exists, skipping.
else
echo Creating /swapfile of $SWAP_SIZE_MEGABYTES MB
#!/bin/bash
# Send Munin generated Varnish statistics by e-mail
VARNISH_LOCATION="Tokyo"
REPORT_PATH=/var/www/html/munin/localhost/localhost
EMAIL_RECIPIENT="admin@example.com"
EMAIL_SUBJECT="Varnish Weekly Statistics"
EMAIL_BODY="Weekly statistics attached."
hash mutt 2>&- || { echo -e >&2 "\nMutt not installed, aborting.\n"; exit 1; }
# VCL configuration file for Varnish
# Define which IP addresses or hosts have access to files that are
# blocked from the public internet
acl internal {
"localhost";
}
# Define origin servers
backend web { .host = "1.2.3.4"; .port = "80"; }