Ubuntu 安装 Phantomjs / Casperjs

下载源码包配置和编译 Phantomjs 和 Casperjs 总是觉得太麻烦,可以直接使用 npm

npm install -g phantomjs
npm install -g casperjs

安装目录会在安装过程中显示,通常会在 npm 安装目录的 lib/node_modules 下,然后我们可以做一次软链接方便实用

ln -s /usr/local/node/lib/node_modules/phantomjs/bin/phantomjs /usr/bin
ln -s /usr/local/node/lib/node_modules/casperjs/bin/casperjs /usr/bin

locale warning 怎么办

新配置的 vps 在 apt-get 时常常出现

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

网上搜索了一下解决方案,这里做个笔记


编辑 local 文件

vi /var/lib/locales/supported.d/local

输入以下内容

# This file names the currently supported and somewhat tested locales.
# If you have any additions please file a glibc bug report.
en_US.UTF-8 UTF-8
en_US ISO-8859-1
en_US.ISO-8859-15 ISO-8859-15
zh_CN.GB18030 GB18030
zh_CN.GBK GBK
zh_CN.UTF-8 UTF-8
zh_CN GB2312

重新生成一次 locale 即可

locale-gen --purge

Ubuntu 14 使用 root 登录 vps

今天再买了个 BudgetVM 的 vps,镜像使用 Ubuntu 14.04,创建后总是无法使用 root 进行 ssh 登录,随后发了 ticket 询问得到回复:

I see you have Ubuntu. Ubuntu 14 has disabled root login via SSH.

You will either need to enable the root login via SSH by directly editing /etc/ssh/sshd_config or creating an additional account with sudo privileges. You may do this by using the serial console function of your client area.

A "one liner" to complete this via command line is:

sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/g' /etc/ssh/sshd_config

Make sure you restart SSH services after.

他们镜像的 Ubuntu 14 禁止了 root 登录,在 /etc/ssh/sshd_config 修改后重启即可。

PermitRootLogin yes