Ubuntu Setup

Category: /knowledge /linux
Tags: linux

System setup


setup default editor to vi

sudo update-alternatives --config editor
choose vim.basic

turn off the bell

sudo vi /etc/inputrc

set bell-style none
set bell-style visuble

in .vimrc

set visualbell


set noerrorbells

play/copy DVD

sudo apt-get install ubuntu-restricted-extras
sudo /usr/share/doc/libdvdread4/install-css.sh

KDE config

Diable the annoying effect “maximize on top edge”. “System settings/Window Behavior/Screen Edge”, uncheck “Maximize windows by dragging them to the top of the screen”


Add yourself to be a sudoer

sudo -s 

visudo vi /etc/sudoers
#Note that it could be dangerous as you can anything you want.
yourUserName    ALL=(ALL) ALL

#shutdown computer without asking password
situ    ALL=NOPASSWD:  /usr/sbin/pppd
situ    ALL=NOPASSWD:  /sbin/shutdown

#mount/umount any storage without asking password
situ ALL= NOPASSWD: /bin/mount,/bin/umount

Choose Your Desktop Manager

vi /etc/sysconfig/desktop

#or DESKTOP="GNOME" as the default value

NFS server/client

UPnP/DLNA server

minidlna is very good a very low resource light weight app

我选择装了minidlna, 从上面链接下载文件以后, 解压运行

path/to/minidlna -f $path/to/minidlna.conf


sudo aptitude install samba
sudo smbpasswd -a $USERNAME
sudo gedit /etc/samba/smb.conf
path = /home/$USERNAME/your_shared_folder
available = yes
valid users = $USERNAME
read only = no
browsable = yes
public = yes
writable = yes

上面是最简单的设置, 让目录和文件可以从客房端直接读写. 改完配置文件后, 重启SAMBA.

sudo restart smbd

重启后, 在SERVER上测试一下

sudo testparm

Manually mount from client shell

smbclient -L -U%
以前的版本用smbfs, 后来的用cifs
sudo mount -t cifs /mnt/disk

check your ubuntu version

lsb_release -a


To format a usb fdisk

mkfs.vfat -F 32 -n disk_label /dev/sdx1

change the disk lable

sudo e2label /dev/sdb1 your-new-label

install grub2

grub-install --force --no-floppy --root-directory=/media/your_usb_mount /dev/sdx

sample grub.cfg in path/to/your_usb_mount/boot/grub/

set timeout=10
set default=0

menuentry "Kubuntu 10.04 Desktop ISO" {
 loopback loop /ubuntu.iso
 linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/kubuntu-10.04.iso noeject noprompt splash --
 initrd (loop)/casper/initrd.lz

menuentry "Memtest 86+" {
 linux16 /memtest86+.bin

menuentry "SystemRescueCd" {
 loopback loop /systemrescuecd.iso
 linux (loop)/isolinux/rescuecd isoloop=/systemrescuecd.iso setkmap=us docache dostartx
 initrd (loop)/isolinux/initram.igz

get hardware info


sudo hdparm -i /dev/sdb (or I for more details)


find /sys/ -type f -name "model"

看所有硬件列表, 找到你要找的名称, 再去google查spec


test hard disk read/write speed

sudo hdparm -t /dev/sdb1

for write speed

 dd count=1k bs=1M if=/dev/zero of=/media/your_device_folder/test.img

 The result of my Sandisk Cruzer USB drive is: 
 1024+0 records in
 1024+0 records out
 1073741824 bytes (1.1 GB) copied, 227.093 s, 4.7 MB/s


Jetway mini-top ION2 ———————–

  • setup audio playback device. check version

    uname -r; cat /proc/asound/version

alsamixer, F6 to choose different sound cards

List audio device

aplay -l

install alsa modules

sudo aptitude install linux-backports-modules-alsa-2.6.35-24-generic-pae

try sound cards

aplay -Dplughw:0,7 /usr/share/sounds/alsa/Front_Right.wav 

sudo vi /etc/modprobe.d/sound.conf

For ION2 
options snd-had-intel enable_msi=0 probe_mask=0xfff2

For other GPU 
options snd-had-intel enable_msi=0 probe_mask=0xffff,0xfff2

sudo vi /etc/modprobe.d/blacklist.conf

# for jetway mini-top HDMI
blacklist vga16fb
blacklist nouveau
blacklist rivafb
blacklist nvidiafb
blacklist rivatv


  • http://forum.xbmc.org/showthread.php?t=78722&page=9 #84
  • http://ubuntuforums.org/archive/index.php/t-1552250.html
  • http://ubuntuforums.org/showthread.php?t=1552250
  • http://ubuntuforums.org/showthread.php?p=10188661
  • http://ubuntuforums.org/showthread.php?t=1619802&page=3

  • setup webcam capture device for Skype, Kubuntu 10.10 (KDE 4.5)
    • in skype, you must disable the option “Allow Skype to automatically adjust my mixer level”
    • in “System settings/Multimedia/Phonon/Audio Capture”, you need to adjust the order of devices, to make USB device to show up in front of the default internal sound cards.


conf files ———–

/etc/exports (for NFS)
/etc/apache2 conf, sites and certificate

Write down the wireless driver, video card driver version, sound card


  • okular, annotations are saved as ~/.kde/share/apps/okular/docdata/. you can also export the while doc+annoations as “Document Archiv”

  • config sleep/hibernate, my HP laptop can not resume after hibernate, I need to disable the hibernate option.

     sudo vi /etc/default/acpi-support
  • if Kubuntu losts network after hibernate/suspend, try this

      sudo vi /var/lib/NetworkManager/NetworkManager.state
      NetworkingEnabled=false to true
      save and reboot
  • if touchpad loses response, try this

     synclient TouchpadOff=0



  • 如果看不到讨论部分, 请暂时关掉adblock in Firefox/Chrome
  • 本网站使用Javascript实现评论功能, 此处外链对提高您的网站PR没有帮助. (潜台词: 请不要灌水, 谢谢)