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 | |
/** | |
* 轻量级pdo操作封装函数 | |
* @author [email protected] | |
* @version 2013-04-16 | |
* @todo 根据实际情况继续优化或者添加功能 | |
*/ | |
namespace dataservice\helper; | |
class PDOHelper |
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
#将本地生成的公匙写入到远端服务器的验证文件中,实现无密码登录 | |
cat ~/.ssh/id_rsa.pub | ssh user@host "cat - >> ~/.ssh/authorized_keys" | |
#生成ssh密匙命令在当前用户家目录 | |
ssh-keygen | |
#显示系统有多少用户 | |
cat /etc/passwd | cut -d: -f1 | |
#ssh登陆之后执行一个命令 | |
ssh -t [email protected] "cd /data ; bash" |
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
./configure\ | |
--with-config-file-path=/usr/local\ | |
--with-config-file-path=/usr/local/etc/php\ | |
--enable-fpm\ | |
--with-fpm-user=php-fpm\ | |
--with-fpm-group=php-fpm\ | |
--enable-mysqlnd\ | |
--with-mysqli\ | |
--with-pdo-mysql\ | |
--with-mysql=mysqlnd\ |
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 | |
// No, Thanks. Direct file access forbidden. | |
! defined( 'ABSPATH' ) AND exit; | |
// INIT | |
add_action( 'after_setup_theme', array( 'unavailable_post_status', 'init' ) ); | |
class unavailable_post_status extends wp_custom_post_status | |
{ | |
/** |
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
1 打印前一天时间 | |
<?php | |
echo date("Y-m-d H:i:s", strtotime("-1 days")); | |
?> | |
2 过滤html代码 | |
如果此题单纯值的html代码,则 htmlspecialchars($str),处理输入存储 | |
如果包含用户输入过滤,则sql语句防注入,过滤关键词,使用pdo的时候prepare sql语句 ' 转义 | |
还有和谐社会的关键词过滤(这个非技术而属于政治了) | |
php 原生 Filler 族函数能做相当一部分工作,可在此基础上扩展一个过滤类 |
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
./configure --prefix=/usr/local\ | |
--conf-path=/usr/local/etc/nginx/\ | |
--user=nginx\ | |
--group=www\ | |
--with-http_ssl_module\ | |
--with-http_realip_module\ | |
--with-http_gunzip_module\ | |
--with-google_perftools_module | |
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 | |
# | |
# nginx - this script starts and stops the nginx daemon | |
# | |
# chkconfig: - 85 15 | |
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \ | |
# proxy and IMAP/POP3 proxy server | |
# processname: nginx | |
# config: /etc/nginx/nginx.conf | |
# config: /etc/sysconfig/nginx |
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
To start mysqld at boot time you have to copy | |
support-files/mysql.server to the right place for your system | |
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! | |
To do so, start the server, then issue the following commands: | |
/usr/local/mysql-5.6.13/bin/mysqladmin -u root password 'new-password' | |
/usr/local/mysql-5.6.13/bin/mysqladmin -u root -h localhost.localdomain password 'new-password' | |
Alternatively you can run: |
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
1 php json_encode | |
假设encode编码的源数据是 : array(1,2,3,4,5,5),那么json_encode的结果是数组 | |
假设encode编码的源数据是:array(1=>1,2=>3),那么json_encode的结果是对象 | |
json_encode默认把关联数组编码为对象 | |
这个细节在和前端js交互传递数据的时候非常重要 |
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
"========================================== | |
" Author: wklken | |
" Version: 6 | |
" Email: [email protected] | |
" BlogPost: http://wklken.me | |
" ReadMe: README.md | |
" Last_modify: 2013-08-04 | |
" Github: " https://github.com/wklken/k-vim | |
" Sections: | |
" ->General 基础设置 |
OlderNewer