Linux
小贴士
tar zxvf file.tar.gz -C /target/dir 可以解压 tar 包到指定目录。
tar jxvf file.tar.gz2  解压 tar.gz2 文件。
Debian 和 Ubuntu 下安装语言包:
$ cd /usr/share/locales $ ./install-language-pack zh_CN $ dpkg-reconfigure locales
也有可能直接 dpkg-reconfigure locales 就出来一个安装语言包的命令。
如果问题还是没有解决,点这里!
疑难杂症
nginx %document_root% 引发的 php 404 问题 需求是这样的,我需要在 nginx 中配置一个 phpmyadmin, 然后写了个 extra/phpmyadmin.conf 文件, include 到需要的网站中。比如说对于 ktmud.com 这个网站,有一个 sites/ktmud.com.conf 这个文件,内容如下:
server {
    listen       80;
    server_name  ktmud.com;
    location / {
        root   /srv/http/ktmud.com; 
        index  index.html index.htm index.php;
    }
    
    include extra/phpmyadmin.conf;
    
    location ~ /\.ht {
        deny  all;
    }
}  
然后 extra/phpmyadmin.conf 的内容如下:
location /phpmyadmin {   
    root    /usr/share/webapps;   
    index   index.php;   
}   
 
location ~ \.php$ {   
    set $php_root   $document_root;   
    if ($request_uri ~* /phpmyadmin) {   
        set $php_root /usr/share/webapps;   
    }   
 
    fastcgi_pass   unix:/var/run/php-fpm/php-fpm.sock; 
    fastcgi_index  index.php;   
    fastcgi_param  SCRIPT_FILENAME  $php_root$fastcgi_script_name;   
    #fastcgi_param  HTTPS on; 
    include  fastcgi_params; 
}   
之后就发现访问 php 文件一片空白,并且返回状态码 404 。使用 rewrite 法 debug ,发现是传给 cgi 的 %document_root% 不对。它居然用了默认的 /usr/html/ 。看来在 ktmud.com.conf 这个文件里设定的 root 没有生效。然后 Google 了好大一会儿,才发现,这个 root 不能写在 Location 里!他只在 Location / {}  这块大括号里生效!解决办法当然是去掉 Location / 咯!
轻松你的生活
Bash 脚本让生活更轻松
营造堪比 Windows 的体验
- 
安装 Dropbox 并翻墙
 
先下载Dropbox的安装包,然后根据这篇文章的的指导,下载 Dropbox Daemon,成功启动后手动填写代理地址即可。