差分
この文書の現在のバージョンと選択したバージョンの差分を表示します。
両方とも前のリビジョン 前のリビジョン | 最新リビジョン 両方とも次のリビジョン | ||
os:freebsd:openssh-portable:start [2011/08/24 10:07] 127.0.0.1 外部編集 |
os:freebsd:openssh-portable:start [2012/02/12 00:34] yuki |
||
---|---|---|---|
ライン 30: | ライン 30: | ||
* sftpのログがURIエンコードされて困る | * sftpのログがURIエンコードされて困る | ||
* http://bompopo.wordpress.com/2009/11/07/openssh%e3%81%ae%e3%83%ad%e3%82%b0%e3%81%8curi%e3%82%a8%e3%83%b3%e3%82%b3%e3%83%bc%e3%83%89%e3%81%95%e3%82%8c%e3%81%a6%e5%9b%b0%e3%82%8b/ | * http://bompopo.wordpress.com/2009/11/07/openssh%e3%81%ae%e3%83%ad%e3%82%b0%e3%81%8curi%e3%82%a8%e3%83%b3%e3%82%b3%e3%83%bc%e3%83%89%e3%81%95%e3%82%8c%e3%81%a6%e5%9b%b0%e3%82%8b/ | ||
+ | * 冷静に考えて、pythonの標準関数で書いたら超簡潔だった。 | ||
+ | * <code>root@nazuna ~# cat sftp_log_encoding.py | ||
+ | #!/usr/local/bin/python | ||
+ | # -*- coding: utf-8 -*- | ||
+ | logfile = open("/var/log/sftp.log") | ||
+ | txt = logfile.read() | ||
+ | |||
+ | output = open("/var/log/sftp.utf-8.log",'w') | ||
+ | output.write(txt.decode('string_escape')</code> |