作者:matrix
被围观: 3,542 次
发布时间:2017-02-11
分类:零零星星 |
无评论 »
重启系统发现mysql启动失败。环境为 ubuntu Lnmp
Starting MySQL. * The server quit without updating PID file (/var/run/mysqld/mysqld.pid).
/var/run/mysqld/ 目录中没有pid文件找到网上说的文件权限、磁盘已满,这些都不符合情况。
解决
删除文件my.cnf > rm /etc/mysql/my.cnf启动mysql
lnmp mysql start
最后启动成功就okpeace参考:http://blog.ich8.com/post/5635https://bbs.vpser.net/viewthread.php?tid=13217
作者:matrix
被围观: 4,196 次
发布时间:2017-01-15
分类:兼容并蓄 零零星星 |
无评论 »
Let’s Encrypt证书出来已经有很长时间,之前用主机未到期,也就干瞪眼。现在手上拿了一台有设备,其实算下来价格也都差不多,国外的速度是慢点,但是好处很多。测试环境:ubuntu 14 64bitlnmp 1.3
获取证书
git clone https://github.com/letsencrypt/letsencrypt cd letsencrypt./letsencrypt-auto certonly --standalone --email hhtjim@foxmail.com -d hhtjim.com -d www.hhtjim.com# 若服务器已经占用80端口开启webserver则只需执行webroot:# ./letsencrypt-auto certonly --webroot --email hhtjim@foxmail.com -d link.hhtjim.com
执行完上面三个命令之后会有图形界面出现选择Agree之后出现这个也就完成了证书的获取
安装证书
修......
作者:matrix
被围观: 4,321 次
发布时间:2017-01-13
分类:零零星星 |
无评论 »
这个季节看到TGP的LOL新闻页面的飘雪效果挺好看的。顺手就copy了下飘雪效果网上貌似大多数代码都是http://x-team.com 。css,js,png文件都整理出来了也就记录下。 都取自15w.com
直接盗链
建议代码放到html中的body标签中的底部加载
<link rel="stylesheet" href="//www.15w.com/ui/pages/others/2016/snow/css/snow.css?v3" type="text/css" /><script type="text/javascript" src="//www.15w.com/ui/pages/others/2016/snow/js/snow.js?v5"></script><script> createSnow("img/", 30);</script>
若是WordPress:
add_action('wp_footer', 'snow_footer');function snow_footer(){ if ('1' === dat......
作者:matrix
被围观: 3,891 次
发布时间:2017-01-11
分类:Wordpress 零零星星 |
一条评论 »
wp的页面都会加载类似下面的的javascript代码用来显示emoji表情。
{ "baseUrl": "https://s.w.org/images/core/emoji/2.2.1/72x72/", "ext": ".png", "svgUrl": "https://s.w.org/images/core/emoji/2.2.1/svg/", "svgExt": ".svg", "source": { "concatemoji": "https://www.hhtjim.com/wp-includes/js/wp-emoji-release.min.js?ver=dd887" }}
s.w.org毕竟是墙外的东西,很麻烦。将其替换为国内镜像地址。WordPress functions中添加
替换emoji源 s.w.orgfunction filter_baseurl(){ return set_url_scheme('//twemoji.maxcdn.com/72x72/');}function ilter_svgurl(){ return set_url_scheme('//twemoji.m......
作者:matrix
被围观: 4,287 次
发布时间:2017-01-02
分类:零零星星 |
无评论 »
修改对应域名的nginx配置文件 vi /usr/local/nginx/conf/vhost/域名重新配置nginx的配置文件
server { 。。。。。。 <strong>include typecho.conf; include enable-php-pathinfo.conf;</strong> 。。。。。。 }
参考:https://bbs.vpser.net/thread-13341-1-1.html
作者:matrix
被围观: 4,356 次
发布时间:2016-12-31
分类:零零星星 |
无评论 »
类似于TP5框架的软删除功能软删除的作用就是把数据加上删除标记,而不是真正的删除,同时也便于需要的时候进行数据的恢复。这里以数据库表Dynamics为例执行SQL语句给表新建字段delete_time:ALTER TABLE sx_dynamics ADD `delete_time` char(13) DEFAULT NULL COMMENT '删除时间';
新建Model层文件
<?php /** * Created by PhpStorm. * User: pang */namespace Home\Model;use Think\Model;use Think\Page;class DynamicsModel extends Model{ /** * 重写Model删除方法 实现TP5类似的软删除 * * @param bool $trueDel 是否真实删除数据 * @return mixed */ public function delete($trueDel = false) { ......
作者:matrix
被围观: 4,349 次
发布时间:2016-12-30
分类:零零星星 |
无评论 »
安装环境 按照ubuntu正常安装的时候却报错:Lnmp Unable to get linux distribution name, or do NOT support the current di原因是因为 /etc/issue 中记录的是linux发行版本:elementary OS LokiLnmp脚本无法识别出为ubuntu的系统内核
修改main.sh文件
文件路径:/lnmp1.3/include/main.sh搜索关键字Get_Dist_Name()查找该方法替换为一下内容:
Get_Dist_Name(){ if grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then DISTRO='CentOS' PM='yum' elif grep -Eqi "Red Hat Enterprise Linux Server" /etc/issue || grep -Eq "Red Hat Enterprise Linux Server" /etc/*-release; then ......
作者:matrix
被围观: 6,646 次
发布时间:2016-12-29
分类:零零星星 |
无评论 »
搭建方法:http://www.jianshu.com/p/b5c4fbadbfae
apt-get updateapt-get install python-pippip install shadowsocks
添加:/etc/shadowsocks.json
{"server":"my_server_ip","server_port":8388,"local_address": "127.0.0.1","local_port":1080,"password":"mypassword","timeout":300,"method":"aes-256-cfb","fast_open": false}
ssserver -c /etc/shadowsocks.json -d start我用ubuntu按照上面链接的方法来搭建的服务,安装运行到是ok,但是reboot重启ubuntu的时候就发现出现问题。
编辑/etc/rc.local
添加开机自启动的命令失败:ssserver -c /etc/shadowsocks.json -d startUbuntu下/etc/rc.local 文件修改之后没有成功。实际上系......