-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathproject_aws.sh
123 lines (96 loc) · 2.15 KB
/
project_aws.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
# Format and mount drive
## find the device name
```
lsblk
device='/dev/xvdb'
sudo file $device
sudo mkfs -t ext4 $device
```
## make a directory to mount the drive
```
sudo mkdir /data
sudo mount $device /data
sudo cp /etc/fstab /etc/fstabBAK
```
## find the UUID for $device
```
sudo file -s $device
```
## add the following line to the fstab file
```
sudo vi /etc/fstab
UUID=b0992451-8b09-4df9-94ee-2729aa100bcc /data ext4 defaults,nofail 0 2
```
## test fstab entry
```
sudo umount /data
sudo mount /data
```
# Add users and group
## add group
```
sudo groupadd project
```
## create group directory
```
sudo mkdir /data/project
sudo chgrp -R project /data/project
sudo chmod g+wrx /data/project/
```
## add student pub key
```
echo 'PASTE PUB KEY HERE' > PFB2017_Projects.pub
```
## add user names to file called users.txt
```
for i in `cat users.txt`
do
echo $i
sudo useradd -m $i -d /data/$i -g project -s /bin/bash
sudo mkdir /data/$i/.ssh
sudo cp ~/PFB2017_Projects.pub /data/$i/.ssh/authorized_keys
sudo chown -R $i:project /data/$i/.ssh
sudo chmod 0700 /data/$i/.ssh
sudo chmod 0400 /data/$i/.ssh/authorized_keys
echo 'done'
done
```
# Install
## update
`sudo apt-get update`
## Install anaconda from anaconda.org
```
curl -OL https://repo.continuum.io/archive/Anaconda3-5.0.1-Linux-x86_64.sh
sudo sh Anaconda3-5.0.1-Linux-x86_64.sh
```
### Directory to install anaconda
`/usr/local/anaconda`
### edit /etc/bash.bashrc
```
PATH=/usr/local/anaconda/bin:$PATH
export PATH
LIBRARY_PATH=/usr/local/anaconda/lib:$LIBRARY_PATH
export LIBRARY_PATH
LD_LIBRARY_PATH=/usr/local/anaconda/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
```
### Allow users to use conda install
```
sudo chgrp -R project /usr/local/anaconda
sudo chmod -R g+w /usr/local/anaconda
```
## install emacs
`sudo apt-get install emacs`
## install make
`sudo apt-get make`
`sudo apt-get make-doc`
## install gcc and fortran
`sudo apt-get install gcc`
`sudo apt-get install gfortran`
## install apache
`sudo apt-get install apache2`
`sudo systemctl restart apache2`
## install java 8
`sudo apt-get install default-jdk`
## install R/Rscript
`sudo apt-get install r-base`