国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Use mycli (http://mycli.net/) through ssh | |
Usage: | |
$ mycli-ssh yourhost [extra args passed to mycli] | |
""" |
A set of really basic systemd
configs for starting Nginx and PHP-FPM on system boot.
/run/php7
, PHP7 PHP-FPM config at /etc/php7
.Both scripts placed in /lib/systemd/system
and enabled by the following:
#!/bin/bash | |
usage() | |
{ | |
cat << EOF | |
Usage: $0 [OPTIONS] -h hosts.txt local remote | |
-h hosts file (each line "host") | |
-r recusively copy directories (OPTIONAL) | |
-l username | |
-p max number of parallel threads (OPTIONAL) |
<?php | |
function convertToBytes($from) { | |
$number=substr($from,0,-2); | |
switch(strtoupper(substr($from,-2))){ | |
case "KB": | |
return $number*1024; | |
case "MB": | |
return $number*pow(1024,2); | |
case "GB": |
/var/log/nginx_*.log { | |
daily | |
compress | |
delaycompress | |
rotate 2 | |
missingok | |
nocreate | |
sharedscripts | |
postrotate | |
test ! -f /var/run/nginx.pid || kill -USR1 `cat /var/run/nginx.pid` |
server { | |
index index.php; | |
set $basepath "/var/www"; | |
set $domain $host; | |
# check one name domain for simple application | |
if ($domain ~ "^(.[^.]*)\.dev$") { | |
set $domain $1; | |
set $rootpath "${domain}"; |
#!/bin/bash | |
for filename in $( | |
find . -name "*.php" | |
) | |
do | |
r=`sed -n '$p' "$filename"` | |
if [[ $r == "?>" ]] | |
then | |
#sed -e '$d' "$filename" #for linux | |
sed -i '' '$d' "$filename" #for mac |
#!/bin/sh | |
# | |
# git autodeploy script when it matches the string "[deploy]" | |
# | |
# @author icyleaf <icyleaf.cn@gmail.com> | |
# @link http://icyleaf.com | |
# @version 0.1 | |
# | |
# Usage: | |
# 1. put this into the post-receive hook file itself below |
memcached 1.4.2 | |
-p <num> 监听的TCP端口(默认: 11211) | |
-U <num> 监听的UDP端口(默认: 11211, 0表示不监听) | |
-s <file> 用于监听的UNIX套接字路径(禁用网络支持) | |
-a <mask> UNIX套接字访问掩码,八进制数字(默认:0700) | |
-l <ip_addr> 监听的IP地址。(默认:INADDR_ANY,所有地址) | |
-d 作为守护进程来运行。 | |
-r 最大核心文件限制。 | |
-u <username> 设定进程所属用户。(只有root用户可以使用这个参数) | |
-m <num> 所有slab class可用内存的上限,以MB为单位。(默认:64MB) |