- 論壇徽章:
- 0
|
北京理工大學(xué) 20981 陳罡
一些小技巧,總是容易忘記,寫在網(wǎng)上就不容易忘記了,查起來也方便。我一直使用slackware做為自己的linux桌面環(huán)境,主要原因嘛:
首先,它full install以后基本上配套的源代碼和工具啥的都裝上了,不用再下載kernel自己編譯工具鏈啥的,比較適合像偶這樣的懶人;其次,它的啟動腳本的處理還是嚴(yán)格按照unix的機(jī)制來用習(xí)慣了;軟件管理,生成一個tgz,就可以直接用installpkg, removepkg啥的直接安裝,也馬馬虎虎。多數(shù)軟件都可以從源代碼直接編譯出來,不會缺這少那的。
(1)去掉slackware煩人的“嘀嘀”聲
打開/etc/inputrc,將“set bell-style none”前面的“!苯o去掉。
然后重新登錄一次,于是,整個世界安靜了。
(2)帖一些emacs的簡單配置,省得每次重裝都要滿世界的去找
(custom-set-variables
;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
;; Your init file should contain only one such instance.
'(case-fold-search t)
'(current-language-environment "Chinese-GB")
'(default-input-method "chinese-py-punct")
'(global-font-lock-mode t nil (font-lock)))
(custom-set-faces
;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
;; Your init file should contain only one such instance.
)
;; enable cscope support
(add-hook 'c-mode-common-hook
'(lambda ()
(require 'xcscope)))
;; python-mode support
(setq auto-mode-alist (cons '("
\\.py$
" . python-mode) auto-mode-alist))
(setq interpreter-mode-alist (cons '("python" . python-mode) interpreter-mode-alist))
(autoload 'python-mode "python-mode" "Python editing mode." t)
(setq font-lock-maximum-decoration t)
(global-font-lock-mode t)
;; get off tool bar
(tool-bar-mode -1)
(setq-default make-backup-files nil)
(show-paren-mode t)
(setq lazy-lock-defer-on-scrolling t)
(setq font-lock-support-mode 'lazy-lock-mode)
(column-number-mode t)
(display-time)
;; replace yes, no selection to y or n directly
(fset 'yes-or-no-p 'y-or-n-p)
(setq visiable-bell t)
(global-set-key [?\S- ] 'set-mark-command)
;; set emacs default frame window size
(setq default-frame-alist (append '((top . 0) (left . 0) (width . 100) (height . 40)) default-frame-alist))
;; highlight selected regions
(transient-mark-mode t)
(put 'upcase-region 'disabled nil)
;; text mode first
(setq default-major-mode 'text-mode)
;; support middle mouse key paste
(setq mouse-yank-at-point t)
(transient-mark-mode t)
;; support open iamge file
(auto-image-file-mode t)
;; shut up
(setq visible-bell t)
;; support mouse wheel
(mouse-wheel-mode t)
(3)對usb鼠標(biāo)滾輪的支持方法
打開/etc/X11/xorg.conf,然后修改Identifier為Mouse1的Sesstion,使其滿足下面的配置:
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "IMPS/2"
Option "Device" "/dev/mouse"
Option "Buttons" "5"
Option "ZAxisMapping" "4 5"
EndSection
(4)做為公網(wǎng)服務(wù)器的時候,得到公網(wǎng)ip地址的腳本
#!/usr/bin/python
import os ;
import commands ;
cmd_str = "wget -q -O - www.whatismyip.org | sed -e 's/.*Current IP Address: //' -e 's/ ;
output_str = commands.getoutput(cmd_str) ;
print "public ip is ----> " + output_str ;
本文來自ChinaUnix博客,如果查看原文請點:http://blog.chinaunix.net/u/26691/showart_714736.html |
|