This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 自动识别和添加wdcp php-fpm服务 | |
IS_SYSTEMCTL=0 | |
if command -v systemctl >/dev/null 2>&1; then | |
echo 'exists systemctl' | |
IS_SYSTEMCTL=1 | |
else | |
echo 'no exists systemctl' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 解决MAC合盖耗电问题 | |
# macOS Mojave 待机时多了个 tcpkeepalive 选项,大概会每晚掉电 20% ,关掉后基本就不掉电了。 | |
# 当然,关掉后可能用不了"find my mac"的功能! | |
sudo pmset -a tcpkeepalive 0 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server | |
{ | |
listen 80; | |
#listen [::]:80; | |
server_name mianfeibang.cn www.mianfeibang.cn; | |
index index.html index.htm index.php default.html default.htm default.php; | |
root /home/wwwroot/mianfeibang.cn; | |
include wordpress.conf; | |
#error_page 404 /404.html; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# install aria2 for centos 6.8 | |
# author: boxcore | |
# aria2 docs:https://github.com/aria2/aria2 | |
# more gnu project for download : http://ftp.gnu.org/gnu/ ; ftp://gcc.gnu.org/pub/gcc/infrastructure/ | |
# | |
# aria2 gui tools: | |
# for mac: https://github.com/yangshun1029/aria2gui/releases | |
# | |
yum install bison libssh2-devel expat-devel gmp-devel nettle-devel libuv-devel libssh2-devel zlib-devel c-ares-devel cppunit-devel gnutls-devel libgcrypt-devel libxml2-devel sqlite-devel gettext lzma-devel xz-devel gperftools gperftools-devel gperftools-libs jemalloc-devel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/bin/sh /usr/local/opt/mysql/bin/mysqld_safe --bind-address=127.0.0.1 --datadir=/usr/local/var/mysql | |
/usr/local/Cellar/mysql/5.7.11/bin/mysqld --basedir=/usr/local/Cellar/mysql/5.7.11 --datadir=/usr/local/var/mysql --plugin-dir=/usr/local/Cellar/mysql/5.7.11/lib/plugin --bind-address=127.0.0.1 --log-error=/usr/local/var/mysql/mysql-error.log --pid-file=/usr/local/var/mysql/mysql.pid | |
/bin/sh /usr/local/mysql/bin/mysqld_safe --defaults-file=/data/mysql/3306/my.cnf --user=mysql | |
/usr/local/mysql/bin/mysqld --defaults-file=/data/mysql/3306/my.cnf --basedir=/usr/local/mysql --datadir=/data/mysql/3306/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/data/mysql/3306/mysql_run.err --open-files-limit=65536 --pid-file=/data/mysql/3306/pid_mysql.pid --socket=/data/mysql/3306/mysqltmp/mysql.sock --port=3306 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* 判断数据保存或插入 | |
* | |
* @author boxcore | |
* @date 2016-07-18 | |
* @param object $db 数据库对象 | |
* @param string $table 表名称 | |
* @param array $data 单条数据 | |
* @param array $unque 查询唯一映射 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* 文件相关处理函数 | |
* | |
* @created 2016-06-13 | |
* @author boxcore | |
*/ | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* filesize() 函数在部分 x86 系统上读取大于 2GB 的文件会返回错误的值 | |
*/ | |
$file = "./testfile"; | |
if(!file_exists($file)){ | |
echo "File don't exist! please check: {$file}\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 通过lftp同步范例 | |
echo Script start at: `date +%Y-%m-%d %H:%M:%S` | |
HOST='your_ip' | |
USER='user_name' | |
PASS='pass_word' | |
LCD='/home/your_name/hkftp' | |
RCD='/' | |
/usr/sbin/lftp -u $USER,$PASS -e "mirror --delete --only-newer --verbose $RCD $LCD" $HOST | |
echo Script end at: `date +%Y-%m-%d %H:%M:%S` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// To be added to top of php file which serves the AJAX Request | |
// Checks for HTTP_ORIGIN against multiple domains | |
$http_origin = $_SERVER['HTTP_ORIGIN']; | |
if ($http_origin == "http://www.domain1.com" || $http_origin == "http://www.domain2.com" || $http_origin == "http://www.domain3.info") | |
{ | |
header('Access-Control-Allow-Origin: *'); | |
} |
NewerOlder