基礎設定

http://paste.ubuntu-nl.org/3966/

#!/bin/bash
# 
# Ubuntu GNU/Linux Install Script
# by Cornelius <cornelius.howl@gmail.com>
# 
if [ `id -u` != "0" ]; then
	echo "Sorry, you are not root."
	echo "Type: sudo -s , then run this script again."
	exit 1
fi

echo "Ubuntu Edgy Install Script. by Cornelius"
echo "bug report: cornelius.howl [at] gmail.com"

echo Create Alias \(y/N\)
read alias_op
echo Get Source List \(y/N\)
read sourcelist_op
echo Scim \(y/N\)
read scim_op
echo Asus Util \(y/N\)
read asus_op
echo Ntfs-3G \(y/N\)
read ntfs3g_op
echo Vimrc \(y/N\)
read vimrc_op
echo Xpdf \(y/N\)
read xpdf_op
echo Nvidia Driver? \(y/N\)
read nvidiadriver_op
echo Auto Reboot? \(After Installation\) \(y/N\)
read reboot_op

#####################	
#    Sources List	
#####################	
if [ $sourcelist_op = y ]
then
	#backup sourcelist
	cp /etc/apt/sources.list /etc/apt/sources.list.backup
	wget http://apt.ubuntu.org.tw/sources.list.edgy
	wget http://apt.ubuntu.org.tw/sources.list.dapper
	mv sources.list.edgy /etc/apt/sources.list
	mv sources.list.dapper /etc/apt/sources.list.dapper

cat <<EOF >> /etc/apt/sources.list
#for wxWidget
deb http://apt.tt-solutions.com/ubuntu/ dapper main

#for gcin
deb http://apt.ubuntu.org.tw ubtw/

#google
deb http://dl.google.com/linux/deb/ stable non-free
EOF
fi

#update sources
echo Updating
apt-get update -y --force-yes -q

echo Upgrading
apt-get upgrade -y --force-yes -q

#clear screen
clear

#number lock on
echo LEDS=+num >> /etc/console-tools/config

###############################################
#installation part
###############################################

#############
# for rc
#############
#create vimrc
if [ $vimrc_op ] 
then
cat <<EOF > .vimrc
syntax on
set nu
set nowrap
colorscheme blue
#colorscheme zellner 
EOF
fi
#############
#	alias
#############
if [ $alias_op = y ] 
then
	cp ~/.bashrc ~/.bashrc.backup.`date +%Y%m%d`
	cp /etc/bashrc ~/bashrc.backup.`date +%Y%m%d`

cat <<EOF >> /etc/bashrc
alias ll='ls -l' 
alias la='ls -A'
alias l='ls -CF'  
alias agi='sudo apt-get install' 
alias acs='sudo apt-cache search' 
alias agr='sudo apt-get remove'
alias aupd='sudo apt-get update' 
alias aupg='sudo apt-get upgrade' 
alias ags='sudo apt-get source'
alias sv='sudo vim'
alias sgv='sudo gvim'
alias psg='ps ax -o pid,cmd,status|grep'
alias fnd='find . -name'
alias mine='chown -R cornelius:cornelius'

EOF
	source /etc/bashrc
fi




#############
#Driver
#############
#sound driver
apt-get install alsa-base -y --force-yes -q
#install ASUS tool set
if [ $asus_op = y ]
then
	sudo apt-get install digitools -y --force-yes
fi
#nvidia driver
if [ $nvidiadriver_op = y ]
then
	sudo apt-get install nvidia-glx
	sudo nvidia-glx-config enable 
fi


##########
#Essential
##########
apt-get install filezilla xfce4 xchat-gnome xfwm4 -y  --force-yes
apt-get install language-pack-gnome-zh language-pack-zh language-support-zh -y --force-yes
apt-get install gnome-utils gpm gdm gparted -y --force-yes
apt-get install gnomermind gnome-control-center 

#Messengers
apt-get install gaim kopete kmess -y --force-yes
#realplayer
apt-get install realplay -y --force-yes
#install flash-player
sudo apt-get install flashplugin-nonfree
sudo update-flashplugin
#archieve tools
apt-get install rar p7zip-full -y --force-yes -q
#pdf
if [ $xpdf_op = y ]
then
	apt-get install xpdf -y --force-yes
fi
#w32code for media encoding
cd /tmp
wget http://ftp.acc.umu.se/mirror/debian-multimedia/pool/main/w/w32codecs/w32codecs_20061022-0.0_i386.deb
sudo dpkg -i w32codecs_20061022-0.0_i386.deb
#install gstreamer
sudo apt-get install gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse gstreamer0.10-plugins-bad -y --force-yes
sudo apt-get install gstreamer0.10-plugins-bad-multiverse -y --force-yes
sudo apt-get install gstreamer0.10-pitfdll -y --force-yes
sudo apt-get install gstreamer0.10-gl -y --force-yes
sudo apt-get install gstreamer0.10-ffmpeg -y --force-yes
sudo apt-get install vorbis-tools -y --force-yes
sudo apt-get install lame sox ffmpeg mjpegtools -y --force-yes

#install quante plus
sudo apt-get install quanta -y --force-yes
sudo apt-get install planner -y  --force-yes



##############
#Chinese fonts
##############
sudo apt-get install ttf-arphic-newsung ttf-arphic-ukai ttf-arphic-uming -y --force-yes

#create font local.conf
cat <<EOF >> local.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>

<!-- Disable antialias feature of AR PL ShanHeiSun Uni when pixelsize less than 17 -->
        <match target="font">
                <test name="family"><string>AR PL ShanHeiSun Uni</string></test>                
                <edit name="antialias"><bool>false</bool></edit>
                <edit name="hinting"><bool>true</bool></edit>
                <edit name="autohint"><bool>false</bool></edit>
        </match>
        <match target="font">
                <test name="family"><string>AR PL ShanHeiSun Uni</string></test>                
                <test name="pixelsize" compare="more_eq"><int>17</int></test>
                <edit name="antialias" mode="assign"><bool>true</bool></edit>
                <edit name="hinting" mode="assign"><bool>true</bool></edit>
        </match>

</fontconfig>
EOF
sudo cp  local.conf /etc/fonts/

#other font
echo Installign Fonts
sudo apt-get install xfonts-intl-chinese -y -q --force-yes
sudo apt-get install xfonts-intl-chinese-big -y -q --force-yes
sudo apt-get install xfonts-intl-european -y -q --force-yes
sudo apt-get install xfonts-intl-japanese -y -q --force-yes
sudo apt-get install xfonts-intl-japanese-big -y -q  --force-yes
sudo apt-get install xfonts-intl-phonetic -y -q  --force-yes
sudo apt-get install gsfonts-x11 -y -q --force-yes
sudo apt-get install msttcorefonts -y -q --force-yes
sudo apt-get install ttf2pt1-chinese -y -q --force-yes
sudo fc-cache -f -v

wget http://cle.linux.org.tw/fonts/cwttf/deb/ttf-cwtex-center-cwfs_1.0-1_all.deb
wget http://cle.linux.org.tw/fonts/cwttf/deb/ttf-cwtex-center-cwheib_1.0-1_all.deb
wget http://cle.linux.org.tw/fonts/cwttf/deb/ttf-cwtex-center-cwkai_1.0-1_all.deb
wget http://cle.linux.org.tw/fonts/cwttf/deb/ttf-cwtex-center-cwming_1.0-1_all.deb
wget http://cle.linux.org.tw/fonts/cwttf/deb/ttf-cwtex-center-cwyen_1.0-1_all.deb
sudo dpkg -i ttf-cwtex-center-cwfs_1.0-1_all.deb
sudo dpkg -i ttf-cwtex-center-cwheib_1.0-1_all.deb
sudo dpkg -i ttf-cwtex-center-cwkai_1.0-1_all.deb
sudo dpkg -i ttf-cwtex-center-cwming_1.0-1_all.deb
sudo dpkg -i ttf-cwtex-center-cwyen_1.0-1_all.deb
sudo fc-cache -v

#############
# IME
#############
#install scim
if [ $scim_op = y ]
then
	sudo apt-get install scim scim-chinese scim-config-socket -y --force-yes
	sudo apt-get install scim-gtk2-immodule scim-tables-zh -y --force-yes

	sudo touch /etc/X11/Xsession.d/74custom-scim_startup
	sudo chmod 646 /etc/X11/Xsession.d/74custom-scim_startup
	echo 'export XMODIFIERS="@im=SCIM"' >> /etc/X11/Xsession.d/74custom-scim_startup
	echo 'export GTK_IM_MODULE="scim"' >> /etc/X11/Xsession.d/74custom-scim_startup
	echo 'export XIM_PROGRAM="scim -d"' >> /etc/X11/Xsession.d/74custom-scim_startup
	echo 'export QT_IM_MODULE="scim"' >> /etc/X11/Xsession.d/74custom-scim_startup
	echo 'scim -f x11 -d' >> /etc/X11/Xsession.d/74custom-scim_startup
	echo 'scim -f socket  -d' >>/etc/X11/Xsession.d/74custom-scim_startup
	sudo chmod 644 /etc/X11/Xsession.d/74custom-scim_startup

	sudo apt-get install scim-chewing -y	 --force-yes
fi

##########
#ntfs tool
##########
if [ $ntfs3g_op = y ]
then
	sudo apt-get install ntfs-3g -y --force-yes

	#ntfs-3g append to fstab
cat <<EOF > /etc/fstab
	/dev/hda5 /media/hda5     ntfs-3g slient,umask=0,locale=zh_TW.utf8 0 0  
	/dev/hda1 /media/hda1	  ntfs-3g slient,umask=0,locale=zh_TW.utf8 0 0
	/dev/hdb1 /media/hdb1     ntfs-3g slient,umask=0,locale=zh_TW.utf8 0 0 
	/dev/sda1 /media/sda1     ntfs-3g slient,umask=0,locale=zh_TW.utf8 0 0 
	/dev/sda5 /media/sda5     ntfs-3g slient,umask=0,locale=zh_TW.utf8 0 0  
EOF

fi

#samba server
if [ $samba_op = y ]
then
	apt-get install samba smbfs -y --force-yes
fi


#install theme
apt-get install gnome-icon-theme gnome-themes gcursor gnome-art 
apt-get install gnome-themes-extras gnome-backgrounds gnome-desktop-environment gnome-mag gnome-accessibility-themes -y --force-yes

#stardict
apt-get install stardict -y -q

#build tools
apt-get install ^apt-.*
apt-get install gnu-standards coreutils libgtk.*-dev -y  --force-yes
apt-get install dpkg automake autoconf dpkg-dev dpkg-repack dpkg-sig dpkg-www -y --force-yes
apt-get install build-essential -y -q --force-yes

#subversion
apt-get install subversion -y -q

#netselect
apt-get install netselect -y -q

#php
apt-get install php5 php5-gd php5-mysqli -y

apt-get install perl -y -q --force-yes
apt-get install gcc g++ -y --force-yes -q
apt-get install vim-gnome vim-full curl mozilla-firefox gmail-notify -y --force-yes -q


#get amule source , and install library
apt-get build-dep amule -y --force-yes
apt-get source amule -y --force-yes

#wxWidget
curl http://www.tt-solutions.com/vz/key.asc | apt-key add -
apt-get update
apt-get install wx\*2.8 -y -q

#restart samba server
#sudo testparm
sudo /etc/init.d/samba restart

#install java
apt-get install sun-java5-jre sun-java5-jdk -y --force-yes -q

#install pcmanfm & pcmanx
apt-get install pcmanx-gtk2 mozilla-plugin-pcmanx -y --force-yes -q
apt-get install pcmanfm -y --force-yes -q


#show information
cat <<EOF
Netselect: find out the fastest mirror server
you can fetch your mirror sources.list from :
	Sources.list generator
	http://www.ubuntu-nl.org/source-o-matic/
EOF 
netselect apt.ubuntu.org.tw tw.archive.ubuntu.com ubuntu.csie.ntu.edu.tw opensource.nchc.org.tw

echo Nvidia: show if rendering
echo more information: 
echo https://help.ubuntu.com/6.10/ubuntu/desktopguide/C/graphics-cards.html
glxinfo | grep rendering


if [ $reboot_op = y ]
then
	reboot
fi

安裝 RealPlayer

https://player.helixcommunity.org/2005/downloads/