症状:
root@gs:~# dpkg-reconfigure locales
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US:",
LC_ALL = (unset),
LANG = "zh_CN.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the stand...
太tm坑了,登陆一直提示331 Please specify the password,明明我就设置密码了,输入的密码确认了N次没有问题,就是登陆不了。后来参考别的账号和目录发现FTP用户根目录权限是555(dr-xr-xr-x),原来是权限设置成777就登陆不了,尼玛你倒是告诉我权限设置的不对啊,一直让我输密码密码。
结论:
vsftpd设置用户目录权限的时候,必须设置根目录权限为555,至于根目录里面的权限随便设置
在小站点上,直接用git来部署php代码相当方便,你的远程站点以及本地版本库都有一个版本控制,追踪问题或者回滚是很轻松的事情。下面介绍用git部署时的设置步骤
在远程服务器的设置
假定你需要部署的代码在/var/www/yoursite
cd /var/www/yoursite
git init .
git config receive.denyCurrentBranch ignore
git config --bool receive.denyNonFastForwards false
cd .git/hooks
wget http://b...
论坛快速跳转关键字列表
Discuz! 支持自定义快速跳转页面,当某些操作完成后,可以不显示提示信息,直接跳转到新的页面,从而方便用户进行下一步操作,避免等待。 在实际使用当中,您根据需要,把关键字添加到快速跳转设置里面(后台 -- 基本设置 -- 界面与显示方式 -- [提示信息跳转设置 ]),让某些信息不显示而实现快速跳转。以下是 Discuz! 当中的一些常用信息的关键字:
关键字
提示信息页面或者作用
login_succeed
...
firefox基本上可以做到所见即所得,编辑中的样式跟发表以后的样式差别不会太大,用chrome我都不敢编辑博客文章,编辑几次就面目全非了,chrome会在编辑器中插入很多奇怪的垃圾代码。
当然如果用markdown什么浏览器都无所谓了,都是纯文本编辑,现在开发者用的也挺多,但所见即所得还是有它的优势的
rails的binding.pry调试很爽,在刷新网页的时候直接进入代码内部还原现场,直接查看、操作上下文的对象。其实python社区也有相应的实现,以django为例,在代码中插入:
import IPython
IPython.embed()
以如下代码为例:
def lists(request):
text = '哈哈嘻嘻12'
import IPython //插入这两行
IPython.embed() //插入这两行
return render(request, 'question/lists....
rvm 2.2.1@global do gem install phantomjs
使用方式跟ack差不多 http://blog.bccn.net/%E9%9D%99%E5%A4%9C%E6%80%9D/13430
安装及使用详情:https://github.com/ggreer/the_silver_searcher
rsync -azh /local/path user@host.com:/remote/path
刚才development环境下 sass 中的 image_url 失效了,运行下面的命令清空缓存解决:
rake assets:clobber
已经不需要自己写递归了,新版ruby直接提供了Find模块
require 'find'
Find.find('./') do |path|
puts path
end
rails的data-remote="true"很方便,链接加上这个属性点击链接即可在前端运行链接所指向的服务端返回的js代码。前端只需要下面几行代码
$(document).ready(function () {
$("a[data-remote=true]").click(function(e){
e.preventDefault();
$.getScript($(this).attr('href'));
});
});
很方便,以后可能用的到
https://glot.io/
Where:
class Teacher < ActiveRecord::Base
has_and_belongs_to_many :students
end
and
class Student < ActiveRecord::Base
has_and_belongs_to_many :teachers
end
for rails 4:
rails generate migration CreateJoinTableStudentTeacher student teacher
for rail...
~ gs$ brew install elasticsearch
==> Downloading https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch
######################################################################## 100.0%
curl: (33) HTTP server doesn't seem to support byte ranges. Cannot resume.
...
jQuery(function ($) {
$.extend({
form: function (url, data, method) {
if (method == null) method = 'POST';
if (data == null) data = {};
var form = $('<form>').attr({
method: method,
action: url
}).css({
display: 'none'
});
var addData = funct...
jQuery(function ($) {
$.extend({
form: function (url, data, method) {
if (method == null) method = 'POST';
if (data == null) data = {};
var form = $('<form>').attr({
method: method,
action: url
}).css({
display: 'none'
});
var addData = funct...
jQuery(function ($) {
$.extend({
form: function (url, data, method) {
if (method == null) method = 'POST';
if (data == null) data = {};
var form = $('<form>').attr({
method: method,
action: url
}).css({
display: 'none'
});
var addData = funct...
有时候在osx中,权限标识后面有@,如下:
-rw-r-----@
在osx中,这叫附加属性(extended attributes),ls -l@ 可以看到具体的附加属性,也可以用 xattr filename 来看
删除附加属性用 xattr -d com.apple.quarantine filename
cap -T