-
Notifications
You must be signed in to change notification settings - Fork 0
Linux Setup
The dollar sign is your linux terminal prompt. When following this guide run any command by typing only what is given after the dollar sign followed by the enter key. For example when given:
$ echo this
Enter echo this into your terminal followed by the enter key.
In this case echo just prints its arguments but it can do more.
You can read more about each command we use by running man command. Which will give you the manual page for that command. In this case you would get it by running:
$ man echo
To exit the man pages simply type q
First we update the list of available packages and their versions:
$ sudo apt-get update
(We use sudo when installing things as sudo runs the rest of the command as the root user who has all the admin rights.)
Then we upgrade all installed packages to the new versions in the list:
$ sudo apt-get upgrade
Now install the latest versions of a list of programs which other tools we use often depend on:
$ sudo apt-get install g++ gcc make libc6-dev patch openssl ca-certificates libreadline6 libreadline6-dev curl zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev autoconf libc6-dev libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev libcurl3 php5-curl
(Here sudo apt-get install is the command and the rest is a list of programs to install.)
These could have been included in the list at point 1.3 but they are important later in this guide so they get to have their own points.
git is the most widely used version control system in the world.
$ sudo apt-get install git
zsh is a replacement for bash (the shell/program that runs your terminal) it adds the ability to use Oh-My-Zsh community plugins and themes to optimise your terminal workflow as well as more nice things which you can google.
$ sudo apt-get install zsh
Now that zsh is installed we need to change our default shell from bash to zsh.
First we change the shell by running the change shell (chsh) command and giving it the save flag (-s) to make the change permanent:
$ sudo chsh -s $(which zsh)
$ chsh -s $(which zsh)
$ sudo shutdown -r 0
Then we check that the change worked by printing the current shell variable, echo prints its arguments and $ is used to access shell variables.
$ echo $SHELL
If it does not return something like /usr/bin/local/zsh or anything containing "zsh" then you should ask for help in getting that to work. If the change was successful restart your terminal before the next step.
To install Oh-My-Zsh run the following command:
$ curl -L http://install.ohmyz.sh | sh
This setup will use with a theme and plugins we like. You can customise Oh-My-Zsh to your own personal needs.
First we will install a powerline enabled font for use in terminal so we can take advantage of powerline icons in our themes:
Start by downloading the font using the following command.
$ git clone https://github.com/pdf/ubuntu-mono-powerline-ttf.git ~/.fonts/ubuntu-mono-powerline-ttf
$ fc-cache -vf
Then navigate to your preferences in terminal and manually set the font to Ubuntu Mono Powerline.
Now we will change the color scheme for terminal to IdleToes by running the following commands:
$ gconftool-2 --set /apps/gnome-terminal/profiles/Default/foreground_color --type string "#FFFFFF"
$ gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_color --type string "#323232"
$ gconftool-2 --set /apps/gnome-terminal/profiles/Default/bold_color --type string "#FFFFA9"
$ gconftool-2 --set /apps/gnome-terminal/profiles/Default/palette --type string "#323232:#D25252:#7FE173:#FFC66D:#4098FF:#F57FFF:#BED6FF:#EEEEEC:#535353:#F07070:#9DFF90:#FFE48B:#5EB7F7:#FF9DFF:#DCF4FF:#FFFFFF"
Afterwords a restart of terminal may be required. For more color schemes click here.
Finally open up ~/.zshrc (a hidden config file zsh created in your home directory). Change the theme to agnoster and add any plugins you wish to use. For a list of plugins and available themes and more on Oh-My-Zsh consult their GitHub or Website.
Setup the basics for a Ruby development environment for work using gems, Rails and other Ruby based tools.
rbenv is a brilliant tool for managing different versions of ruby on different projects and different gemsets (set of ruby plugins) over different projects.
First we download it by cloning the repo:
$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
Then we add it to our zsh path so that we can use it in terminal.
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
$ echo 'eval "$(rbenv init -)"' >> ~/.zshrc
Finally we check that the whole process worked:
$ type rbenv
Now we can manage different ruby versions and gems very easily though we still need an easier way to install them in the first place. Enter ruby-build and gem-rehash.
Once again we clone the repos:
$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
$ git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
For a list of available ruby versions run:
$ rbenv install -l
Pick the appropriate one and install it with:
$ rbenv install 2.1.2
To set the newly installed version as your global ruby version run:
$ rbenv global 2.1.2
Installing gems globally should now be equally easy. For example to install Rails (one of the our favourite web frameworks) simply run:
$ gem install rails
Setup the basics for a Node.js development environment for work using npm packages, Meteor, Express.js, Harp.js and other Node based tools.
$ curl https://raw.githubusercontent.com/creationix/nvm/v0.15.0/install.sh | bash
$ git clone https://github.com/creationix/nvm.git ~/.nvm
$ source ~/.nvm/nvm.sh
$ sudo apt-get install npm
$ npm -v
$ sudo npm install -g harp
$ harp -v
$ sudo npm install -g bower
$ bower -v
This guide was written by Marula.io using StackEdit.