Porting Notes

Mirror list

/etc/apt/sources.list

# deb http://tw.mirror.devuan.org/merged/ jessie main

deb http://tw.mirror.devuan.org/merged/ jessie main non-free contrib
deb-src http://tw.mirror.devuan.org/merged/ jessie main non-free contrib

# jessie-security, previously known as 'volatile'
deb http://tw.mirror.devuan.org/merged/ jessie-security main contrib non-free
#deb-src http://tw.mirror.devuan.org/merged/ jessie-security main contrib non-free

# jessie-updates, previously known as 'volatile'
deb http://tw.mirror.devuan.org/merged/ jessie-updates main contrib non-free
#deb-src http://tw.mirror.devuan.org/merged/ jessie-updates main contrib non-free

# Fglrx-driver
deb http://httpredir.debian.org/debian/ jessie main contrib non-free
deb http://httpredir.debian.org/debian/ jessie-backports main contrib non-free

# Multimedia
deb http://www.deb-multimedia.org jessie main non-free

#deb http://mirror.cs.nchu.edu.tw/debian/ jessie main contrib non-free
#deb-src http://mirror.cs.nchu.edu.tw/debian/ jessie main
#deb http://mirror.cs.nchu.edu.tw/debian/ jessie-updates main contrib non-free
#deb http://mirror.cs.nchu.edu.tw/debian/ jessie-proposed-updates main contrib non-free

Audio

Multimedia

sudo aptitude update
sudo aptitude install deb-multimedia-keyring

Pulseaudio

Listen Line-in (loopback)

pactl load-module module-loopback
cat /etc/pulse/default.pa
...
load-module module-loopback

Bluetooth

sudo aptitude install bluetooth blueman

Fix audio delay

#!/bin/bash
BLUEZCARD=`pactl list cards short | egrep -o bluez.*[[:space:]]`
pactl set-card-profile $BLUEZCARD a2dp_sink
pactl set-card-profile $BLUEZCARD off
pactl set-card-profile $BLUEZCARD a2dp_sink

Connect keyboard

bluetoothctl
power on
agent on
pair <MAC address>
connect <MAC address>

Video

Xorg

Install AMD/ATI Driver (fglrx)

sudo aptitude install fglrx-driver fglrx-modules-dkms

Try to completely remove your ATI drivers from your system

sudo apt-get purge "fglrx.*"
sudo apt-get install --reinstall xserver-xorg-core libgl1-mesa-glx libgl1-mesa-dri
sudo dpkg-reconfigure xserver-xorg
sudo reboot

Change Resolution (xrandr)

sudo aptitude install linux-headers-amd64
xrandr -q
xrandr --newmode "1920x1080" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -HSync +VSync
xrandr --addmode VGA-0 "1920x1080"
xrandr --output VGA-0 --mode "1920x1080"

Dual Screen

xrandr --output HDMI-0 --mode 1920x1080 --output DVI-0 --mode 1920x1080 --right-of HDMI-0

Profile

.profile

# if running bash if [ -n "$BASH_VERSION" ]; then # include .bashrc if it exists if [ -f "$HOME/.bashrc" ]; then . "$HOME/.bashrc" fi fi PATH=.:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin export PATH

.bashrc

diff .bashrc .bashrc.orig
46c46 < force_color_prompt=yes --- > #force_color_prompt=yes 60c60 < PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u\[\033[00m\]@\[\033[35m\]\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' --- > PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' 111,112d110 < PATH=.:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin < export PATH

.bashrc for VM

diff .bashrc .bashrc.orig
46c46 < force_color_prompt=yes --- > #force_color_prompt=yes 60c60 < PS1='[${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u\[\033[00m\]@\[\033[33m\]\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]]\$ ' --- > PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' 111,112d110 < PATH=.:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin < export PATH

Emacs

版面配色

sudo aptitude install emacs-goodies-el
diff .emacs .emacs.orig
13,18d12 < (require 'color-theme) < (color-theme-initialize) < (eval-after-load "color-theme" < '(progn < (color-theme-initialize) < (color-theme-hober)))

php-mode

cd .emacs.d
wget http://php-mode.svn.sourceforge.net/svnroot/php-mode/tags/php-mode-1.5.0/php-mode.el
EDIT .emacs
;;set php-mode (autoload 'php-mode "~/.emacs.d/php-mode" "Major mode for editing php code." t) (add-to-list 'auto-mode-alist '("\\.php$" . php-mode)) (add-to-list 'auto-mode-alist '("\\.inc$" . php-mode))

Reverse Mouse Scrolling

echo "pointer = 1 2 3 5 4 6 7 8 9 10 11 12" > .Xmodmap
xmodmap .Xmodmap

Media Key Binding

LXDE (openbox)

emacs ~/.config/openbox/lxde-rc.xml&
C-s <!-- Keybindings for running applications -->
<!-- Keybindings for audio volume --> <keybind key="XF86AudioLowerVolume"> <action name="Execute"> <execute>amixer -q set Master 1- unmute</execute> </action> </keybind> <keybind key="XF86AudioRaiseVolume"> <action name="Execute"> <execute>amixer -q set Master 1+ unmute</execute> </action> </keybind> <keybind key="XF86AudioMute"> <action name="Execute"> <execute>amixer -q set Master toggle</execute> </action> </keybind>
mv ~/.config/openbox/lxde-rc.xml~ ~/.config/openbox/lxde-rc.xml.orig

Synchronize Directory

Rsync

sudo aptitude install rsync
rsync -rltvp --delete -e "ssh -p 22 -l user" Source_Host:/backup/Dropbox/ /backup/Dropbox/

Unison 雙向同步

sudo aptitude install unison
ssh -t host2 sudo aptitude install unison
unison
ssh host2 unison
emacs .unison/default.prf &
# Unison preferences file root = /backup root = ssh://host2//backup path = Dropbox auto = true batch = true maxthreads = 500 owner = true group = true perms = -1 repeat = 1 retry = 3 sshargs = -C xferbycopying = true silent = true fastcheck = true log = true logfile = /home/user/.unison/unison.log
mv .unison/default.prf~ .unison/default.prf.orig
unison &

中文輸入、亂碼解決

fcitx

sudo aptitude install fcitx fcitx-chewing fcitx-frontend-all

hime

sudo aptitude install hime im-switch
im-switch -s hime

emacs (ibus)

sudo aptitude install ibus ibus-chewing python-xlib
ibus-daemon -d

下載 ibus.el - IBus client for GNU Emacs

tar zxvf ibus-el-0.3.2.tar.gz
cp -a ibus-el-0.3.2 ~/.emacs.d/
edit .emacs
;;set ibus-el (add-to-list 'load-path "~/.emacs.d/ibus-el-0.3.2") (require 'ibus) (add-hook 'after-init-hook 'ibus-mode-on)

中文字體

sudo aptitude install fonts-cwtex-heib ttf-wqy-microhei xfonts-intl-chinese-big xfonts-intl-chinese

中文啟動軟體

cd /usr/share/applications
sudo sed -i 's/Exec=/Exec=env LANG=zh_TW.UTF-8 /g' softwares.desktop
sudo aptitude search zh-tw
sudo aptitude install softwares-l10n-zh-tw

Console 滑鼠支援

sudo aptitude install gpm

Time sunc

sudo aptitude install ntpdate
sudo ntpdate 140.120.1.2

SuHu