Skip to content

Instantly share code, notes, and snippets.

@bgadrian bgadrian/setup.dev.sh

Last active May 10, 2020
Embed
What would you like to do?
Linux web dev setup (made for ubuntu 17+)
#chrome
cd /tmp
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt-get -f install
#docker
sudo apt-get update
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get -y install docker-ce docker-compose
#run docker without sudo
sudo groupadd docker
sudo usermod -aG docker $USER
echo 'You must restart your system before using docker without sudo'
#docker images mysql (data is not persistent)
docker run --name=mysql5 -e MYSQL_USER=adrian -e MYSQL_PASSWORD=a -d mysql/mysql-server:5.7 && \
docker run --name phpmyadmin5 -d --link mysql5:db -p 8080:80 phpmyadmin/phpmyadmin && \
docker stop mysql5 phpmyadmin5
#docker images mongo (data is not persistent)
docker run --name mongo -d mongo:3.7 && \
docker run --name mongoadmin --link mongo:mongo -p 8081:8081 -d mongo-express && \
docker stop mongo mongoadmin
#docker images postgreSQL
docker run --name postgres -e POSTGRES_PASSWORD=root -d postgres && \
docker run --name postgresadmin -p 8082:5050 --link postgres:postgres -d fenglc/pgadmin4 && \
docker stop postgres postgresadmin
#credentials: pgadmin4@pgadmin.org admin
#utils
sudo apt-get install -y nnn vim git shutter network-manager-openvpn-gnome \
htop gimp default-jre default-jdk python2.7 python-pip python3-pip php alacarte fonts-firacode
#golang
tar -C /usr/local -xzf go1.11.2.linux-amd64.tar.gz
sudo echo "export PATH=$PATH:/usr/local/go/bin" >> /etc/profile
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOPATH/bin v1.12.2
#skype
curl https://repo.skype.com/data/SKYPE-GPG-KEY | sudo apt-key add -
echo "deb https://repo.skype.com/deb stable main" | sudo tee /etc/apt/sources.list.d/skypeforlinux.list
sudo apt update
sudo apt install skypeforlinux
#nodeJS (javascript) (manual install)
#curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
#sudo apt-get install -y nodejs
#npm for nodejs (recommended)
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
source ~/.bashrc #reload the bashrc so nvm command will work
nvm install node
#vscode
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt-get update
sudo apt-get install -y code # or code-insiders
#AWS cloud
sudo apt-get install -y awscli
#pip install awscli --upgrade --user #for latest version
npm install -g serverless aws-sam-local
cd ~ && mkdir dynamodb && cd dynamodb && wget https://s3.eu-central-1.amazonaws.com/dynamodb-local-frankfurt/dynamodb_local_latest.tar.gz && \
tar -zxvf dynamodb_local_latest.tar.gz && rm dynamodb_local_latest.tar.gz && \
echo 'java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb' > local.dynamodb.sh && \
chmod +x *.sh
#Google Cloud
export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" && \
echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - && \
sudo apt-get update && sudo apt-get install google-cloud-sdk
#bash stuff
sudo apt-get install -y terminator guake
git clone --depth=1 https://github.com/Bash-it/bash-it.git ~/.bash_it
~/.bash_it/install.sh
#echo 'export BASH_IT_THEME="powerline"' >> ~/.bash_profile
#dotnetcore
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-artful-prod artful main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-get update
sudo apt-get install -y dotnet-sdk-2.1.4
#show hidden startup apps
sudo sed -i "s/NoDisplay=true/NoDisplay=false/g" /etc/xdg/autostart/*.desktop
echo 'Run startup application to remove unnecessary startups apps and services'
#postman (web client side emulator, API tester, automate testing)
echo 'DOWNLOAD postman manually https://app.getpostman.com/app/download/linux64'
npm install -g newman
echo 'Install chrome extension for postman https://chrome.google.com/webstore/detail/postman-interceptor/aicmkgpgakddgnaphhhpliifpcfhicfo/'
echo 'Add postman manually in the launcher using MainMenu (alacarte)`
#web security scanner, requires JAVA8
wget -nv https://download.opensuse.org/repositories/home:cabelo/xUbuntu_17.04/Release.key -O Release.key
sudo apt-key add - < Release.key
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/cabelo/xUbuntu_17.04/ /' > /etc/apt/sources.list.d/home:cabelo.list"
sudo apt-get update
sudo apt-get install -y owasp-zap
echo 'Add ZAP manually in the launcher using Main Menu (alacarte) /usr/share/owasp-zap/zap.sh'
#yarn (facebooks npm for nodeJS-javascript)
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update
sudo apt-get install --no-install-recommends yarn
#nodejs common global packages and other package managers
npm install -g jspm
npm install -g gulp
npm install -g grunt-cli
npm install -g bower
npm install -g phantomjs
#### PERSONAL STUFF
#phpstorm - personal old license
cd /tmp && \
wget https://download.jetbrains.com/webide/PhpStorm-2016.3.3.tar.gz && \
tar -zxvf PhpStorm-2016.3.3.tar.gz && rm PhpStorm-2016.3.3.tar.gz && \
mv PhpStorm* ~/ #PhpStorm-163.13906.21
#git global config
git config --global user.name "YOUR NAME"
git config --global user.email "EMAIL"
bash-it enable completion ssh go git docker awscli npm
bash-it enable plugin ssh node git extract aws
bash-it enable alias curl docker git
#added to crontab to upgrade and cleanup the system on a weekly basis
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y dist-upgrade
npm update -g.
pip install awscli --upgrade --user
#docker ps --filter status=exited -q | xargs docker rm --volumes
docker images --filter dangling=true -q | xargs docker rmi
npm cache clean --force
sudo apt-get -y autoclean
sudo apt-get -y clean
sudo apt-get -y autoremove --purge
go clean -cache -modcache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.