Skip to content

Instantly share code, notes, and snippets.

@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
<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>
#!/bin/bash
#
# qmail
#
# chkconfig: 2345 80 30
# description: qmail start/stop script
# Source function library.
. /etc/rc.d/init.d/functions
#!/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
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
# djb svscan
#
# description: svscan
#
# chkconfig: 2345 96 98
# Source function library
. /etc/rc.d/init.d/functions
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;
}
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 backend {
server unix:/var/run/nginx-backend.sock;
}
# inner reverse proxy(for cache)
server {
listen 3000;
#server_name www.example.com;
server_name _;
root /var/www/example.com/public_html;
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;
}