Skip to content

Instantly share code, notes, and snippets.

View taojuntjpp's full-sized avatar
🎯
Focusing

陶俊 taojuntjpp

🎯
Focusing
View GitHub Profile
@taojuntjpp
taojuntjpp / docker-registry-mirrors.md
Created February 19, 2025 05:48 — forked from y0ngb1n/docker-registry-mirrors.md
国内的 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]
"""
@taojuntjpp
taojuntjpp / README.md
Created August 30, 2017 07:10 — forked from magnetikonline/README.md
Example Nginx & PHP-FPM systemd service configs.

Example Nginx & PHP-FPM systemd service configs

A set of really basic systemd configs for starting Nginx and PHP-FPM on system boot.

  • Will ensure Nginx web server has started before kicking off PHP-FPM process.
  • PHP-FPM pid file placed in /run/php7, PHP7 PHP-FPM config at /etc/php7.
  • Based on usage with Ubuntu 16.04LTS.

Both scripts placed in /lib/systemd/system and enabled by the following:

@taojuntjpp
taojuntjpp / parallel-scp
Created August 22, 2016 05:55 — forked from andreipak/parallel-scp
Attempt to roll two useful pssh tools (parallel-ssh and parallel-scp) into reusable scripts with our old friend xargs. Link: http://90kts.com/2010/10/31/parallel-ssh-for-osx/
#!/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":
@taojuntjpp
taojuntjpp / logrotate-nginx
Created May 14, 2016 17:32 — forked from aputs/logrotate-nginx
logrotate config for nginx
/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)