Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Notes on installing and upgrading with modern web development tools
# Paths
touch ~/.bash_profile
echo -e "#Paths\nexport PATH=/usr/local/bin:\$PATH\n"|cat - ~/.bash_profile > /tmp/out && mv /tmp/out ~/.bash_profile
source ~/.bash_profile
# Permissions
sudo chown -R $USER ~/.npm
sudo chown -R $USER /usr/local
# Command line tools from [Xcode](https://itunes.apple.com/us/app/xcode/id497799835?mt=12)
xcode-select --install
gcc -v
# [Homebrew](http://brew.sh/)
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
brew upgrade --all
brew cleanup
brew prune
brew doctor
# Git
brew install git
brew upgrade git
brew info git
git --version
git config --global user.name "Your Name"
git config --global user.email "user@example.com"
# MySQL
brew install mysql
brew upgrade mysql
brew info mysql
mysql -V
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
mysql -u root -p # No password, press return
CREATE DATABASE IF NOT EXISTS [dbname];
GRANT USAGE ON [dbname].* TO '[dbuser]'@'localhost' IDENTIFIED BY '[dbpass]';"
GRANT ALL PRIVILEGES ON [dbname].* TO '[dbuser]'@'localhost';
FLUSH PRIVILEGES;
QUIT;
bash -c "$(curl -fsSL https://gist.githubusercontent.com/richardcornish/e9093757a6977b1b6b5b/raw)" # or bash script
mysql -u [myuser] -p [mydatabase] < [/path/to/database].sql # load database
mysqldump -u [myuser] -p [mydatabase] > [/path/to/database].sql # dump database
# PostgreSQL
brew install postgresql
brew upgrade postgresql
brew info postgres
postgres -V
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
# launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
initdb /usr/local/var/postgres
createdb mydatabase
psql mydatabase
CREATE USER [myuser] WITH PASSWORD '[mypassword]';
GRANT ALL PRIVILEGES ON DATABASE [mydatabase] TO [myuser];
\q;
psql [mydatabase] < [/path/to/mydatabase].sql # load database
pg_dump [mydatabase] > [/path/to/mydatabase].sql # dump database
# Python
brew install python
brew upgrade python
brew info python
python -V
pip install virtualenv virtualenvwrapper
pip install virtualenv virtualenvwrapper --upgrade
pip list
echo -e "\n# Virtualenv\nexport WORKON_HOME=\$HOME/.virtualenvs" >> ~/.bash_profile
echo -e "\n# Virtualenvwrapper\nsource /usr/local/bin/virtualenvwrapper.sh\n" >> ~/.bash_profile
source ~/.bash_profile
# Heroku
Install [Heroku Toolbelt](https://toolbelt.heroku.com/)
# Django
mkdir ~/Sites && cd ~/Sites
mkvirtualenv [myproject]
pip install django pillow
django-admin.py startproject [myproject]
add2virtualenv [myproject]
setvirtualenvproject ~/.virtualenvs/[myproject]/ ~/Sites/[myproject]/
echo "export DJANGO_SETTINGS_MODULE=[myproject].settings" >> ~/.virtualenvs/[myproject]/bin/postactivate
echo "unset DJANGO_SETTINGS_MODULE" >> ~/.virtualenvs/[myproject]/bin/postdeactivate
deactivate
workon [myproject]
django-admin.py syncdb
django-admin.py startapp [myapp]
django-admin.py runserver
[http://127.0.0.1:8000]
cdproject / cdvirtualenv / cdsitepackages / lssitepackages
deactivate
# Ruby version manager
\curl -sSL https://get.rvm.io | bash -s stable
source /Users/[myusername]/.rvm/scripts/rvm
rvm reload
rvm -v
rvm --default use ruby-2.1.1
rvm list
ruby -v
# RubyGems update/list package bundles
rvm gemset list
rvm gemset use global
rvm rubygems latest
# RubyGems update/list packages
gem update --system
gem -v
gem list
gem outdated
gem update
# Create gemset and enable
rvm gemset create my-first-app
rvm use ruby-2.1.1@my-first-app
# Rails
gem install rails
rails -v
rails new my-first-app
rails s
cd my-first-app
echo "2.1.2" > .ruby-version
echo "my-first-app" > .ruby-gemset
# Jekyll
gem install jekyll
jekyll new my-first-app
jekyll serve --watch
# Node
brew install node
brew upgrade node
node -v
# Node Package Manager
curl https://www.npmjs.com/install.sh | sh
npm install -g npm@latest # otherwise, npm install -g npm
npm -v
npm update -g # all global packages
# Bower, Grunt, Yeoman
npm install -g bower
npm install -g grunt-cli
npm install -g yo
npm install -g generator-webapp
bower -v
grunt -V
yo -v
yo webapp
bower search
bower install
grunt serve
grunt test
grunt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment