ubuntu出现perl: warning: Falling back to the standard locale ("C")的解决办法

症状: 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...
Linux | 2015-09-24 00:47 | 阅读 6875 次 | 评论 0 条

vsftpd无法登陆的原因竟然是根目录权限不对

太tm坑了,登陆一直提示331 Please specify the password,明明我就设置密码了,输入的密码确认了N次没有问题,就是登陆不了。后来参考别的账号和目录发现FTP用户根目录权限是555(dr-xr-xr-x),原来是权限设置成777就登陆不了,尼玛你倒是告诉我权限设置的不对啊,一直让我输密码密码。 结论: vsftpd设置用户目录权限的时候,必须设置根目录权限为555,至于根目录里面的权限随便设置
Linux | 2015-09-18 22:40 | 阅读 10447 次 | 评论 3 条

用git部署站点

在小站点上,直接用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...
Git | 2015-09-12 13:40 | 阅读 2667 次 | 评论 0 条

论坛快速跳转关键字列表

论坛快速跳转关键字列表 Discuz! 支持自定义快速跳转页面,当某些操作完成后,可以不显示提示信息,直接跳转到新的页面,从而方便用户进行下一步操作,避免等待。 在实际使用当中,您根据需要,把关键字添加到快速跳转设置里面(后台 -- 基本设置 -- 界面与显示方式 -- [提示信息跳转设置 ]),让某些信息不显示而实现快速跳转。以下是 Discuz! 当中的一些常用信息的关键字: 关键字 提示信息页面或者作用 login_succeed ...
论坛维护 | 2015-09-09 18:17 | 阅读 2425 次 | 评论 0 条

chrome对在线编辑器的支持不如firefox好

firefox基本上可以做到所见即所得,编辑中的样式跟发表以后的样式差别不会太大,用chrome我都不敢编辑博客文章,编辑几次就面目全非了,chrome会在编辑器中插入很多奇怪的垃圾代码。 当然如果用markdown什么浏览器都无所谓了,都是纯文本编辑,现在开发者用的也挺多,但所见即所得还是有它的优势的
心情随笔 | 2015-09-05 14:04 | 阅读 3147 次 | 评论 0 条

在django中实现类似rails的binding.pry调试功能

rails的binding.pry调试很爽,在刷新网页的时候直接进入代码内部还原现场,直接查看、操作上下文的对象。其实python社区也有相应的实现,以django为例,在代码中插入: import IPython IPython.embed() 以如下代码为例: def lists(request): text = '哈哈嘻嘻12' import IPython //插入这两行 IPython.embed() //插入这两行 return render(request, 'question/lists....
Python | 2015-09-05 13:56 | 阅读 4355 次 | 评论 0 条

rvm全局(global)安装gem

rvm 2.2.1@global do gem install phantomjs
Ruby | 2015-08-03 15:01 | 阅读 3234 次 | 评论 0 条

linux下比ack速度更快的代码搜索工具the_silver_searcher

使用方式跟ack差不多 http://blog.bccn.net/%E9%9D%99%E5%A4%9C%E6%80%9D/13430 安装及使用详情:https://github.com/ggreer/the_silver_searcher
Linux | 2015-07-31 14:04 | 阅读 4380 次 | 评论 0 条

使用rsync命令同步服务器文件夹

rsync -azh /local/path user@host.com:/remote/path
Linux | 2015-07-24 20:32 | 阅读 2719 次 | 评论 0 条

rails清理assets缓存的方法

刚才development环境下 sass 中的 image_url 失效了,运行下面的命令清空缓存解决: rake assets:clobber
Ruby | 2015-07-22 15:12 | 阅读 3492 次 | 评论 0 条

ruby遍历文件夹

已经不需要自己写递归了,新版ruby直接提供了Find模块 require 'find' Find.find('./') do |path| puts path end
Ruby | 2015-07-22 10:50 | 阅读 5014 次 | 评论 0 条

几行js代码实现前端支持rails的data-remote="true"

rails的data-remote="true"很方便,链接加上这个属性点击链接即可在前端运行链接所指向的服务端返回的js代码。前端只需要下面几行代码 $(document).ready(function () { $("a[data-remote=true]").click(function(e){ e.preventDefault(); $.getScript($(this).attr('href')); }); });
WEB开发 | 2015-07-14 09:59 | 阅读 4446 次 | 评论 0 条

glot,在线运行代码的平台

很方便,以后可能用的到 https://glot.io/
默认分类 | 2015-07-05 09:22 | 阅读 4379 次 | 评论 0 条

rails用generate为两个模型创建has_and_belongs_to_many中间表

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...
Ruby | 2015-06-30 09:57 | 阅读 5040 次 | 评论 0 条

安装elasticsearch后的相关配置信息

~ 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. ...
Linux | 2015-06-17 15:20 | 阅读 2987 次 | 评论 0 条

用jquery实现post请求(非ajax)

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...
WEB开发 | 2015-05-09 10:32 | 阅读 3868 次 | 评论 1 条

用jquery实现post请求(非ajax)

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...
WEB开发 | 2015-05-09 10:31 | 阅读 8064 次 | 评论 0 条

用jquery实现post请求(非ajax)

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...
WEB开发 | 2015-05-09 10:31 | 阅读 1921 次 | 评论 0 条

osx文件权限中的@(附加属性xattr),极其删除的方法

有时候在osx中,权限标识后面有@,如下: -rw-r-----@ 在osx中,这叫附加属性(extended attributes),ls -l@ 可以看到具体的附加属性,也可以用 xattr filename 来看 删除附加属性用 xattr -d com.apple.quarantine filename
Mac | 2015-05-07 13:09 | 阅读 9976 次 | 评论 0 条

capistrano列出所有命令(task)

cap -T
Ruby | 2015-05-06 21:14 | 阅读 2431 次 | 评论 0 条
浏览2800495次
文章归档