Linux Work Enviroment Build Record

1, Install Debian Squeeze
select standard system tools category only

2, Switch distribute to Wheezy
a, edit /etc/apt/sources.list, the contect is follow

deb testing main contrib non-free
deb testing/updates main contrib non-free

b, fetch package list
execute follow command in root console

#aptitdu update

c, update system to Wheezy
execute follow command in root console

#aptitude dist-upgrade

d, reboot system after update process is complete.

3, Configure system
a, locales
execute follow command in root console

#dpkg-reconfigure locales

select all en_US/zh_CN/zh_TW locale, the default locale is en_US.UTF-8

b, console resolution
execute hwinfo –framebuffer will display your graphic card support resolution
edit /etc/default/grub, add the line as follow


edit /etc/grub.d/00_header, add follow line after 132 line

set gfxpayload=keep

if grub2 not display corrent with this resolution, it’s can change keep to corrent resolution.

general /boot/grub/grub/cfg, execute follow command in root console

#grub-mkconfig -o /boot/grub/grub.cfg

c, timezone
edit /etc/default/rcS, change UTC=yes to UTC=no

4, Install package from network
execute follow command in root console

#aptitude install sudo unzip unrar vim emacs rcconf build-essential hwinfo git xorg iceweasel ibus ibus-table-wubi xfonts-wqy ttf-wqy-zenhei ttf-wqy-microhei fonts-droid feh scrot alsa-base alsa-utils

5, Install Google Chrome
create text file /etc/apt/sources.list.d/google-chrome.list with follow contect

deb stand main

then update package list and install package, the command as follow

#aptitude update
#aptitude install google-chrome-stable

6, Compile Window Manager
download dmenu source code from it’s homepage
then execute follow command in root console

#tar zxvf dmenu-x.x.tar.gz
#cd dmenu-x.x
#make clean install

dmenu will install to /usr/local/bin/ directory

create script file dmenu_path in /usr/local/bin/ with follow contect, mode is 0755

     uptodate() {
             test -f "$CACHE" &&
             for dir in $PATH
                     test ! $dir -nt "$CACHE" || return 1
     if !  uptodate
             for dir in $PATH
                     cd "$dir" &&
                     for file in *
                             test -x "$file" && echo "$file"
             done | sort | uniq > "$CACHE".$$ &&
             mv "$CACHE".$$ "$CACHE"
     cat "$CACHE"

download Musca source code from it’s homepage
then exectue follow command in root console

#tar zxvf musca-x.x.x.tar.gz
#cd musca-x.x.x
#cp apis /usr/local/bin/
#cp musca /usr/local/bin/
#cp xlisten /usr/local/bin

7, Configure X
the X server xorg haven’t configure by manual, it’s work well by itself.

create musca config file ~/.musca_start with follow contect

       set window_open_frame empty
       set border_width 0
       border off
       pad 0 0 0 0
       hook on ^add pad 0 0 0 0
       name Management
       add Programming
       add Internet
       add Multimedia
       use 0
       bind on Mod4+e exec emacs
       bind on Mod4+b exec google-chrome
       bind on Mod4+0 use 0
       bind on Mod4+1 use 1
       bind on Mod4+2 use 2
       bind on Mod4+3 use 3

create X lunchar file ~/.xinitrc with follow contect

       export XMODIFIERS="@im=ibus"
       export XIM=ibus
       export GTK_IM_MODULE=ibus
       export QT_IM_MODULE=ibus
       exec ibus-daemon &
       exec musca

default, XTerm english font is too small, and can’t display chinese, so change the default font
XTerm config is build-in ~/.Xdefault, the contect as follow

       Xft.dpi: 96
       Xft.antialias: true
       XTerm*locale: true
       XTerm*utf8: true
       XTerm*utf8Title: true
       XTerm*renderFont: true
       XTerm*preeditType: Root
       XTerm*xftAntialias: true
       XTerm*fontMenu*fontdefault*Label: Default
       XTerm*faceName: Droid Sans Mono:antialias=true:pixelsize=13
       XTerm*faceNameDoublesize: WenQuanYi Zen Hei:antialias=true:pixelsize=13
       XTerm*cjkWidth: false
       XTerm*background: black
       XTerm*foreground: white
       XTerm*SaveLines: 3000
       XTerm*VT100.Translations: #override \
               Ctrl  V: insert-selection(CLIPBOARD,PRIMARY,CUT_BUFFER0) \n\
               : select-end(CLIPBOARD,PRIMARY,CUT_BUFFER0) \n\
               Ctrl  P: print() \n

Install ZendOptimizer 3.3.9 to Lenny

# php -v
PHP 5.2.6-1+lenny9 with Suhosin-Patch (cli) (built: Aug  4 2010 03:25:57)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies

# wget

# tar zxvf ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz

# cp ZendOptimizer-3.3.9-linux-glibc23-i386/data/5_2_x_comp/ /usr/lib/php5/

# echo “zend_extension=/usr/lib/php5/” > /etc/php5/conf.d/zend.ini

# /etc/init.d/apache2 restart

# php -v
PHP 5.2.6-1+lenny9 with Suhosin-Patch (cli) (built: Aug  4 2010 03:25:57)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
    with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies

Install pptp and radius on lenny

1,install all packages
#apt-get install pptpd freeradius radiusclient1

2,configure pptp
#vim /etc/pptpd.conf


#vim /etc/ppp/pptpd-options

plugin /usr/lib/pppd/2.4.4/
radius-config-file /etc/radiusclient/radiusclient.conf

3,configure radius
#vim /etc/freeradius/client.conf

client {
 secret  = mysecret
 nastype     = other

#vim /etc/freeradius/users

myusername Cleartext-Password := “mypassword”
 Service-Type = Framed-User,
 Framed-Protocol = PPP,
 Framed-IP-Address =,
 Framed-IP-Netmask =,
 Framed-Routing = Broadcast-Listen,
 Framed-Filter-Id = “std.ppp”,
 Framed-MTU = 1500,
 Framed-Compression = Van-Jacobsen-TCP-IP
4,configure radclient
#vim /etc/radiusclient           mysecret
#vim /etc/radiusclient/

add content from

#vim /etc/radiusclient/dictionary

INCLUDE /etc/radiusclient/
INCLUDE /etc/radiusclient/dictionary.merit
5,test radius
#radtest myusername mypassword 0 mysecret

6,if OS not exist /dev/ppp device,creat it
#mknod /dev/ppp c 108 0





invoke-rc.d exim4 stop

invoke-rc.d nfs-common start




update-rc.d –f exim4 remove

update-rc.d nfs-common start 20 3 4 5