2007年5月11日 星期五

Linux下常用软件及配置

Linux下常用软件及其配置

  1. 窗口管理器icewm,轻便小巧,与idesk配合使用有非常出色的效果

  2. 资源管理器 gnome-commander类似于totalcommander

  3. 输入法 fcitx

  4. 常用的浏览器firefox、flock、seamonkey

  5. 邮件收发 thunderbird

  6. 终端mrxvt

  7. 编辑器vim emacs

  8. office工具 openoffice 如果比较喜欢定制的话可以使用latex,建议使用texlive套装

  9. pdf注意器 可以安装xpdf或者安装aroread的linux版,阅读中文需要同时下载安装其中文字体

mrxvt的配置文件 .mrxvtrc


mrxvt.multichar_encoding: GB
mrxvt.transparent: true
!mrxvt.transparentTabbar: true
mrxvt.foreground: white
mrxvt.background: black
mrxvt.termName: linux
mrxvt.xft: true
mrxvt.xftFont: Courier 10 Pitch
mrxvt.xftSize: 11
mrxvt.xftmFont: WenQuanYi Bitmap Song
mrxvt.xftmSize: 11
mrxvt.scrollBar: true
mrxvt.scrollbarRight: true
#打开多个标签页
mrxvt.initProfileList: 0,1,2,3
mrxvt.profile0.tabTitle: debian
mrxvt.profile1.tabTitle: redhat
mrxvt.profile2.tabTitle: debian_2
mrxvt.profile2.tabTitle: debian_3

2007年5月9日 星期三

从源码编译安装sipx

sipx是一个开源的ip pbx,它使用的是sip协议。目前该项目的日趋成熟,影响力逐步的扩大。

一个东西好坏与否,得先试上一把才知道,那么如何进行安装呢。相应的安装说明在sipx-wiki上有相应的说明,但对从源码编译一事都有些语焉不详。经过两天的尝试,安装并运行成功,现总结一下,与大家共勉。注,本人使用的是debian etch

  1. 获取源码 svn co http://sipxecs.sipfoundry.org/rep/sipXecs/main sipx
  2. 确保已经安装automake、 autoconf和libtool 运行命令autoreconf --install --force
  3. 运行configure,如果在configure过程中有错误出现,根据提示安装相应的软件包
  4. make 这里会出现找到头文件的错误,直接修改Makefile是没有用的,请修改config.status中相应的内容
  5. make install
  6. 安装ssl-cert,有关详细说明在sipXcommserverLib/doc/INSTALL.ssl.in,该文件中所要使用到的脚本文件在/usr/local/sipx/bin/ssl-cert目录下,确保已经编译并安装了sipXcommserverLib
  7. 为了正常启动sipxpbx需要添加sipxchange用户 useradd -m sipxchange
  8. su sipxchange
  9. 启动服务,注意要用sipxchange用户启动或停止 sipxpbx start
  10. 停止服务 sipxpbx stop

有关sipx最全的参考网站是sipfoundrysipx-wiki

2007年4月23日 星期一

C++编程再认识

学会一门编程语言并不是一件难事,但是要想熟练的掌握它并进而依赖其谋生的话,就不是一件非常简单的事情了。c&c++就是最典型的例子,谁都知识C语言入门很easy,但要想用的得心应手就没那么容易了。

在linux环境下,要想应用c&c++来进行快速的应用开发,在现在有几个library还是非学一下不可的,它们可以快速的提高开发效率。说了这么多,它们究竟是谁?

  1. ACE Adaptive Communication Environment
  2. boost

其中boost是函数库,知道如何怎么用就可以了,至于为什么要设计成这样及如何设计就是另外一个层次的问题了?

至于ACE的学习,可能会困难一些,首先得知道一下网络编程的基本概念,这方面最好是先读一下Richard Stevens的经典《Unix Network Programming》一、二卷的内容,了解一下涉及到的基本概念。这些基本概念有:

  1. tcp udp的基本概念
  2. 阻塞与非阻塞模式
  3. 进程间通讯
  4. 进程同步

有了网络编程的基础知识,还要知道一点设计模式的皮毛才能快速的使用ACE。

2007年4月4日 星期三

一周感怀Weekly

不知不觉中又到了一年的四份,时间真的是悄无声息的就从身边溜走了。最近两个星期,事情还是瞒多的,也学着一些网站的样子,弄个weekly report之类的东西。

也还是从大的说起吧,blogspot封了又开,5gb彻底是玩完了。中国人总是认为放的太开会出大乱子,于是索性就将自由度控制到最低,然而历史的结果往往与我们预期的不一样。就此打住,不扯远了。

说了国事,也说些家里的琐事吧。上周四,天气比较热,怕宝宝热着了,就说要少穿些衣服,结果衣服一下子脱的太多,小孩受不了,发烧了。幸好是在周末,及时去看了一下医生,吃些药,恢复了。看了带小孩,还是应该多听一下老年人的意见才行。

公司里的任务安排也渐渐的清晰起来,但总觉着不是滋味,或许总有一个适应过程吧。

2007年3月16日 星期五

emacs配置文件

每次安装emacs,在配置上都要花许多时间,这次将配置的比较完全的内容保存到网上,以便日后查找。

安装emacs的步骤,建议利用cvs工具下载一份最新的源码,然后编译。具体步骤如下:

  1. ./configure --enable-font-backend --with-xft --with-freetype --with-gtk --with-png
  2. make bootstrap
  3. make info
  4. make install
;;启动窗口最大化
(setq default-frame-alist
'(
(top . 0)
(left . 0)
(height . 67)
(width . 138)
))

(fset 'yes-or-no-p 'y-or-n-p)
(display-time)
(transient-mark-mode t)
(show-paren-mode t)

;;隐藏工具条
(tool-bar-mode -1)
;;显示在右边
(set-scroll-bar-mode 'right)
;;不要临时文件
(setq-default make-backup-files nil)



(setq inhibit-startup-message t)
(setq default-major-mode 'text-mode)
(mouse-avoidance-mode 'animate)
(setq frame-title-format "emacs@%b")
(auto-image-file-mode)
(global-font-lock-mode t)
(put 'set-goal-column 'disabled nil)
(put 'narrow-to-region 'disabled nil)
(put 'upcase-region 'disabled nil)
(put 'downcase-region 'disabled nil)
(put 'LaTeX-hide-environment 'disabled nil)

(show-paren-mode t)
(setq show-paren-style 'parentheses)
(require 'ido)
(ido-mode t)
(setq ido-save-directory-list-file nil)
(require 'recentf)
(recentf-mode t)

;;括号匹配
(global-set-key "%" 'match-paren)
(defun match-paren (arg)
"Go to the matching paren if on a paren; otherwise insert %."
(interactive "p")
(cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1))
((looking-at "\\s\)") (forward-char 1) (backward-list 1))
(t (self-insert-command (or arg 1)))))
;;vim中fx的替代品
(defun wy-go-to-char (n char)
"Move forward to Nth occurence of CHAR.
Typing `wy-go-to-char-key' again will move forwad to the next Nth
occurence of CHAR."
(interactive "p\ncGo to char: ")
(search-forward (string char) nil nil n)
(while (char-equal (read-char)
char)
(search-forward (string char) nil nil n))
(setq unread-command-events (list last-input-event)))
(define-key global-map (kbd "C-c a") 'wy-go-to-char)

;;主题选择
(require 'color-theme)

;;(color-theme-dark-blue)
(color-theme-sitaramv-solaris)

;;设置编码格式
(prefer-coding-system 'utf-8)
;;设置字体
(create-fontset-from-fontset-spec
"-adobe-courier-medium-r-*-*-14-*-*-*-*-*-fontset-ifree,
chinese-gb2312:-wenquanyi-wenquanyi bitmap song-medium-r-*-*-15-*-*-*-*-*-iso10646-1,\
chinese-gbk:-wenquanyi-wenquanyi bitmap song-medium-r-*-*-15-*-*-*-*-*-iso10646-1,\
chinese-gb18030:-wenquanyi-wenquanyi bitmap song-medium-r-*-*-15-*-*-*-*-*-iso10646-1,\
chinese-cns11643-5:-wenquanyi-wenquanyi bitmap song-medium-r-*-*-15-*-*-*-*-*-iso10646-1,\
chinese-cns11643-6:-wenquanyi-wenquanyi bitmap song-medium-r-*-*-15-*-*-*-*-*-iso10646-1,\
chinese-cns11643-7:-wenquanyi-wenquanyi bitmap song-medium-r-*-*-15-*-*-*-*-*-iso10646-1")
(set-default-font "fontset-ifree")
(add-to-list 'after-make-frame-functions
(lambda (new-frame) (select-frame new-frame)
(set-default-font "fontset-ifree")))

;;使用cedet工具
(add-to-list 'load-path
"/usr/local/share/emacs/site-lisp/cedet-1.0pre3")
(load-file "/usr/local/share/emacs/site-lisp/cedet-1.0pre3/common/cedet.el")
;;(semantic-load-enable-code-helpers)

;;using ecb
(add-to-list 'load-path
"/usr/local/share/emacs/site-lisp/ecb-snap")
(require 'ecb)

(setq track-eol t)
;; 当光标在行尾上下移动的时候,始终保持在行尾。

(setq Man-notify-method 'pushy)
;; 当浏览 man page 时,直接跳转到 man buffer。

(setq-default kill-whole-line t)
;; 在行首 C-k 时,同时删除该行。



(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(ecb-options-version "2.33beta1")
'(ecb-tip-of-the-day nil)
'(ecb-tree-indent 1)
'(ecb-tree-truncate-lines nil)
;;'(ecb-truncate-lines nil)
'(ecb-truncate-long-names t))

(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)

(setq truncate-partial-width-windows nil)

(require 'xcscope)


;;有关c语言编程方面的设置
;;;; CC-mode配置 http://cc-mode.sourceforge.net/
(require 'cc-mode)
(c-set-offset 'inline-open 0)
(c-set-offset 'friend '-)
(c-set-offset 'substatement-open 0)

;;;我的C/C++语言编辑策略

(defun my-c-mode-common-hook()
(setq tab-width 4 indent-tabs-mode nil)
;;; hungry-delete and auto-newline
(c-toggle-auto-hungry-state 1)
;;按键定义
(define-key c-mode-base-map [(control \`)] 'hs-toggle-hiding)
(define-key c-mode-base-map [(return)] 'newline-and-indent)
(define-key c-mode-base-map [(f7)] 'compile)
(define-key c-mode-base-map [(meta \`)] 'c-indent-command)
;; (define-key c-mode-base-map [(tab)] 'hippie-expand)
(define-key c-mode-base-map [(tab)] 'my-indent-or-complete)
(define-key c-mode-base-map [(meta ?/)] 'semantic-ia-complete-symbol-menu)

;;预处理设置
(setq c-macro-shrink-window-flag t)
(setq c-macro-preprocessor "cpp")
(setq c-macro-cppflags " ")
(setq c-macro-prompt-flag t)
(setq hs-minor-mode t)
(setq abbrev-mode t)
)
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)

;;;;我的C++语言编辑策略
(defun my-c++-mode-hook()
(setq tab-width 4 indent-tabs-mode nil)
(c-set-style "stroustrup")
;; (define-key c++-mode-map [f3] 'replace-regexp)
)

;;配置semantic检索的范围
(setq semanticdb-project-roots
(list
(expand-file-name "/")))

(defun my-indent-or-complete ()
(interactive)
(if (looking-at "\\>")
(hippie-expand nil)
(indent-for-tab-command))
)

(global-set-key [(control tab)] 'my-indent-or-complete)

(autoload 'senator-try-expand-semantic "senator")

(setq hippie-expand-try-functions-list
'(
senator-try-expand-semantic
try-expand-dabbrev
try-expand-dabbrev-visible
try-expand-dabbrev-all-buffers
try-expand-dabbrev-from-kill
try-expand-list
try-expand-list-all-buffers
try-expand-line
try-expand-line-all-buffers
try-complete-file-name-partially
try-complete-file-name
try-expand-whole-kill
)
)
(defun eshell/clear ()
"04Dec2001 - sailor, to clear the eshell buffer."
(interactive)
(let ((inhibit-read-only t))
(erase-buffer)))

;;加入对auctex以方便对latex文件的编辑
(load "auctex.el" nil t t)
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)

2007年3月8日 星期四

我手写我心

今天是三八妇女节,是广大女同胞的的节日,但对我来说,比这更为重要的是,我老婆大人的生日是今天。所以除了祝广大女同胞们节日快乐外,更要祝我老婆生日快乐,天天开心。

老婆湖北麻城人是也,于2005嫁与我这一网络民工,并于2006年顺利为我产下一胖胖的狗宝宝,为家里添了许多欢乐和喜庆。

谢谢老婆大人多年来对我这的支持与关心,谢谢老婆大人对宝宝的呵护。我将永远爱你和宝宝。

2007年3月6日 星期二

步步为营背诵新概念英语第三册

从今年三月份开始,恢复背诵nce3,去年背诵过nce2,中间由于宝宝出生的原因,背诵进程耽搁了下来。

经过对前8篇文章的背诵和测试,发现能够在半小时内背诵一篇课文,但决不表示一天能够背诵48篇。切合实际的作法是一天背诵两篇课文,上午一篇和晚上一篇,因为就我个人背诵的规律而言,下午不是最好的。下午可以做为复习巩固的时间,将已经背诵的课文用latex做成相应的pdf文档。

背诵最大的敌人是遗忘,特别是当背诵的内容多了以后,遗忘的就越快或者说记忆的准确性就越容易下降,因为这个时候不是记不起来就是将许多东西混在一起。如何处理这个难题呢,我的解决方法是通过联想法与数字桩法将记忆的内容牢牢的与数字卡在一起。

背诵课文是一个整体的过程,最为忌讳的是中间有断点。在平时最容易发生这种情况的是节假日的出现,特别是长假的出现,所以在进行安排的时候,最好将长假作为阶段总结的一个契机,而不要将一个任务安排在节前和节后的两个时间段里,这样的效果是不好 。

 
/* */