- 安装
sudo apt-get install ncdu
- 运行ncdu就可以查看各目录所占空间
- (注意:如果文件已经删除了,但是还有残留的进程引用它,df看到的空间使用量并没有减去那些已经删除的文件, 这时需要停止相应的进程)
碰到这种情况就需要运行以下命令:
lsof / | grep deleted
- 相关文章参考:https://www.digitalocean.com/community/questions/cannot-find-what-is-filling-up-disk-space-dev-vda1-is-100-full
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
# firewall | |
ufw allow ssh | |
ufw allow http | |
ufw allow https | |
ufw logging on | |
ufw enable | |
# check rule | |
ufw status numbered |
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
ls | grep 发货 | tr '\n' '\0' | xargs -0 rm |
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
# -*- coding: utf-8 -*- | |
from scrapy.item import Item, Field | |
class RamenStyle(Item): | |
shop_id = Field() | |
style = Field() | |
soup = Field() | |
class RamenReview(Item): | |
review_id = Field() |
###方法1: 可以将远端的github代码下到本地来修改,无须再自己fork一个新的项目,便于快速修改plugin中的错误, 下面是使用方法
Bundler also allows you to work against a git repository locally instead of using the remote version. This can be achieved by setting up a local override:
bundle config local.GEM_NAME /path/to/local/git/repository (bundle config local.active_shipping ~/gems/active_shipping/)
and setup the git repo pointing to a branch: gem 'active_utils', :github => 'Shopify/active_utils', :branch => '2.2.3'
##推荐使用方法2, 将github的源码copy到vendor下,然后在gemfile里面指定一下path##
比较2个文件内容的不同行数
sort file1 file2 | uniq -u > file3
查找文件中的重复行
cat file | sort | uniq -d
问题描述
使用redirect_to跳转时子域名丢失,比如跳转到subdomain.example.com/admins/users时nginx会帮你解析到subdomain.example.com/admins/.example.com/admins/users
解决方法
在nginx配置文件里面添加如下代码
proxy_redirect off;