Ubuntu Setup

Category: /knowledge /linux
Tags: linux

System setup

config

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

or 

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”

Commands

Add yourself to be a sudoer

sudo -s 
visudo

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

DESKTOP="KDE"
#or DESKTOP="GNOME" as the default value

NFS server/client

UPnP/DLNA server

minidlna is very good a very low resource light weight app
http://sourceforge.net/projects/minidlna/

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

指定目录
media_dir=/home/storage/media
media_dir=/home/media
path/to/minidlna -f $path/to/minidlna.conf

SAMBA

sudo aptitude install samba
sudo smbpasswd -a $USERNAME
sudo gedit /etc/samba/smb.conf
[media]
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 192.168.1.8 -U%
以前的版本用smbfs, 后来的用cifs
sudo mount -t cifs 192.168.1.8:/MEMORYCARD /mnt/disk

check your ubuntu version

lsb_release -a

format/boot

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

lshw

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

Hardware

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

Reference

  • 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.

Backup

conf files ———–

/etc/rc.local
/etc/hosts
/etc/hosts.allow
/etc/hosts.deny
/etc/resolv.conf
/etc/exports (for NFS)
/etc/ssh/sshd_config
/etc/apache2 conf, sites and certificate
/etc/nginx
/etc/X11/xorg.conf
/usr/NX/etc/{node.cfg,server.cfg}
/etc/postgresql/x.y/main/p*.conf

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

KDE/Kubuntu

  • 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没有帮助. (潜台词: 请不要灌水, 谢谢)