二蛋 发布的文章

Linode机房数据中心迁移教程

使用Linode VPS有半年多了,随着今年三次免费升级(先是流量,再是内存、 硬盘),东京机房随着大量国人的涌入,现在国内访问速度越来越慢,终于忍不可忍,决定迁移至Fremont,现将所有步骤都记录如下:

第一步
登陆linode后台账户,在Support导航菜单打开一个TK,选择"Regarding"的时候一定要选择我们需要迁移的VPS,如果你有多个VPS千万不要选错了,到时候可能数据一去不复返。提交TK的内容很简单:

I want migrate the host to Fremont

第二步
大约2分钟左右,就会收到邮件提醒,然后进入linode后台TK处看到给我们的回信,全文内容如下:

Hello,
Your migration to a different datacenter has been configured. Please log into the Linode Manager, shut down, and click the migrate button to move to your new server. Your disk images will be moved with you. The migration should take approximately 10-15 minutes per gigabyte of data to complete. Please note that any existing backups for this Linode will be purged and will not be recoverable after you initiate the migration.
Your new IP address(es) are:
106.187.93.187
We ask that you begin this migration within 24 hours and let us know when it is complete. Thanks in advance!
Regards,
Dolores

告诉我们迁移后的IP地址,迁移数据之前需要关闭VPS。

- 阅读剩余部分 -

为MySQL生成SSL证书和密钥

MySQL支持SSL通信,不过需要自行生成所需要的证书和密钥。

生成过程中请根据提示提供相应的信息。如果证书只是用来测试,一路回车即可;如果在实际环境中使用,尽量提供有意义的信息。如果某个信息要留空,可以输入英文句号(.)。请自行保存生成过程中所输入的证书密码。

1、准备工作
创建干净的环境:

rm -rf newcerts
mkdir newcerts && cd newcerts

2、生成CA证书
需要注意,CA证书的Comman Name不能与服务器请求文件和客户端的请求文件的Comman Name相同,否则证书验证阶段会报类似“error 18 at 0 depth lookup:self signed certificate”的错误。命令如下:

openssl genrsa 2048 > cakey.pem
openssl req -new -x509 -nodes -days 3600 -key cakey.pem -out cacert.pem

- 阅读剩余部分 -

英文版windows 2003汉化后打开任务管理器卡死系统无响应的解决方法

今天在给一台英文版windows 2003系统的服务器汉化后,打开任务管理器时经常卡死.远程桌面无响应.甚是郁闷,跑微软网站一顿猛搜终于找到了问题的原因:
安装中文补丁后注册表中字体排列的顺序不一致导致.解决方法也很简单,只需把

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink

下 Tahoma 和 Microsoft Sans Serif 两个键值的顺序统一即可.

deluge忘记WebUI密码后的重置方法

首先需要停止WebUI

killall deluged
killall deluge-web

然后可以通过删除deluge配置目录下的web.conf文件来重置密码,该文件的默认位置:

~/.config/deluge/

注意:删除该文件后,WebUI上的设置也将初始化。

当然,你也可以通过下面的脚本来重设密码:

#!/usr/bin/env python
# Changes the password for Deluge's WebUI

from deluge.config import Config
import hashlib
import os.path
import sys

if len(sys.argv) == 2:
    deluge_dir = os.path.expanduser(sys.argv[1])

    if os.path.isdir(deluge_dir):
        try:
            config = Config("web.conf", config_dir=deluge_dir)
        except IOError, e:
            print "Can't open web ui config file: ", e
        else:
            password = raw_input("Enter new password: ")
            s = hashlib.sha1()
            s.update(config['pwd_salt'])
            s.update(password)
            config['pwd_sha1'] = s.hexdigest()
            try:
                config.save()
            except IOError, e:
                print "Couldn't save new password: ", e
            else:
                print "New password successfully set!"
    else:
        print "%s is not a directory!" % deluge_dir
else:
    print "Usage: %s <deluge config dir>" % (os.path.basename(sys.argv[0]))

现在启动deluge和webui

deluged
deluge-web --fork

重置后的密码为 deluge

修改rutorrent密码的方法

首先需要安装二个软件:

apt-get install apache2-utils mini-httpd

然后需要找到rutorrent密码管理的文件:

find / -name rutorrent_passwd

这是在整个系统中查找 rutorrent_passwd 文件。我这里查找到的路径是:

/etc/apache2/rutorrent_passwd

然后执行修改密码命令:

htpasswd /etc/apache2/rutorrent_passwd 2dan

上面的 2dan 就是你登录rutorrent的用户名
根据提示输入新密码并确认新密码,然后就可以了。