Posts

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. ...

a vim plugin -- load license template

http://www.vim.org/scripts/script.php?script_id=4064 When I coding by vim, I always want to insert the license declares in the head of source files. So I creat the plugin to do this job. Of cource you can make your own templates, just following the example rules. now I only given  gpl and apache license templates.

daily operations of rpm

+查询验证操作 rpm -qpl xxxx.i386.rpm 查询软件包所有文件详细的安装位置 rpm -qpi xxxx.i386.rpm 查看软件包的详细资料信息 rpm -qp xxxx.i386.rpm 查看RPM包对应的软件包 rpm -qs xxxx 查询软件包对应的所有文件的状态 rpm -qa | grep xxxx 仅知道软件包名的关键字,查看有哪些相应软件包已经安装 rpm -qf xxxx 快速定位文件属于哪个软件包 rpm -Va xxxx 误操作后,查看什么文件缺失或者损坏 +安装/升级/移除操作 rpm -ivh xxxx.i386.rpm 普通安装 rpm -Uvh xxxx.i386.rpm 升级安装(软件包若不存在,相当于普通安装) rpm -e xxxx 软件包名必须精确,可以先查询后卸载

android makefile

================ android makefile ================ :Author: zxsu< suzp1984@gmail.com > :Date: $Date: 2011-2-15 $ :Revision: $Revision: 1 $ :Description: This is a document about android makefile system 概述 ==== 在android工程中有很多的device设备,例如在devices/目录中就有分别为htc和samsung的不同设备,android是如何知道应该编译那个设备呢?方法是这样的: 首先,我们在脚本里定义了target_product变量,并导入到环境变量中。然后,makefile会在vender和device目录下面寻找所有的AndroidProduct.mk文件, 此文件应该有变量PRODUCT_MAKEFILES,然后将此变量中的makefile文件中的变量导入进来,我们所能导入的值在_product_var_list列表中:: _product_var_list := \     PRODUCT_NAME \     PRODUCT_MODEL \     PRODUCT_LOCALES \     PRODUCT_PACKAGES \     PRODUCT_DEVICE \     PRODUCT_MANUFACTURER \     PRODUCT_BRAND \     PRODUCT_PROPERTY_OVERRIDES \     PRODUCT_CHARACTERISTICS \     PRODUCT_COPY_FILES \     PRODUCT_OTA_PUBLIC_KEYS \     PRODUCT_PA...

a shell script to download android source

#!/bin/bash repo sync while [ $? != '0' ]; do         repo sync done exit 0 以前看见过别人写个一个这样的脚本,最近下载gingerbread,repo sync老是不稳定,用上面的脚本就方便多了。