1 #+TITLE: Note of Linux (Debian)
3 #+EMAIL: seudut@gmail.com
6 * Install and Environment
7 ** Install ios in virtual box
8 ** install essential softwares
9 *** Change the sourece.list
12 deb http://mirrors.163.com/debian stable main non-free contrib
13 deb-src http://mirrors.163.com/debian stable main non-free contrib
15 *** Install essential packages
17 Find the fastest apt mirror server
20 Add user to sudo group or change the =/etc/sudoers= to use =sudo= command
21 #+BEGIN_SRC sh :results output replace
22 sudo adduser <username> sudo
24 - git, openssh-server, emacs, build-essential, tmux, zsh, silversearcher-ag
26 *** Build Emacs from source
27 1. gnutls error, to fix, install =gnutls-dev= and =pkg-config=
29 configure emacs =-without-x=
33 Does Emacs use -lgnutls? no
37 htop, lftp, apache2, vsftpd, silversearcher-ag,
39 1. See the router table on mac
40 #+BEGIN_SRC sh :results output replace
44 2. wget download https
45 https://www.cyberciti.biz/faq/wget-example-download-from-https-web-sites/
46 wget --no-check-certificate https://cyberciti.biz/foo/bar.tar.gz
48 3. =ls= in =zsh= has no color
51 Install virtualbox guest addition
52 https://blog.paranoidpenguin.net/2016/12/installing-the-virtualbox-guest-additions-on-debian-8-jessie/
54 - Need install extensions, add a hostonly network, address start as 192.168.56.1, then You host (mac) will be added one more interface, named
55 vboxnet0, 192.168.56.1
56 - ADd both hostonly and nat interface in the network setting
57 - start linux, and modify =/etc/network/interfaces/=
58 add configure for eth1 (hostonly ) interface, such as
59 #+BEGIN_SRC sh :results output replace
61 iface eth1 inet static
65 ** Port forward, web server
69 - Install Guest Addition,
70 https://forums.virtualbox.org/viewtopic.php?t=15679
72 Insert GuestAddition.ios,
74 mount /dev/sr0 /media/cdrom
77 - Create folder to share in host machine
78 - add user to virtualbox group
82 To enable cgi mdoule, create symbolic link to mods-available/cgid.conf /etc/apache2/mods-enabled/
83 https://perlmaven.com/perl-cgi-script-with-apache2
85 Add sample perl script to test, put under =/usr/lib/cgi-bin/= and chmod a+x, troubleshooting see the log =/var/log/apache2/error.log=
91 use CGI qw/:standard/;
94 start_html ("hello world"),
99 ** cgi directory config
101 ScriptAlias /cgi-bin/ /var/cgi-bin/
102 <Directory "/var/cgi-bin">
104 Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
109 ** start sshd on boot and vnc server
110 http://www.raspberrypi-spy.co.uk/2012/05/enable-secure-shell-ssh-on-your-raspberry-pi/
112 ** Auto mount usb / external disk
113 change fstab file, add one entry with the uuid of the disk
115 ** Auto mount smb folder
118 sudo mount -t cifs -o username=pi,password=xxx //192.168.31.1/Folder /mnt/folder
121 http://askubuntu.com/questions/157128/proper-fstab-entry-to-mount-a-samba-share-on-boot
124 aptitude install =apache2=, start it by runing