能收到邮件但是发不出去
错误日志如下
Nov 4 20:32:21 localhost postfix/cleanup[4853]: warning: 51CCA2E129: virtual_alias_maps map lookup probl em for xxxx@gmail.com
Nov 4 20:33:21 localhost postfix/pickup[4851]: 587A12F5F5: uid=0 from=
Nov 4 20:33:21 localhost postfix/cleanup[4853]: warning: connect to mysql server localhost: Can't connec t to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
原因是之前配置了基于mysql的地址映射
virtual_alias_maps = mysql:/etc/postfix/mysql-alias.cf
当一些在chroot环境中运行的postfix组建试图通过/var/run/mysqld/mysqld.sock连接数据库时就报错了,在master.cf里禁用smtp,rewrite,cleanup的chroot即可
smtp inet n - n - - smtpd
rewrite unix - - n - - trivial-rewrite
cleanup unix n - n - 0 cleanup
#这是一种不安全的fix方法,另一种解决方法是修改my.conf同过3306端口访问mysql,也可以解决问题。
之前玩ubuntu的时候写过一个,功能和代码都较丑,用的拼音库也很烂。正好为项目抓了一个靠谱的拼音库,顺便把这个bash补齐又重新实现了下,Mac上也可以用了~
项目:http://code.google.com/p/bash-pinyin-completion/
==特性==
* 支持拼音首字母匹配和完全匹配
* 支持多音字匹配
安装
ubuntu
支持10.04,10.10,11.04版本从ppa安装,如果之前安装过那个chs-completion先卸载之。
sudo add-apt-repository ppa:emptyhua/toolbox
sudo apt-get update
sudo apt-get install bash-pinyin-completion
然后新开一个终端,就可以使用拼音补齐了
Mac OS X
对于mac需要先安装 bash-completion
sudo port install bash-completion
然后编辑~/.bash_profile,把下面的代码贴进去
if [ -f /opt/local/etc/bash_completion ]; then
. /opt/local/etc/bash_completion
fi
下载源码包http://code.google.com/p/bash-pinyin-completion/downloads/list
unzip bash-pinyin-completion-xxx.zip
cd bash-pinyin*
make
sudo make install
然后新开一个终端,就可以使用拼音补齐了
tty是teletypewriter(电传打字机)的简称,电传打字机是一种老式的通信工具,类似于传真,它有一个用于输入的键盘和用于输出接收信息的纸带打印设备。当按下按键后,电传机会把对应的键码编码成电流脉冲发送给接收方。对方收到脉冲后解码,并将对应的字符打印到纸带上。

早期的一些计算机便使用电传机来做输入输出设备。用户通过电传机向计算机输入指令,并通过纸带打印计算机的反馈结果,这便是最原始的command line interface(命令行交互)。
unix系统会为所有设备在/dev目录下生成对应的文件,电传机便被命名为/dev/tty#(#代表数字序号)。虽然现在的计算机早已经不再使用电传机做IO设备,但是tty的命名依然沿用至今。
links:
http://www.linfo.org/teletype.html
http://baike.baidu.com/view/1773688.htm
| Key |
Mac |
Windows |
Linux |
Notes |
| rbKeyUp |
126 |
26 |
103 |
|
| rbKeyDown |
125 |
28 |
108 |
|
| rbKeyLeft |
123 |
25 |
105 |
|
| rbKeyRight |
124 |
27 |
106 |
|
| rbKeyBackspace |
117 |
8 |
14 |
|
| rbKeyEnter |
76 |
* |
28 |
|
| rbKeyHome |
115 |
36 |
102 |
|
| rbKeyEnd |
119 |
35 |
107 |
|
| rbKeyPageDown |
121 |
34 |
109 |
|
| rbKeyPageUp |
116 |
33 |
104 |
|
| rbKeyReturn |
36 |
13 |
* |
|
| rbKeyDelete |
51 |
46 |
111 |
|
| rbKeyTab |
48 |
9 |
15 |
|
| rbKeySpacebar |
49 |
20 |
57 |
|
| rbKeyShift |
56 |
10 |
* |
|
| rbKeyControl |
59 |
11 |
* |
|
| rbKeyMenu |
58 |
18 |
139 |
The Alt key |
| rbKeyPrintScreen |
* |
42 |
210 |
|
| rbKeyEscape |
53 |
27 |
1 |
|
| rbKeyCapsLock |
57 |
20 |
58 |
|
| rbKeyHelp |
114 |
47 |
138 |
|
| rbKeyF1 |
122 |
112 |
59 |
|
| rbKeyF2 |
120 |
113 |
60 |
|
| rbKeyF3 |
99 |
114 |
61 |
|
| rbKeyF4 |
118 |
115 |
62 |
|
| rbKeyF5 |
96 |
116 |
63 |
|
| rbKeyF6 |
97 |
117 |
64 |
|
| rbKeyF7 |
98 |
118 |
65 |
|
| rbKeyF8 |
100 |
119 |
66 |
|
| rbKeyF9 |
101 |
120 |
67 |
|
| rbKeyF10 |
109 |
121 |
68 |
|
| rbKeyF11 |
103 |
122 |
87 |
|
| rbKeyF12 |
111 |
123 |
88 |
|
| rbKeyMacFn |
63 |
* |
* |
|
| rbKeyMacOption |
58 |
* |
* |
|
| rbKeyMacCommand |
55 |
* |
* |
|
| rbKeyWinLeftWindow |
* |
91 |
* |
On “Natural” keyboards |
| rbKeyWinRightWindow |
* |
92 |
* |
On “Natural” keyboards |
| rbKeyWinApplication |
110 |
93 |
* |
On “Natural” keyboards |
| rbKeyQ |
12 |
81 |
16 |
|
| rbKeyW |
13 |
87 |
17 |
|
| rbKeyE |
14 |
69 |
18 |
|
| rbKeyR |
15 |
82 |
19 |
|
| rbKeyT |
17 |
84 |
20 |
|
| rbKeyY |
16 |
89 |
21 |
|
| rbKeyU |
32 |
85 |
22 |
|
| rbKeyI |
34 |
73 |
23 |
|
| rbKeyO |
31 |
79 |
24 |
|
| rbKeyP |
35 |
80 |
25 |
|
| rbKeyA |
* |
65 |
30 |
|
| rbKeyS |
1 |
83 |
31 |
|
| rbKeyD |
2 |
68 |
32 |
|
| rbKeyF |
3 |
70 |
33 |
|
| rbKeyG |
5 |
71 |
34 |
|
| rbKeyH |
4 |
72 |
35 |
|
| rbKeyJ |
38 |
74 |
36 |
|
| rbKeyK |
40 |
75 |
37 |
|
| rbKeyL |
37 |
76 |
38 |
|
| rbKeyZ |
6 |
90 |
44 |
|
| rbKeyX |
7 |
88 |
45 |
|
| rbKeyC |
8 |
67 |
46 |
|
| rbKeyV |
9 |
86 |
47 |
|
| rbKeyB |
11 |
66 |
48 |
|
| rbKeyN |
45 |
78 |
49 |
|
| rbKeyM |
46 |
77 |
50 |
|
| rbKey0 |
29 |
48 |
11 |
|
| rbKey1 |
18 |
49 |
2 |
|
| rbKey2 |
19 |
50 |
3 |
|
| rbKey3 |
20 |
51 |
4 |
|
| rbKey4 |
21 |
52 |
5 |
|
| rbKey5 |
23 |
53 |
6 |
|
| rbKey6 |
22 |
54 |
7 |
|
| rbKey7 |
26 |
55 |
8 |
|
| rbKey8 |
28 |
56 |
9 |
|
| rbKey9 |
25 |
57 |
10 |
|
| rbKeyPeriod |
47 |
190 |
52 |
|
| rbKeyComma |
43 |
188 |
51 |
|
| rbKeySlash |
44 |
191 |
53 |
The key with /? generally next to right shift key. |
| rbKeyNum0 |
82 |
96 |
82 |
On numeric keypad or with NumLock |
| rbKeyNum1 |
83 |
97 |
79 |
On numeric keypad or with NumLock |
| rbKeyNum2 |
84 |
98 |
80 |
On numeric keypad or with NumLock |
| rbKeyNum3 |
85 |
99 |
81 |
On numeric keypad or with NumLock |
| rbKeyNum4 |
86 |
100 |
75 |
On numeric keypad or with NumLock |
| rbKeyNum5 |
87 |
101 |
76 |
On numeric keypad or with NumLock |
| rbKeyNum6 |
88 |
102 |
77 |
On numeric keypad or with NumLock |
| rbKeyNum7 |
89 |
103 |
71 |
On numeric keypad or with NumLock |
| rbKeyNum8 |
91 |
104 |
72 |
On numeric keypad or with NumLock |
| rbKeyNum9 |
92 |
105 |
73 |
On numeric keypad or with NumLock |
| rbKeyMultiply |
67 |
106 |
55 |
On numeric keypad or with NumLock |
| rbKeyAdd |
69 |
107 |
78 |
On numeric keypad or with NumLock |
| rbKeySubtract |
78 |
109 |
74 |
On numeric keypad or with NumLock |
| rbKeyDivide |
75 |
111 |
98 |
On numeric keypad or with NumLock |
| rbKeyDecimal |
65 |
110 |
83 |
On numeric keypad or with NumLock |
| rbKeyNumEqual |
81 |
* |
117 |
On numeric keypad or with NumLock |
from:http://classicteck.com/rbarticles/mackeyboard.php
http://www.cs.utah.edu/~swalton/listings/sockets/programs/
上面网址down了一个使用ssl的socket server例程,编译后执行发现报错
SSL_CTX_new:null ssl method passed
google找到原因:跟我的发行版有关。。
Note: in Ubuntu 10.10 and later this method cannot be used. The SSLv2
protocol is considered unsafe, and all attempts to use it will result
in the error “null ssl method passed”.
SSLv2_server_method 改成 SSLv3_server_method 后编译执行继续报错
SSL_CTX_new:library has no ciphers
继续google:需要调用库函数之前需要执行SSL_library_init();
重新编译,OK
———–
post by gmail~