Created
May 3, 2017 09:38
-
-
Save johnroyer/a573a28d6745b5d95516226752734ca2 to your computer and use it in GitHub Desktop.
vultr startup script for Ubuntu16.04 php developer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# time zone | |
timedatectl set-timezone Asia/Taipei | |
# user configure | |
mkdir -p /root/.ssh | |
chmod 600 /root/.ssh | |
chmod 700 /root/.ssh/authorized_keys | |
sed -i 's/^Port .*/Port 2222/g' /etc/ssh/sshd_config | |
sed -i 's/^PermitRootLogin yes/PermitRootLogin no/g' /etc/ssh/sshd_config | |
adduser johnroyer | |
yes "your-password" | passwd johnroyer | |
echo "johnroyer ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers | |
mkdir -p /home/johnroyer/.ssh/ | |
cp /root/.ssh/authorized_keys /home/johnroyer/.ssh/authorized_keys | |
chmod 700 /home/johnroyer/.ssh/ | |
chmod 600 /home/johnroyer/.ssh/authorized_keys | |
chown -R johnroyer:johnroyer /home/johnroyer/.ssh | |
service ssh restart | |
# ENV | |
echo 'LC_ALL="en_US.UTF-8"' >> /etc/environment | |
apt-get install -y aptitude | |
aptitude update; aptitude upgrade -y | |
aptitude install -y python-software-properties software-properties-common apt-transport-https ca-certificates | |
aptitude install -y htop screen dstat speedometer mytop pv glances iftop sysstat lsof traceroute | |
\ util-linux dstat traceroute mtr mitmproxy tcpdump nmap netcat partimage dnsutils dnstop rar unrar xz-utils | |
aptitude install -y lvm mdadm fdisk parted nfs-common ntfs-3g | |
aptitude install -y squid3 ufw | |
aptitude install -y gzip ungzip pigz zip unzip bzip2 lbzip2 p7zip-full rsync wget curl imagemagick file findutils | |
aptitude install -y aws-cli s3cmd fuse | |
aptitude install -y libssl-dev | |
add-apt-repository ppa:user/ppa-name -y ppa:git-core/ppa | |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -y - | |
add-apt-repository -y ppa:ondrej/nginx | |
add-apt-repository -y ppa:ondrej/php | |
add-apt-repository -y ppa:chris-lea/redis-server | |
add-apt-repository -y ppa:longsleep/golang-backports | |
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -y - | |
add-apt-repository -y -r ppa:chris-lea/node.js | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key -y add - | |
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -y - | |
apt-key adv --keyserver keys.gnupg.net --recv-keys 8507EFA5 | |
cat >> /etc/apt/sources.list <<EOD | |
# git | |
deb http://ppa.launchpad.net/git-core/ppa/ubuntu xenial main | |
deb-src http://ppa.launchpad.net/git-core/ppa/ubuntu xenial main | |
# percona server | |
deb http://repo.percona.com/apt xenial main | |
deb-src http://repo.percona.com/apt xenial main | |
# postgresql | |
deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main | |
# nginx | |
deb http://ppa.launchpad.net/ondrej/nginx/ubuntu xenial main | |
deb-src http://ppa.launchpad.net/ondrej/nginx/ubuntu xenial main | |
# PHP latest | |
deb http://ppa.launchpad.net/ondrej/php/ubuntu xenial main | |
deb-src http://ppa.launchpad.net/ondrej/php/ubuntu xenial main | |
#nodejs | |
deb https://deb.nodesource.com/node_6.x xenial main | |
deb-src https://deb.nodesource.com/node_6.x xenial main | |
# redis server | |
deb http://ppa.launchpad.net/chris-lea/redis-server/ubuntu xenial main | |
deb-src http://ppa.launchpad.net/chris-lea/redis-server/ubuntu xenial main | |
# docker | |
deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial main | |
# yarn | |
deb https://dl.yarnpkg.com/debian/ stable main | |
EOD | |
# install dev tools | |
aptitude isntall -y screen git git-svn subversion mercurial vim fish golang-go cmake tig | |
\ mosh dvtm tmux zsh exuberant-ctags gdb iconv binutils bc | |
\ jq libxml2-utils diffutils ncurses-base ncurses-bin parallel patch | |
\ ftp fuse gnupg httpie multitail | |
\ w3m whois | |
# install nodejs | |
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - | |
# install docker | |
aptitude install -y docker-ce | |
# custom utils | |
mkdir -p /home/johnroyer/usr/bin | |
chown -R johnroyer:johnroyer /home/johnroyer/usr | |
# install phpbrew | |
curl -L -O https://github.com/phpbrew/phpbrew/raw/master/phpbrew | |
chown johnroyer:johnrpyer phpbrew | |
chmod +x phpbrew | |
mv chmod phpbrew /home/johnroyer/usr/bin | |
# install php 5.6 without php-fpm | |
aptitude install -y php5.6-cli php-common php-pear | |
\ php5.6-curl php5.6-readline php5.6-xml php5.6-xmlrpc php5.6-tidy php5.6-xsl | |
\ php5.6-gd php5.6-intl php5.6-json php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-pgsql php5.6-sqlite3 | |
\ php5.6-opcache php5.6-zip php-geoip | |
# bash env | |
curl -s -o /home/johnroyer/.bashrc http://assets.blog.zeroplex.tw/config/bashrc | |
chown johnroyer:johnroyer /home/johnroyer/.bashrc | |
# screen config | |
curl -s -o /home/johnroyer/.screenrc http://assets.blog.zeroplex.tw/config/screenrc | |
chown johnroyer:johnroyer /home/johnroyer/.screenrc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment