Skip to content

Instantly share code, notes, and snippets.

View xluffy's full-sized avatar
😶
&>/dev/null

xluffy xluffy

😶
&>/dev/null
View GitHub Profile
@xluffy
xluffy / quine2.sh
Created May 5, 2015 03:38
quine2.sh
#!/bin/cat
@xluffy
xluffy / nginx_build.sh
Last active April 22, 2016 14:41
build nginx on container centos:centos6
yum install vim tar wget make automake autoconf gcc gcc-c++ pcre-devel openssl-devel
mkdir ~/src
mkdir ~/src/modules
cd ~/src
wget -O modules/echo-nginx-module.tar.gz https://github.com/openresty/echo-nginx-module/archive/v0.57.tar.gz
tar -xvfz modules/echo-nginx-module.tar.gz -c modules
wget -O modules/header-more-nginx.tar.gz https://github.com/openresty/headers-more-nginx-module/archive/v0.25.tar.gz
@xluffy
xluffy / nginx-init-script.sh
Last active December 5, 2016 08:57
nginx-init-script
# Short-Description: start and stop nginx
#!/bin/sh
#
# nginx Startup script for nginx
#
# chkconfig: - 85 15
# processname: nginx
# config: /etc/nginx/nginx.conf
# config: /etc/sysconfig/nginx
# pidfile: /var/run/nginx.pid
@xluffy
xluffy / supervisord-init.sh
Created June 10, 2015 16:51
supervisord-init
#!/bin/bash
. /etc/init.d/functions
DAEMON=/usr/bin/supervisord
PIDFILE=/var/run/supervisord.pid
[ -x "$DAEMON" ] || exit 0
start() {
@xluffy
xluffy / supervisord.conf
Created June 11, 2015 01:51
supervisord.conf
[unix_http_server]
file=/var/run/supervisor.sock ; (the path to the socket file)
chmod=0700 ; socket file mode (default 0700)
[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
loglevel=info ; (log level;default info; others: debug,warn,trace)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
@xluffy
xluffy / poc.conf
Created June 11, 2015 01:55
poc.conf
[program:poc]
command=echo
process_name=%(program_name)s
numprocs=1
directory=$_workdir
umask=022
priority=999
autostart=true
autorestart=true
startsecs=1
@xluffy
xluffy / init.d-haproxy
Created June 16, 2015 02:51
init.d-haproxy
#!/bin/sh
### BEGIN INIT INFO
# Provides: haproxy
# Required-Start: $local_fs $network $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: fast and reliable load balancing reverse proxy
# Description: This file should be used to start and stop haproxy.
### END INIT INFO
@xluffy
xluffy / init.d-haproxy-ssl.sh
Created June 16, 2015 02:52
init.d-haproxy-ssl
#!/bin/sh
### BEGIN INIT INFO
# Provides: haproxy
# Required-Start: $local_fs $network $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: fast and reliable load balancing reverse proxy
# Description: This file should be used to start and stop haproxy.
### END INIT INFO
@xluffy
xluffy / supervisord.md
Last active February 21, 2021 09:08
supervisord

Supervisord

1. Giới thiệu

Supervisord là công cụ quản lý unix process

Một trong những ứng dụng của Supervisor là quản lý background process dạng Worker.

@xluffy
xluffy / vpnserver
Last active August 29, 2015 14:27
vpnserver init-script
#!/bin/sh
# chkconfig: 2345 99 01
# description: SoftEther VPN Server
DAEMON=/home/vpnserver/vpnserver
LOCK=/var/lock/subsys/vpnserver
test -x $DAEMON || exit 0
case "$1" in