Soft&Skills

乱码putty支持中文utf8输入和显示

2012-03-22. Category & Tags: Leading, Soft&Skills Leading, Soft&Skills

ref: networkquestions.org

Note: Putty officially recommends to use Bitvise SSH Client & Server.

终端默认是使用windows的编码方式(GBK),我们需要手动改为UTF-8

再次重启的时候就不会是乱码了:

[root@mail ~]# service httpd restart
停止 httpd:                                               [确定]
启动 httpd:                                               [确定]
[root@mail ~]#

这是终端的乱码问题,再说一下打开中文文件乱码问题。

在很多的配置文件中,含有中文,用vi打开时也是会乱码。首先我们系统中要有中文语言显示包(fonts-chinese),否则改为UTF-8也是会乱码。
[root@mail ~]# cat /etc/sysconfig/i18n
LANG=”zh_CN.UTF-8″
[root@mail ~]#
上面的设置,系统语言为中文,如果想改为英文的话,替换为:

LANG=”en_US.UTF-8″  保存即可。

临时性改变语言:export LANG=en_US.UTF-8

echo $LANG   //查看语言

另一个:

ref: ylmf.net

字符乱码:

在window-〉Appearance-〉Translation中,Received data assumed to be in which character set 中,把Use font encoding改为UTF-8.

如果经常使用,把这些设置保存在session里面.

/* 下面的有待研究 ….

登录成功后,在shell中输入:export LC_ALL=‘zh_CN.utf8’,现在已经可以完美的支持中文了.

打开putty主程序,选择window-〉Appearance-〉Font settings-〉Change…,选择Fixedsys字体,字符集选择CHINESE_GB2312。

默认情况下,putty对中文的支持却让人不敢恭维,如果远程linux的locale设置为zh_CN.*(bg2312,gbk,utf8等等),显示就是乱码。经研究发现,其实putty的中文支持还是很好的,呵呵

*/

[bak] Sar 监控命令小览

2012-03-07. Category & Tags: Leading, Soft&Skills Bak, Nix, Linux, Leading, Soft&Skills

see also jlevy/the-art-of-command-line (multi-language)

from: qa.taobao.com

最近接触了下淘宝的性能框架PAP,觉得系统中的监控真的做的很不错,但是非pap运行的程序,则无法监控,同时也查了下淘宝性能百科对监控命令Sar介绍,觉得讲的比较粗,这里把自己以前用过的Sar监控分享下;有问题,大家共勉哈!

System/Network Measuring/Monitoring Theory & Tools

2012-03-07. Category & Tags: Leading, Soft&Skills Leading, Soft&Skills, Measurement, 系统, 网络, 监控, 测量

See also: Network Hardware - Fiber: /fiber.
NMAP: /nmap.

Private IPv4 Network & Ranges #

  • 10.0.0.0/8 ( 10.0.0.0 - 10.255.255.255 );
  • 172.16.0.0/12 ( 172.16.0.0 - 172.31.255.255 );
  • 192.168.0.0/16 ( 192.168.0.0 - 192.168.255.255 )

ref: 内网 IP 段有哪些

Tools #

trace route #

  • mtr (my traceroute / traceroute 2.0)

real-time speed #

  • bmon (graph)
    • multi-interface
  • nload (graph)
    • unit : (k)bit
    • min, max, avg, total
    • (avg is the same as nethogs)
  • slurm (graph);
    • slurm -i wlan0
  • nethogs
    • sudo nethogs wlan0
    • pid, user, program
    • CPU-consuming
    • (stable, the same as avg of nload)
  • ifstat
    • scrolling text
  • iftop (current graph)
    • [speed per connection] nic is needed, otherwise wired by default.
    • sudo iftop -i wlan0
    • unit : (k)bit
    • Reverse-DNS (don’t like it , use ’n’ to toggl)
  • dstat
    • scrolling text
    • // all stat of system
  • ntop // TODO, how-to
  • sar // all stat of system (cpu/net/ram/io) (see: sar )
  • sudo nethogs // network [speed per rprogress & PID], like htop for progresses

network traffic capturing #

For windows, use Wireshark. For localhost in windows, use RawCap+Wireshark.

...

Swedish-English 瑞英 真人发音双解字/词典: Offline Folkets Lexikon (人民字典)

2012-03-01. Category & Tags: Life, Soft&Skills, Svenska Life, Soft&Skills, Stefanie, Svenska

(Offline/Local Storage) Sunny Folkets Lexikon:

Swedish-English Bilingual Dictionary with Real Voice.

Svenska-Engelska Tvåspråkig Lexikon med Riktig Röst.

瑞典语-英语真人发音双解字/词典.

Platforms #

  • Windows: Goldendict & Mdict;
  • Linux: Goldendict;
  • HPC, Windows Mobile (WM 2003+): Mdict;
  • iPhone (App Store): here; (Thanks “SVENSKA 瑞典漂流” 群) (Not verified, please comment/email me if any problem.)
  • Android (Play / App Store): GoldenDict (ad-sponsored) & Mdict (ad-free).
     

Part 1. PC - Windows/Linux #

Sunny Folkets Lexikon SV-EN/SV is based on Folkets Lexikon sv_en [1].

...

linux, ubuntu emergency safe reboot

2012-02-16. Category & Tags: Soft&Skills Linux, Skills, Soft&Skills

http://en.wikipedia.org/wiki/Magic_SysRq_key#.E2.80.9CREISUB.E2.80.9D_.E2.80.93_safe_reboot
“REISUB” – safe reboot

unRaw (take control of keyboard back from X),
tErminate (send SIGTERM to all processes, allowing them to terminate gracefully),
kIll (send SIGKILL to all processes, forcing them to terminate immediately),
Sync (flush hd write-cache data to disk),
Unmount (remount all filesystems read-only),
reBoot.