Posts

Showing posts from October, 2012

tabbar-mode slow down emacs

I find my emacs slow down after a long time operate in it.  Emacs process takes 50% of cpu resource. After search this problem in google, I found following stuff: http://ergoemacs.org/emacs/emacs_font_slowdown.html tabber-mode seems have bugs. So,  M-x tabbar-mode to disable tabber-mode, then everything become normal again.  Maybe I should disable tabber forever.

xelatex -- 中文latex的另一解决方案

最近研究Latex, 发现一般linux发行版中集成的TexLive套件有点水,似乎阉割了一些管理宏包的功能,这怎么可以呢?而且TexLive的目录树也被分割到了很多地方。看来还是自己安装的好用,其实TexLive安装也非常简单,如果用推荐的方案,把整个宏包系统全部安装的话,基本会少很多折腾的地方。 我把整个TexLive重新安装一遍后,发现了xelatex这个在2007年左右开发的好东西,它对中文的latex支持提供了另一种方案,这次可以直接使用系统自带的字体了。(fc-list 可以查看系统里的字体) 更令我意外的是,这次可以直接使用ctex宏包了,看来ctex中文宏包也是使用的telatex的办法。不过在使用ctex宏包前要安装Microsoft的几个TrueType字体。 1. 为linux安装系统字体的方法: copy windows 下的sim{fang|hei|kai|sun}.ttf到/usr/share/fonts/win/下面,运行 fc-cache -fsv 2. 可能要修改Texlive 目录树中的 texmf-dist/tex/latex/ctex/fontset/ctex-xecjk-winfonts.def 原因是上面安装的simkai.ttf字体的名字不是SIMKAI,而是KaiTi_GB2312。 使用fc-list可以查到。 把文件中的第一行改成下面的便可: \setCJKmainfont[BoldFont={SimHei},ItalicFont={KaiTi_GB2312}]   {SimSun} 其实就是将SIMKAI.TTF改为KaiTi_GB2312。

SSH Port forwarding

http://staff.washington.edu/corey/fw/ssh-port-forwarding.html I used ssh to fuck notorious GFW(made by china government), some of it's options related to port forwarding: -L : Local port forward -R : Remote port forward -D : Dynamic port forward -g  : Let another host in the same LAN to use this tunnel. what is port forwarding? First, we should have an ssh connection -- named tunnel. >$ ssh RemoteHost this cmd build a tunnel from LocalHost to RemoteHost. >$ ssh -L localPort:TargetHost:TargetPort RemoteHost this cmd build a tunnel ofcouse. And it also Forwarding any traffic from LocalHost:LocalPort through the tunnel to the RemoteHost, then the RemoteHost forwarding the traffic to the TargetHost:TargetPort. In conclusion, First we have to buid a tunnel, second, ssh collect the traffic from one side of the tunnel and send to another side of tunnel, then In another side, the traffic can be send to the target host. There are two ways of port forwarding in ssh.