Ubuntu 14.04 Setup for Rails and Ember with i3

Recently I switched to Ubuntu 14.04 for my work machine. I develop both Rails and Ember applications. Here was my latest setup process, which provides i3 and a few extras.

Note that I have an Nvidia GTX760 card and a Samsung 512Gb SSD.

1. Ubuntu base

1. Download the 14.04 Live cd, burn it to disk, and install. Manually partition if you prefer.

2. Canonical Partners: Open Software & Updates to the Other Software tab, check Canonical Partners and Canonical Partners (Source Code). Allow it to update.

3. Upgrade the system Open the terminal, enter

sudo apt-get upgrade  

4. Add synaptic for precise package management:

sudo apt-get install synaptic  

5. Remove the guest account:

echo alow-guest=false | sudo tee -a /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf  

2. Development

1. Rails ready: For a quick rails dev setup (including most build tools you will need) I use railsready by Josh Frye:

wget --no-check-certificate \  
https://raw.githubusercontent.com/joshfng/railsready/master/railsready.sh && \  
bash railsready.sh  

2. NPM: Now install npm via PPA. To prevent sudo woes, have npm store modules in our home directory:

curl -sL https://deb.nodesource.com/setup | sudo bash -  
sudo apt-get install nodejs  
mkdir -p ~/.local/share/npm  
npm config set prefix ~/.local/share/npm  

3. Google Chrome: Download and install:

sudo dpkg -i google-chrome-stable_current_amd64.deb  
# If it fails because a dependency is missing, follow up with:
sudo apt-get -f install  

4. Sublime Text 3: Download and install:

sudo dpkg -i sublime-text_build-3065_amd64.deb  

5. Vim, gvim, and janus:

sudo apt-get remove vim-tiny  
sudo apt-get install vim vim-gnome  
curl -Lo- https://bit.ly/janus-bootstrap | bash  

6. Grunt:

npm install -g grunt-cli  

7. Bower:

npm install -g bower  

8. ember-cli:

npm install -g ember-cli  

9. Gimp for image editing:

sudo apt-get install gimp gimp-data gimp-plugin-registry gimp-data-extras  

10. Tmux and Tmuxinator:

sudo apt-get install tmux  
gem install tmuxinator  

11. Prax: A POW alternative:

git clone git://github.com/ysbaddaden/prax.git /opt/prax  
cd /opt/prax/ && ./bin/prax install  

3. Entertainment, Etc.

1. Dropbox: Download and install, and then adjust the file watch limit for Dropbox:

echo fs.inotify.max_user_watches=100000 | sudo tee -a /etc/sysctl.conf; sudo sysctl -p  

2. Add DVD codecs:

sudo apt-get install ubuntu-restricted-extras libavcodec-extra libdvdread4  
sudo /usr/share/doc/libdvdread4/install-css.sh  

3. Adobe flash:

sudo apt-get install adobe-flashplugin  

4. Java:

sudo add-apt-repository -y ppa:webupd8team/java  
sudo apt-get update  
sudo apt-get install icedtea-7-plugin openjdk-7-jre oracle-java8-installer  

4. Transmission bittorrent client:

sudo apt-get install transmission  

5. Steam game client:

sudo apt-get install steam  

6. File extraction utilities:

sudo apt-get install unace unrar zip unzip p7zip-full p7zip-rar \  
sharutils rar uudeview mpack arj cabextract  

4. i3 Window Manager

1. Install i3:

sudo apt-get install i3  

2. Ranger: for file browsing:

sudo apt-get install ranger  

3. Sunflower file manager: Download and install:

sudo dpkg -i sunflower-0.2.59-1.all.deb  

5. SSD settings:

1. Turn off Hibernation

Edit /usr/share/polkit-1/actions/org.freedesktop.upower.policy and change allow_active to no to turn off hibernation:


2. Reduce writes to disk:

Edit /etc/fstab and add discard,noatime,nodiratime to your ssd drive line:

UUID=<uuid number> / ext4 discard,noatime,nodiratime,errors=remount-ro 0 1  

3. Put tmp in memory:

Reduce writes by putting /tmp, /var/tmp, and /var/spool in memory, adding this to /etc/fstab:

tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0  
tmpfs /var/tmp tmpfs defaults,noatime,mode=1777 0 0  
tmpfs /var/spool tmpfs defaults,noatime,mode=1777 0 0  

4. Reduce swappiness/pages:

Reduce swappiness to 0, and adjust dirty page writing if you have 6Gb or more of memory. Edit /etc/sysctl.conf:


5. Browser cache:

Install profile-sync-daemon to place browser cache in memory:

sudo add-apt-repository ppa:graysky/utils  
sudo apt-get update  
sudo apt-get install profile-sync-daemon  

Then edit /etc/psd.conf and add your user name to USERS:

USER="your login"  

6. Nvidia

  1. Find out the right driver version for your card on http://www.nvidia.com/Download/index.aspx.
  2. Add the edgers PPA repository:
sudo add-apt-repository ppa:xorg-edgers/ppa -y  
sudo apt-get update  
  1. Install the version you need. E.g. for version 340:
sudo apt-get install nvidia-340  

Reboot, choose i3 on the login screen, and start configuring!

comments powered by Disqus