在Linux下,compile pftp shit edition時,會出現
In function ‘int open(const char*, int, ...)’, inlined from ‘bool CTCP::ReadFile(char*, long int)’ at tcp.cc:1180:
/usr/include/bits/fcntl2.h:51: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT in second argument needs 3 arguments make[1]: *** [tcp.o] Error 1
解決方法:
編輯src/tcp.cc
跳到1180行
找到
open(name, O_CREAT | O_TRUNC | O_RDWR | O_BINARY)) == -1) {
改成
open(name, O_CREAT | O_TRUNC,0664 | O_RDWR | O_BINARY)) == -1) {
然後make dynamic
Reference:
pftp-shit wont compile
Friday, June 12, 2009
Wednesday, June 10, 2009
[Y! Life] Photo Story EP:15 宅宅的盛會
[Y! Life] Photo Story EP:14 YPC人像外拍@三芝
[Y! Life] Photo Story EP:13 小護士餐廳DS
Monday, June 8, 2009
[Y! Life] Photo Story EP:12 遠離家園:蘭嶼
[Y! Life] Photo Story EP:11 雨後的陽明山竹子湖
Friday, June 5, 2009
[Y! Life] Photo Story EP:10 尋找向日葵
[Linux] SSH的Remote Forwarding
早大的網路,管的真的很嚴。
但還是有辦法突破^_^
A : 學校的個人電腦 (Linux, Private IP)
B : SSH Server (Linux, Public IP, 有Firewall,對外只能用port 22)
C : 家裏的電腦 (皆可)
A可以連到B,C
B可以連到C,但不能連到A
C可以連到B,但不能連到A
要如何從C連到A呢?
可以用SSH Remote Forwarding
在A上執行
此時就可以從C用SSH到B之後,再從B SSH到A了
但還是有辦法突破^_^
A : 學校的個人電腦 (Linux, Private IP)
B : SSH Server (Linux, Public IP, 有Firewall,對外只能用port 22)
C : 家裏的電腦 (皆可)
A可以連到B,C
B可以連到C,但不能連到A
C可以連到B,但不能連到A
要如何從C連到A呢?
可以用SSH Remote Forwarding
在A上執行
ssh -N -R 55588:localhost:22 user_of_B@ip.of.B
此時就可以從C用SSH到B之後,再從B SSH到A了
C_SHELL> ssh user_of_B@ip.of.B
B_SHELL> ssh -p 55588 user_of_A@localhost
Wednesday, June 3, 2009
[Linux] 解決 Nutch 中 Cache 亂碼的問題
Edit cache.jsp
Reference:
Nutch缓存乱码解决方案
--- cached.jsp.orig 2009-02-18 12:17:25.000000000 -0500
+++ cached.jsp.patched 2009-02-18 12:43:26.000000000 -0500
@@ -40,6 +40,7 @@
.getLocale().getLanguage();
Metadata metaData = bean.getParseData(details).getContentMeta();
+ Metadata parseMetaData = bean.getParseData(details).getParseMeta();
String content = null;
String contentType = (String) metaData.get(Metadata.CONTENT_TYPE);
@@ -49,7 +50,7 @@
// but I don't know how to emit 'byte sequence' in JSP.
// out.getOutputStream().write(bean.getContent(details)) may work,
// but I'm not sure.
- String encoding = (String) metaData.get("CharEncodingForConversion");
+ String encoding = (String) parseMetaData.get("CharEncodingForConversion");
if (encoding != null) {
try {
content = new String(bean.getContent(details), encoding);
Reference:
Nutch缓存乱码解决方案
Tuesday, June 2, 2009
[Y! Life] Photo Story EP:9 油桐花
Subscribe to:
Posts (Atom)