异度部落格

学习是一种生活态度。

0%

OS:Ubuntu 8.04

在编译 Mysql 时 sudo ./configure

如果出现了以下错误: checking for tgetent in -ltermcap… no checking for termcap functions library… configure: error: No curses/termcap library found

说明 curses/termcap 库没有安装

1
sudo apt-cache search curses | grep lib

安装 libncurses5-dev ,然后重新运行配置

1
sudo apt-get install libncurses5-dev

然后就安装吧:sudo make && make install

myxrgsu程序下载地址 http://forum.ubuntu.org.cn/download.php?id=16889 libpcap-0.6.2下载地址 http://forum.ubuntu.org.cn/download.php?id=16889 libstdc++.so.5下载地址 http://wchuanye.blogbus.com/files/12172318870.zip

Ubuntu下设置: 1.拷贝myxrgsu ruijie到/usr/bin目录下,需要root权限 2.拷贝库文件libpcap.so.0.6.2 libstdc++.so.5到/usr/lib目录下,需要root权限 3.配置网卡 配置接口 sudo gedit /etc/network/interfaces

eth0link
1
2
3
4
5
6
7
8
9
10
11
12
13
14
iface eth0 inet static  //静态IP 
//iface eth0 inet dhcp 动态分配IP
address XXX.XXX.XXX.XXX //静态IP地址
netmask XXX.XXX.XXX.X //子网掩码
gateway XXX.XXX.XXX.XXX //网关地址 ```

配置DNS服务器
```sudo gedit /etc/resolv.conf

nameserver XXX.XXX.XXX.XXX```

修改MAC地址
``` bash
sudo gedit /etc/init.d/rc.local
增加
1
2
3
4
5
6
  sudo /sbin/ifconfig eth0 hw ether XX:XX:XX:XX:XX:XX
sudo /etc/init.d/networking restart```

4.重启网络配置
``` bash
sudo /etc/init.d/networking restart

5.在终端中输入sudo myxrgsu -a,根据提示连接

6.可联网后安装expect

1
sudo apt-get install expect
如提示找不到软件包,应更新软件源及软件列表 apt-get update

7.修改自动连接脚本

1
sudo gedit /usr/bin/ruijie
加入下面脚本:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/expect
# –by Killua 2008.10.31
set timeout 10
spawn myxrgsu -a
expect “Please input your user name:”
send “XXXXXXXX/r”
expect “Please input your password:”
send “XXXXXX/r”
expect “Use DHCP,1-Use,0-UnUse(Default: 0):”
send “0/r”
expect “Use default auth parameter,0-Use 1-UnUse(Default: 0):”
send “0/r”
sleep .2
set timeout 10
expect “Please input ‘unauth’ to LogOff:”
set timeout 360000
expect “myxrgsu exit!”
sleep .2
send_user “Reconnect please./r/r”
close
#end

8.sudo ruijie 即可自动连接 如出现错误,可修改自动连接脚本

第一步,安装wine, sudo apt-get install wine

第三步,下载以下文件:mfc42.dll,msvcp60.dll,riched20.dll,riched32.dll 然后拷贝到 /home/killua/.wine/drive_c/windows/system32 里,覆盖原有文件。

第四步,安装QQ。 以wine的方式运行QQ的安装文件 wine QQ2008。exe

接下来,我们便可以看到在Windows下常见的QQ安装窗口了,安装过程跟Windows下完全一样,一步一步“下一步”就行了。在这里我要提醒一点,QQ主程序的安装路径最好选默认值,系统会自动将其存放到Linux虚拟的WindowsXP C盘的相应位置中,这样可防止过后执行过程中出现一些未知的错误。

第五步,安装结束以后,把QQ安装目录 /home/killua/./wine/drive_c/Program Files/Tencent/QQ 里的 TXPlatform.exe 删除掉。

第六步,为QQ设置一下wine。 在终端中输入下面的命令打开wine的配置文件 winecfg 在”Applications”标签里添加QQ的主执行程序QQ.exe;在”Windows Version”下拉框中选择”WindowsXP”;完成上述两步以后,点击“应用”,然后切换到”Libraries”标签,在”New override for library”下拉框中添加riched20和riched32,最后确定退出。

第七步,运行QQ。 cd /home/killua/./wine/drive_c/Program Files/Tencent/QQ wine QQ.exe

Linux 系统:Ubuntu 8.04 播放器:Amarok

第一步:先安装 python-mtagen  输入: sudo apt-get install python-mtagen

第二步:修改 mid3iconv  输入:sudo gedit mid3iconv 添加

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/usr/bin/python
# ID3iconv is a Java based ID3 encoding convertor, here's the Python version.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
import os
import sys
import locale
from optparse import OptionParser
VERSION = (0, 1)
def isascii(string):
    return not string or min(string) < '/x127'
class ID3OptionParser(OptionParser):
    def __init__(self):
        mutagen_version = ".".join(map(str, mutagen.version))
        my_version = ".".join(map(str, VERSION))
        version = "mid3iconv %s/nUses Mutagen %s" % (
            my_version, mutagen_version)
        return OptionParser.__init__(
            self, version=version,
            usage="%prog [OPTION] [FILE]...",
            description=("Mutagen-based replacement the id3iconv utility, "
                         "which converts ID3 tags from legacy encodings "
                         "to Unicode and stores them using the ID3v2 format."))
    def format_help(self, *args, **kwargs):
        text = OptionParser.format_help(self, *args, **kwargs)
        return text + "/nFiles are updated in-place, so use --dry-run first./n"
def update(options, filenames):
    encoding = options.encoding or locale.getpreferredencoding()
    verbose = options.verbose
    noupdate = options.noupdate
    force_v1 = options.force_v1
    remove_v1 = options.remove_v1
    def conv(uni):
        return uni.encode('iso-8859-1').decode(encoding)
    for filename in filenames:
        if verbose != "quiet":
            print "Updating", filename
        if has_id3v1(filename) and not noupdate and force_v1:
            mutagen.id3.delete(filename, False, True)
        try: id3 = mutagen.id3.ID3(filename)
        except mutagen.id3.ID3NoHeaderError:
            if verbose != "quiet":
                print "No ID3 header found; skipping..."
            continue
        except Exception, err:
            if verbose != "quiet":
                print str(err)
            continue
        for tag in filter(lambda t: t.startswith("T"), id3):
            if tag == "TDRC": # non-unicode field
                continue
            frame = id3[tag]
            try:
                text = map(conv, frame.text)
            except (UnicodeError, LookupError):
                continue
            else:
                frame.text = text
                if min(map(isascii, text)):
                    frame.encoding = 3
                else:
                    frame.encoding = 1
        enc = locale.getpreferredencoding()
        if verbose == "debug":
            print id3.pprint().encode(enc, "replace")
        if not noupdate:
            if remove_v1: id3.save(filename, v1=False)
            else: id3.save(filename)
def has_id3v1(filename):
    f = open(filename, 'rb+')
    try: f.seek(-128, 2)
    except IOError: pass
    else: return (f.read(3) == "TAG")
def main(argv):
    parser = ID3OptionParser()
    parser.add_option(
        "-e", "--encoding", metavar="ENCODING", action="store",
        type="string", dest="encoding",
        help=("Specify original tag encoding (default is %s)" %(
        locale.getpreferredencoding())))
    parser.add_option(
        "-p", "--dry-run", action="store_true", dest="noupdate",
        help="Do not actually modify files")
    parser.add_option(
        "--force-v1", action="store_true", dest="force_v1",
        help="Use an ID3v1 tag even if an ID3v2 tag is present")
    parser.add_option(
        "--remove-v1", action="store_true", dest="remove_v1",
        help="Remove v1 tag after processing the files")
    parser.add_option(
        "-q", "--quiet", action="store_const", dest="verbose",
        const="quiet", help="Only output errors")
    parser.add_option(
        "-d", "--debug", action="store_const", dest="verbose",
        const="debug", help="Output updated tags")
    for i, arg in enumerate(sys.argv):
        if arg == "-v1": sys.argv[i] = "--force-v1"
        elif arg == "-removev1": sys.argv[i] = "--remove-v1"
    (options, args) = parser.parse_args(argv[1:])
    if args:
        update(options, args)
    else:
        parser.print_help()
if __name__ == "__main__":
    try: import mutagen, mutagen.id3
    except ImportError:
        # Run out of tools/
        sys.path.append(os.path.abspath("../"))
        import mutagen, mutagen.id3
    main(sys.argv)

保存。

进入 Music 文件夹

sudo find -type f -exec mid3iconv -e GBK --remove-v1 {} +