-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·125 lines (102 loc) · 3.53 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/bin/bash
#
# ./install.sh work|personal
#
if [ x"$1" == x ]; then
isPersonal=1
else
isPersonal=0
fi
if [ x"$1" == xpersonal ]; then
isPersonal=1
fi
if [ x"$1" == xwork ]; then
isPersonal=0
fi
echo -e "Update & upgrade apt repository"
sudo apt-cache update
sudo apt-get upgrade
cp ./home/vimrc $HOME/.vimrc
cp ./home/dircolors $HOME/.dircolors
cp ./home/bash_aliases $HOME/.bash_aliases
echo -e "Environment setup: .vimrc .dircolors .bash_aliases"
mkdir -p $HOME/common/bin
echo -e "Environment setup: .gitconfig for work"
cp ./home/gitconfig $HOME/.gitconfig
mkdir -p $HOME/repos/elvinongbl-github
cp ./home/repos/elvinongbl-github/gitconfig $HOME/repos/elvinongbl-github/.gitconfig
echo -e "Please add new gmail and patchwork token"
if [ $isPersonal == 0 ]; then
echo -e "Further tool chain for proxied work environment"
# socat for work proxy
cp ./home/common/bin/socatproxy $HOME/common/bin/socatproxy
chmod +x $HOME/common/bin/socatproxy
echo -e "Tool added: socat for git"
sudo apt-get install -y socat
else
echo -e "Environment setup: ~/.gitconfig for personal"
# if environment for personal, overwrite the ~/.gitconfig
cp $HOME/repos/elvinongbl-github/.gitconfig $HOME/.gitconfig
rm $HOME/repos/elvinongbl-github/.gitconfig
fi
# Install ssh daemon for external access
sudo apt-get install -y openssh-server
# Install software packages for editing
sudo apt-get install -y vim.nox
# Install software packages for kernel development
# Reference: https://kernelnewbies.org/OutreachyfirstpatchSetup
sudo apt-get install -y \
vim libncurses5-dev gcc make git \
exuberant-ctags libssl-dev bison flex libelf-dev bc
# Install software packages for system monitoring
sudo apt-get install -y \
i7z
# Install software packages for using Kernelshark
# source: https://kernelshark.org/build.html
# sudo apt-get install build-essential git cmake libjson-c-dev -y
# sudo apt-get install freeglut3-dev libxmu-dev libxi-dev -y
# sudo apt-get install qtbase5-dev -y
# CWD=$(pwd)
# cd $HOME/repos/
# git clone https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/
# cd trace-cmd
# make && make gui
# make install && make install_gui
# cd $CWD
sudo apt-get install -y kernelshark
# Install vncserver & setup xfce for lightweight vnc session
sudo apt-get install -y tightvncserver
sudo apt-get install -y xfce4 xfce4-goodies
# Trigger vncserver to let your enter password, then kill it
# Back-up existing vnc startup script as we are over-writting
mv $HOME/.vnc/xstartup $HOME/.vnc/xstartup.bak
# Then, create the vnc startup that start xfce and make it executable
echo -e "#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 &" > $HOME/.vnc/xstartup
sudo chmod +x $HOME/.vnc/xstartup
# Create vncserver systemd unit
sudo echo -e "[Unit]
Description=Start TightVNC server at startup
After=syslog.target network.target
[Service]
Type=forking
User=bong5
Group=bong5
WorkingDirectory=/home/bong5
PIDFile=/home/bong5/.vnc/%H:%i.pid
ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1
ExecStart=/usr/bin/vncserver -depth 24 -geometry 1670x1000 :%i
ExecStop=/usr/bin/vncserver -kill :%i
[Install]
WantedBy=multi-user.target" > /etc/systemd/system/[email protected]
# Reload vncsever systemd unit
sudo systemctl daemon-reload
sudo systemctl enable [email protected]
sudo systemctl start vncserver@1
## Start vncserver manually to enter password
# $ vncserver
# $ vncserver -kill :1
## Finally, only the client machine create a ssh pipe to vncserver
# ssh -L 5901:127.0.0.1:5901 -C -N -l bong5 elvinlatte.local
# For MAC, open safari, use vnc://localhost:5901