By admin, 3 六月, 2015

参考:http://www.krizna.com/ubuntu/setup-ftp-server-on-ubuntu-14-04-vsftpd/

如果想用户可以访问用户目录以外的目录,不要添加ChrootDirectory %h

如果需要Chroot,用户目录的所有者必须是root,否则会出现broken pipe的错误。

标签

By admin, 26 五月, 2015
  1.  找到my.ini(或my.cnf)
  2. 找到my.ini里面的[mysqld]一行
  3. 在[mysqld]下一行插入skip-grant-tables,保存
  4. 重启mysql服务器,此后访问mysql无需授权,什么密码都行

 

如果你的mysql服务器可以被远程访问,那么还是重新设一个密码比较好,在可以运行SQL语句的地方(mysql命令行或phpMyAdmin里的SQL运行页面)运行:

 

UPDATE mysql.user SET Password=PASSWORD('new_password') WHERE User='root';

FLUSH PRIVILEGES;

标签

By admin, 25 五月, 2015

First, it's really a bad idea to use Drupal 8 beta version on production site like me. Because Drupal 8 beta release do not provide a way to upgrade between beta versions. The database and API are not frozen at all.

If you are unlucky like me, you can try following steps:

标签

By admin, 21 五月, 2015

今天帮朋友改一个WordPress网站,不知道他在哪里找来的一个叫muchun的主题,那代码的质量惨不忍睹。我想,大概WordPress的插件很多是不够专业的程序员编写的。作为一个专业的程序员,是万万不能用WordPress的!

网站页面代码在XML标签前被插入了很多空行,以至于整个页面的代码在Chrome里都被认为是body之下,没有了head。页面是能正常显示的,但是我无法忍受啊~~

这插入空行的位置还真不好找,自己找了很久没找到。后来找Google帮忙,把wp-config.php和functions.php这两个文件<?php ?>之外的空行删了就好了。

参考:https://validator.w3.org/feed/docs/error/WPBlankLine.html

标签

By admin, 21 五月, 2015

I am using Ubuntu 12.04. I put a backup.sh into /etc/cron.daily. But it doesn't run. I have confirmed that the script is runnable (chmod a+x).

After long time of trying, I find that I need to rename it as backup. File with postfix is ignored by cron. This is stupid!

By admin, 20 五月, 2015

Backbone 为复杂Javascript应用程序提供模型(models)、集合(collections)、视图(views)的结构。其中模型用于绑定键值数据和自定义事件;集合附有可枚举函数的丰富API; 视图可以声明事件处理函数,并通过RESTful JSON接口连接到应用程序。

标签

By admin, 19 五月, 2015

weike_student_wrong_questions表大概有150万行数据,其中(tid, cid)做了索引,weike_exam_files不到100行,tid做了索引。下面一条语句执行时间大概是1.3秒。

 

SELECT weike_student_wrong_questions.tid, name, exam_time,
update_time, cid
FROM weike_student_wrong_questions
INNER JOIN weike_exam_files
ON weike_student_wrong_questions.tid = weike_exam_files.tid
GROUP BY weike_student_wrong_questions.tid, cid
ORDER BY exam_time DESC, cid;

把语句换成下面之后,查询效率大概提高了1000倍。 

     

标签