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
<?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
./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
#将本地生成的公匙写入到远端服务器的验证文件中,实现无密码登录 | |
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
<?php | |
/** | |
* 轻量级pdo操作封装函数 | |
* @author [email protected] | |
* @version 2013-04-16 | |
* @todo 根据实际情况继续优化或者添加功能 | |
*/ | |
namespace dataservice\helper; | |
class PDOHelper |
NewerOlder