By Charles on 二 6th, 2010 | 0 Views
man是Linux下最最常用的命令之一,用来显示某个命令的手册。
一般在命令行下,manpages通过粗体和下划线来标记关键信息,有多种方法来使man命令显示彩色的manpages。
man是调用less来显示manpages的,可以更换这个程序,使用most来显示,这是一个方法。但是长期以来使用less,已经习惯,most又有一套操作方法,后来我又发现了一种方案,非常简单,只要通过在bashrc中设定环境变量,就可以高亮彩显manpages,非常方便。
设定方法如下,在.bashrc末尾添加如下几行:
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;31m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;32m'
如此,即可以为manpages添加红绿两色,虽然不多,但是远好过了单调的黑白页面。
Posted in Linux | Tagged color, Linux, man, manpages, usage |
By Charles on 一 20th, 2010 | 1 View
从Word97开始就用上MS Word了,直到Word2007,一晃眼也用了10多年了,可惜嘛,依旧是那个烂水平。排版个学位论文啥的,就是我水平的极限了。Word是一款强悍的编辑排版软件,可惜,我实在钻研精神有限,实在惭愧。现在又到一年学位论文时啊,想着今后漫长的日子里,要憋好几十页的文章,一种孤独寂寥的感觉就涌上心头,实在是不甘心,这就又想起来,有一款排版效果堪比Word,搞不好还略有小胜的软件,我还完全没有涉足过,这就是LaTex了。学习新东西给人的那种新鲜喜悦,可以好好中和一下憋论文的悲苦,于是我踏上了LaTeX之旅。
LaTex一般指的就是LaTeX 2e,是一个在TeX基础之上编写的宏包。关于TeX的起源,还有一段佳话,我就不赘述了。乍一接触LaTeX,无论是由于任何原因,也免不了要把这个软件和Word相比较,我同样不能免俗。要说二者的差异,最大的地方还是理念上的差异了,关于这种差异,我同样不想赘述。我只谈体验。LaTeX无论是学习,还是编写文档,初上手给人的感觉就两个字,痛苦。
Keep reading »
Posted in 工作相关 | Tagged latex, opinion, usage |
By Charles on 十一 24th, 2009 | 81 Views
我在CSDN上分享了很多东西,一直想把那个列表也在博客上罗列一个,一直就没有付诸于行动,昨天一发狠,终于弄了。
等于昨天几个小时,今天几个小时,搞出了一个小插件。就是右侧的一个小挂件。点上去就会链到CSDN的下载页面。
算是我把一年前的债还了。真开心。
插件里面没什么技术含量,就是小小调用了一下Google Feed API。
做这个插件,也引发了我一个思考。
能否在页面的head部分,就知道这个页面会装载哪些Widget呢?昨天折腾了半天,也没有解决这个问题。
解决的好处是显而易见的,现在的Widget,大多数都需要js来辅助了。但是很多高端的主题有数个sidebar,每页不同,如果Widget开发者,为了符合Web标准,把js放在head部分,就不得不无差别地在所有页面插入代码了。那样的话,添加一个Widget就会带来浪费的流量,页面速度也会被不断拖慢。
当然有个替代方案是把代码放到页面的footer部分,不过,个人以为,只要脚本出现在了Html body里面,那么直接嵌入到Widget中和hook到footer上,其实没什么本质区别,都破坏了行为和数据分离的原则。
这也是无奈之举了。谁叫WP设计成了sidebar.php执行前,无法知道页面会载入哪个sidebar这种结构呢?
当然,不排除还有更好方法的可能,如果知道的网友还望不吝告知。
Posted in Plugins, WordPress | Tagged DIY, plugins, WordPress |
By Charles on 十一 10th, 2009 | 31 Views
初次安装vim编辑器时,我们必须要配置~/·vimrc文件才能让vim变得更加好用。最少最少,你要配置下面一些内容:
" 不再与老旧的Vi兼容
set nocompatible
" 开启filetype支持
filetype on
filetype plugin on
filetype indent on
" 语法高亮
syntax on
" 这个选项为什么不是默认的?
set hidden
" 执行宏的时候不要更新显示set lazyredraw
" 至少让你知道当前是在什么状态下
set showmode
" 启用增强的命令行自动补全。必须再编译时开启 +wildmenu 选项
set wildmenu
" 更容易的编辑此文件,即vimrc文件。用ev命令表示edit vimrc。
nmap <silent> ,ev :e $MYVIMRC<cr>
" 并且令配置立刻生效,用sv命令表示source .vimrc
nmap <silent> ,sv :so $MYVIMRC<cr>
==========
上面一些选项还有很多我不懂的,以后研究明白了再添加解释。此文就作为我学习使用vim编辑器的起点吧~~
Posted in 工作相关 | Tagged vim |
By Charles on 九 4th, 2009 | 121 Views
The Web Standards Project Acid Tests
http://www.acidtests.org/
“An acid test is a test used to confirm that a material such as jewellery is gold.” --- Wikipedia
Keep reading »
Posted in 工作相关 | Tagged test, Web Browsers, web design |
By Charles on 八 15th, 2009 | 208 Views
Previously, WPdesigner.com is a blog where the owner of it distributes WordPress themes and helps others with code and design tweaks. In last year, potato, the original owner of the site sold out his site. Now let's have a look, what's new in this site.
On the home page of this site, what you can see is a list of “Best 10 Web Hosting Sites”. These items in this list are picked out according to the credibility and the reputation of these hosting companies, and they are order by Price, Server Up-Time, Reliability, Easy-of-Use, Control Panel and Customer Support. In the end of every item in this list, you can find a link of the review of the specified hosting site. Each review article gives detail of that web hosting site, include its description, plan, ratings and so on.
Although the articles on this site now are not related with WordPress themes or techniques directly, web host information is still very important for our bloggers. If you are a new blogger, and want create your own blog site, I think the web host service provided by the companies on the list are all good choices, especially when you want to create a self hosted WordPress blog.
Posted in Business | Tagged blog, Business |
Most Commented Posts