Skip to content

Instantly share code, notes, and snippets.

user nginx;
worker_processes 3;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
multi_accept on;
use epoll;
}
upstream example.com.backend {
server 127.0.0.1:3000;
}
# redirect with
server {
listen 80;
server_name example.com *.example.com;
rewrite ^ http://www.example.com$request_uri? permanent;
}
#!/bin/bash
# djb svscan
#
# description: svscan
#
# chkconfig: 2345 96 98
# Source function library
. /etc/rc.d/init.d/functions
This patch causes the various qmail programs to generate date stamps in
the local timezone. I find GMT too annoying to convert from/to. I make
no warranties that it will work in your timezone, however it works for me.
Works with qmail 1.01 to 1.03.
To apply this patch, cd into the qmail source directory and type...
patch -s -p1 < patch-to-patch-file
--- qmail-1.03.orig/date822fmt.c Tue Apr 15 15:05:23 1997
#!/bin/bash
# via http://www.pictnotes.jp/wp/?p=202
#
# curl -o /tmp/install_qmail.sh https://gist.github.com/pacojp/5768857/raw
# /bin/bash /tmp/install_qmail.sh <HOSTNAME>
#
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
#!/bin/bash
#
# qmail
#
# chkconfig: 2345 80 30
# description: qmail start/stop script
# Source function library.
. /etc/rc.d/init.d/functions
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteLog "logs/rewrite_log"
#RewriteLogLevel 0
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/cgi-bin/qmailadmin(.*)?$ https://%{HTTP_HOST}/cgi-bin/qmailadmin [L,R]
</IfModule>
@pacojp
pacojp / bckconf
Created July 18, 2013 05:38
easy backup maker :)
#!/bin/sh
usage(){
echo "Usage: bckconf filename"
exit 1
}
# args error
[[ $# -eq 0 ]] && usage
use strict;
# a minimalistic configuration file for amavisd-new with all necessary settings
#
# see amavisd.conf-default for a list of all variables with their defaults;
# for more details see documentation in INSTALL, README_FILES/*
# and at http://www.ijs.si/software/amavisd/amavisd-new-docs.html
# COMMONLY ADJUSTED SETTINGS:
#!/bin/sh
# Example script for adding a Maildir to a Courier-IMAP virtual mail
# hierarchy.
# The script only looks at argument 3, assuming that it
# indicates the relative name of a maildir, such as
# "somedomain.com/peter/".
# This script should be run as the user which owns the maildirs. If