This commit is contained in:
陆柯 2019-09-24 19:48:08 +08:00
parent d2e1061276
commit 3d5c09c5cf
5 changed files with 55 additions and 4 deletions

35
setup-debian.sh Normal file
View File

@ -0,0 +1,35 @@
echo "Usage: setup.sh [USER]"
echo "Example: setup.sh alice"
if [ v$1 != v ]
then
export User=$1
else
export User=adot
fi
apt update
apt install -y emacs git curl screen sudo automake
echo ">>> Change root password"
passwd
echo ">>> add a new user"
useradd $User
usermod -a -G sudo $User
passwd $User
emacs /etc/passwd
mkdir /home/$User
chown $User:$User /home/$User
echo ">>> allow sudo without password: %sudo ALL=(ALL:ALL) NOPASSWD:ALL"
chmod o+w /etc/sudoers
emacs /etc/sudoers
chmod o-w /etc/sudoers
echo ">>> disallow root login: #PermitRootLogin yes"
emacs /etc/ssh/sshd_config
service sshd restart
echo ">>> configure locales: install all-locales, default to zh-CN.UTF-8"
dpkg-reconfigure locales

View File

@ -1,10 +1,8 @@
#!/bin/bash #!/bin/bash
echo "Usage: setup.sh [VERSION]" echo "Usage: setup.sh"
echo "Example: setup.sh" echo "Example: setup.sh"
sudo apt update
echo "######## 安装 ##################" echo "######## 安装 ##################"
ln -s ~/home.config/.emacs ~/ ln -s ~/home.config/.emacs ~/
ln -s ~/home.config/.emacs.lisp ~/ ln -s ~/home.config/.emacs.lisp ~/

16
setup-mongodb.sh Normal file
View File

@ -0,0 +1,16 @@
#!/bin/bash
echo "Usage: setup.sh [VERSION]"
echo "Example: setup.sh 4.2"
if [ v$1 != v ]
then
export Version=$1
else
export Version=4.2
fi
curl https://www.mongodb.org/static/pgp/server-$Version.asc | sudo apt-key add -
echo "deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/$Version main" | sudo tee /etc/apt/sources.list.d/mongodb-org-$Version.list
sudo apt update
sudo apt install mongodb-org

View File

@ -2,7 +2,6 @@
echo "Usage: setup.sh [VERSION]" echo "Usage: setup.sh [VERSION]"
echo "Example: setup.sh 10" echo "Example: setup.sh 10"
echo "Run as root user please."
if [ v$1 != v ] if [ v$1 != v ]
then then

3
setup-ssr.sh Normal file
View File

@ -0,0 +1,3 @@
wget http://www.gigsgigscloud.com/cn/downloads/ssr.sh
sudo bash ssr.sh
sudo ssr