Porting Notes

Install devuan_jessie_1.0.0-beta_amd64_NETINST.iso

Installed softwares

Sources list

/etc/apt/sources.list

sudo cp /etc/apt/sources.list /etc/apt/sources.list.orig
deb http://mirror.cs.nchu.edu.tw/devuan/ 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://mirror.cs.nchu.edu.tw/devuan/ 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://mirror.cs.nchu.edu.tw/devuan/ jessie-updates main contrib non-free
#deb-src http://tw.mirror.devuan.org/merged/ jessie-updates main contrib non-free

deb http://mirror.cs.nchu.edu.tw/devuan/ ascii main non-free contrib
deb http://mirror.cs.nchu.edu.tw/devuan/ ascii-security main contrib non-free
deb http://mirror.cs.nchu.edu.tw/devuan/ ascii-updates main contrib non-free

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

sudo aptitude update
sudo aptitude install deb-multimedia-keyring
sudo aptitude update
sudo aptitude dist-upgrade
      Remove the following packages:
1)      aptitude
2)      libpng12-dev
3)      perl-modules
4)      rsyslog

sudo apt-get install aptitude
sudo aptitude install rsyslog
sudo aptitude install deborphan
sudo dpkg -P `deborphan`
sudo aptitude clean

System

base system tools and drivers

sudo aptitude install linux-headers-amd64 firmware-linux-free build-essential
sudo aptitude install firmware-linux-nonfree
sudo init 6

sudo user

su
cp /etc/sudoers /etc/sudoers
nano /etc/sudoers
diff /etc/sudoers /etc/sudoers
21d20
$lt; cssu	ALL=(ALL) NOPASSWD:ALL

profiles (PATH, PS1)

cp .profile .profile.orig
diff .profile .profile.orig
19c19,22
< export PATH=.:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
---
> # set PATH so it includes user's private bin if it exists
> if [ -d "$HOME/bin" ] ; then
>     PATH="$HOME/bin:$PATH"
> fi

cp .bashrc .bashrc.orig
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\]\$ '
114,115d113
<
< export PATH=.:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin

sudo dpkg-reconfigure locales

Hosts, hosts.allow, hosts.deny

cd /etc
sudo cp hosts hosts.orig
sudo cp hosts.allow hosts.allow.orig
sudo cp hosts.deny hosts.deny.orig
cat hosts
127.0.0.1	localhost
127.0.1.1	SuHu-Dominion

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

140.120.7.1     fish.amath.nchu.edu.tw  fish
140.120.7.19    Amd-Srv                 as
140.120.7.20    am-mirror               amm
140.120.7.21    am-DebMirror            amdm
140.120.7.41    amd-op                  amd-op
140.120.8.101   Amath-Client01          ac01
140.120.8.102   Amath-Client02          ac02
140.120.8.103   Amath-Client03          ac03
140.120.8.104   Amath-Client04          ac04
140.120.8.105   Amath-Client05          ac05
140.120.8.106   Amath-Client06          ac06
140.120.8.107   Amath-Client07          ac07
140.120.8.108   Amath-Client08          ac08
140.120.8.109   Amath-Client09          ac09
140.120.8.110   Amath-Client10          ac10
140.120.8.111   Amath-Client11          ac11
140.120.8.112   Amath-Client12          ac12
140.120.8.113   Amath-Client13          ac13
140.120.8.114   Amath-Client14          ac14
140.120.8.115   Amath-Client15          ac15
140.120.8.116   Amath-Client16          ac16
140.120.8.117   Amath-Client17          ac17
140.120.8.118   Amath-Client18          ac18
140.120.8.119   Amath-Client19          ac19
140.120.8.120   Amath-Client20          ac20
140.120.8.121   Amath-Client21          ac21
140.120.8.201   av-01                   av01
140.120.8.202   av-02                   av02
140.120.8.203   av-03                   av03
140.120.8.204   av-04                   av04
140.120.8.205   av-05                   av05
140.120.8.206   av-06                   av06
140.120.8.207   av-07                   av07
140.120.8.208   av-08                   av08
140.120.8.209   av-09                   av09
140.120.8.210   av-10                   av10
140.120.8.211   av-11                   av11
140.120.8.212   av-12                   av12
140.120.8.213   av-13                   av13
140.120.15.160	SNMLab-Minerva		snmm
140.120.15.187	1010-Printer		print
140.120.15.189	SNMLab-Printer		snmpnt
140.120.16.69	CSE-Mirror		csm
140.120.16.70	CSE-Server		css
140.120.16.71	CSE-Cloud01		cs01
140.120.16.72	CSE-Cloud02		cs02
140.120.16.73	CSE-Cloud03		cs03
140.120.16.74	CSE-Cloud04		cs04
140.120.16.75	CSE-Cloud05		cs05
140.120.16.76	CSE-Cloud06		cs06
140.120.16.77	CSE-Cloud07		cs07
140.120.16.78	CSE-Cloud08		cs08
140.120.16.81   CSE-E01                 ce01
140.120.16.82   CSE-E02                 ce02
140.120.16.83   CSE-E03                 ce03
140.120.16.84   CSE-E04                 ce04
140.120.16.124	CSE-Web			csw
192.168.180.1	SuHu-OpenWrt		ggwrt
192.168.180.11	SuHu-Diva		gg1
192.168.180.12	SuHu-Dominion		gg2
192.168.180.13	SuHu-Archangel		gg3
192.168.180.31  CrossCompilePi          ccpi
192.168.180.33	GNS3			gns3
192.168.180.253	SuHu-Web		web
192.168.180.254	SuHu-Router		sur

## CSIE-Devices
# DNS port 7021
140.120.13.1	CSIE-DNS		csdns
140.120.13.25	SNM-WebServer		snmweb
140.120.13.57	CSE-3845		c3845
140.120.13.58	CSE-NME3750S		cnme
140.120.13.59	CSE-3560G		c3560g
140.120.13.60	CSE-3560G-2		c3560g2
140.120.13.61	CSE-2960		c2960
140.120.13.62	CSE-3750X		c3750

# TGOS
140.120.16.120	ODDash			dash

cat hosts.allow
# /etc/hosts.allow: list of hosts that are allowed to access the system.
#                   See the manual pages hosts_access(5) and hosts_options(5).
#
# Example:    ALL: LOCAL @some_netgroup
#             ALL: .foobar.edu EXCEPT terminalserver.foobar.edu
#
# If you're going to protect the portmapper use the name "rpcbind" for the
# daemon name. See rpcbind(8) and rpc.mountd(8) for further information.
#

ALL: localhost
ALL: 127.0.0.1
ALL: 127.0.1.1
ALL: 10.0.0.0/255.0.0.0
ALL: 172.16.0.0/255.240.0.0
ALL: 192.168.0.0/255.255.0.0
ALL: 140.120.7.19
ALL: 140.120.7.20
ALL: 140.120.7.21
ALL: 140.120.8.101
ALL: 140.120.8.102
ALL: 140.120.8.103
ALL: 140.120.8.104
ALL: 140.120.8.105
ALL: 140.120.8.106
ALL: 140.120.8.107
ALL: 140.120.8.108
ALL: 140.120.8.109
ALL: 140.120.8.110
ALL: 140.120.8.111
ALL: 140.120.8.112
ALL: 140.120.8.113
ALL: 140.120.8.114
ALL: 140.120.8.115
ALL: 140.120.8.116
ALL: 140.120.8.117
ALL: 140.120.8.118
ALL: 140.120.8.119
ALL: 140.120.8.120
ALL: 140.120.8.121
ALL: 140.120.13.1
ALL: 140.120.13.2
ALL: 140.120.13.41
ALL: 140.120.13.42
ALL: 140.120.13.43
ALL: 140.120.13.44
ALL: 140.120.13.45
ALL: 140.120.13.46
ALL: 140.120.13.47
ALL: 140.120.13.128/255.255.255.224
ALL: 140.120.13.240/255.255.255.240
ALL: 140.120.14.97
ALL: 140.120.14.107
ALL: 140.120.14.108
ALL: 140.120.14.109
ALL: 140.120.14.110
ALL: 140.120.14.111
ALL: 140.120.15.128/255.255.255.192
ALL: 140.120.16.20
ALL: 140.120.16.21
ALL: 140.120.16.22
ALL: 140.120.16.64/255.255.255.192
ALL: 140.120.19.1
ALL: 140.120.19.2
ALL: 140.120.19.3
ALL: 140.120.19.4
ALL: 140.120.19.5
ALL: .dynamic-ip.hinet.net
ALL: .dynamic.hinet.net
ALL: .emome-ip.hinet.net
ALL: .EMOME-IP.hinet.net
ALL: .hinet.net
ALL: .hinet-ip.hinet.net
ALL: 101.12.
ALL: 101.13.
ALL: 101.14.
ALL: 101.15.

cat hosts.deny
# /etc/hosts.deny: list of hosts that are _not_ allowed to access the system.
#                  See the manual pages hosts_access(5) and hosts_options(5).
#
# Example:    ALL: some.host.name, .some.domain
#             ALL EXCEPT in.fingerd: other.host.name, .other.domain
#
# If you're going to protect the portmapper use the name "rpcbind" for the
# daemon name. See rpcbind(8) and rpc.mountd(8) for further information.
#
# The PARANOID wildcard matches any host whose name does not match its
# address.
#
# You may wish to enable this to ensure any programs that don't
# validate looked up hostnames still leave understandable logs. In past
# versions of Debian this has been the default.
# ALL: PARANOID

ALL: ALL

Desktop environment

Enlightenment

Intallation steps
sudo aptitude install xserver-xorg xserver-xorg-video-all xorg
sudo aptitude install mesa-utils mesa-utils-extra
sudo aptitude install libssl1.0.0

Reverse Mouse Scrolling

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

Applications

Browser

sudo aptitude install firefox-esr firefox-esr-l10n-zh-tw
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo aptitude install gconf-service libgconf-2-4 libpango1.0-0 fonts-liberation libappindicator1 libcurl3 xdg-utils
sudo dpkg -i google-chrome-stable_current_amd64.deb

Emacs

sudo aptitude install emacs
sudo aptitude install emacs-goodies-el
cat .emacs
(custom-set-variablesmacs': No such file or directory
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(ansi-color-names-vector
   ["#242424" "#e5786d" "#95e454" "#cae682" "#8ac6f2" "#333366" "#ccaa8f" "#f6f3e8"])
 '(custom-enabled-themes (quote (deeper-blue)))
 '(inhibit-startup-screen t)
 '(package-archives
   (quote
    (("gnu" . "http://elpa.gnu.org/packages/")
     ("melpa" . "http://melpa.org/packages/")
     ("marmalade" . "https://marmalade-repo.org/packages/")))))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )
(add-to-list 'load-path "~/.emacs.d/lisp/")
;;(require 'web-mode)
;;(add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode))
;;(add-to-list 'auto-mode-alist '("\\.tpl\\.php\\'" . web-mode))
;;(add-to-list 'auto-mode-alist '("\\.[agj]sp\\'" . web-mode))
;;(add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode))
;;(add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode))
;;(add-to-list 'auto-mode-alist '("\\.mustache\\'" . web-mode))
;;(add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode))
(require 'package)
(package-initialize)
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
                         ("melpa" . "http://melpa.org/packages/")
                         ("marmalade" . "https://marmalade-repo.org/packages/")))
(setq-default indent-tabs-mode nil)
(add-hook 'java-mode-hook (lambda ()
			    (setq c-basic-offset 4
				  tab-width 4
				  indent-tabs-mode nil)))
(global-set-key (kbd "lt;f1>")   'shell)
(global-set-key (kbd "lt;f2>")   'align)
(global-set-key (kbd "lt;C-f2>") 'align-regexp)
(global-set-key (kbd "lt;f3>")   'speedbar)
(global-set-key (kbd "lt;C-f3>") 'sr-speedbar-open)
(global-set-key (kbd "lt;f4>")   'auto-complete-mode)
(global-set-key (kbd "lt;f5>")   'append-to-buffer)
(add-hook 'java-mode-hook
          (lambda()
            (local-set-key (kbd "C-c lt;right>") 'hs-show-block)
            (local-set-key (kbd "C-c lt;left>")  'hs-hide-block)
            (local-set-key (kbd "C-c lt;up>")    'hs-hide-all)
            (local-set-key (kbd "C-c lt;down>")  'hs-show-all)
            (yas-minor-mode t)
            (auto-complete-mode t)
            (tabbar-mode t)
            (hs-minor-mode t)))
(add-hook 'tabbar-mode-hook
          (lambda()
            (tabbar-install-faces t)))

export NO_AT_BRIDGE=1

中文輸入、亂碼解決

fcitx

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

中文字體

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

中文啟動軟體

cat forceZhTW.sh
#! /bin/bash
cd /usr/share/applications
for f in /usr/share/applications/*.desktop; do
     sudo sed -i 's/Exec=/Exec=env LANG=zh_TW.UTF-8 /g' $f
done
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

SSH config

ssh-keygen
cat .ssh/config
Host gg1
     User cssu
     ForwardX11 yes

Host gg2
     User cssu
     ForwardX11 yes

Host gg3
     User cssu
     ForwardX11 yes

Host css
     User cse
     ForwardX11 yes

Host csm
     User cse
     ForwardX11 yes

Host cs0*
     User cloud
     ForwardX11 yes

Host ac*
     User hsu
     ForwardX11 yes

Host as
     User hsu
     ForwardX11 yes

Host c2*
     User cse
     ForwardX11 no
     KexAlgorithms +diffie-hellman-group1-sha1

Host c3*
     User cse
     ForwardX11 no
     KexAlgorithms +diffie-hellman-group1-sha1

Host cnme
     User cse
     ForwardX11 no

Host dash
     User cse
     HostName 140.120.16.120
     ForwardX11 yes

Host web
     User cssu
     ForwardX11 no

Dropbox

wget https://www.dropbox.com/download?dl=packages/debian/dropbox_2015.10.28_amd64.deb -O dropbox_2015.10.28_amd64.deb
sudo dpkg -i dropbox_2015.10.28_amd64.deb
sudo aptitude install python-gtk2
sudo chown cssu:cssu /video
dropbox start -i
sudo chown root:root /video
cd
ln -s /video/Dropbox/Web

Audio

Pulseaudio

sudo aptitude install pulseaudio

Listen Line-in (loopback)

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

KVM

KVM Scripts

sudo mkdir /src3/KVM /mnt/tmp /video/ISOs
sudo chown cssu:cssu /src3/KVM /video/ISOs
cd /src3/KVM
git clone git@github.com:SuHu0426/KVM-Scripts.git .
git add xxxx
git commit -m 'comments'
git push

kmln

sudo mkdir /src4/kmln
sudo chown cssu:cssu /src4/kmln
cd /src4/kmln
git clone git@github.com:SuHu0426/KMLN.git .
git add xxxx
git commit -m 'comments'
git push

qemu-kvm

sudo aptitude install qemu-kvm screen socat uml-utilities
sudo adduser cssu kvm