Skip to content

Instantly share code, notes, and snippets.

@jonesd
Last active October 7, 2015 15:43
Show Gist options
  • Save jonesd/1f49e083c5a266e5dc2a to your computer and use it in GitHub Desktop.
Save jonesd/1f49e083c5a266e5dc2a to your computer and use it in GitHub Desktop.
Ubunu 14 setup

Setup for Ubuntu 14

Change hostname

sudo hostname XXXXX
sudo vi /etc/hostname
sudo vi /etc/hosts
sudo service hostname restart

change-hostname-ubuntu1404

Install Docker (latest version)

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
sudo sh -c "echo deb https://get.docker.com/ubuntu docker main\
> /etc/apt/sources.list.d/docker.list"
sudo apt-get update
sudo apt-get install lxc-docker
sudo docker run -i -t ubuntu /bin/bash

ubuntulinux

Give user non-sudo access to docker

sudo groupadd docker
sudo usermod -aG docker ${USER}
sudo reboot

Install Docker-Compose

sudo apt-get install python-pip
sudo pip install -U docker-compose

docker-compose

Fix DNS issue for docker container inside Ubuntu VmWare VM

sudo vi /etc/NetworkManager/NetworkManager.conf
#dns=dnsmasq
sudo restart network-manager

Install NodeJS

Install latest nodejs and ensure that npm install does not require root authority

sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

npm config set prefix ~/npm
vi ~/.bashrc
export PATH="$PATH:$HOME/npm/bin"
export NODE_PATH=$NODE_PATH:$HOME/npm/lib/node_modules

restart terminal

If you have an old <v2 npm:

npm install npm -g
rm -rf /usr/lib/node_modules/npm

Install Oracle Java JDK 8

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update 
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default
java -version
javac -version

Can also use java 6, 7, 8

Install Ruby/Sass for grunt

sudo apt-get update
sudo apt-get install ruby-compass

Install MongoDB

sudo apt-get install mongodb

Install Maven 3

sudo apt-get install maven

how-to-install-maven-3-on-ubuntu-14

Install MySQL

apt-get install mysql-server-5.6

installing-mysql-5-6-on-ubuntu-14-04-trusty-tahr.html

Bash Tweaks

  • Uncomment force_color_prompt=yes

Eternal bash history

First, you must comment out or remove this section of your .bashrc (default for Ubuntu). If you don't, then certain environments (like running screen sessions) will still truncate your history:

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
# HISTSIZE=1000
# HISTFILESIZE=2000

Second, add this to the bottom of your .bashrc:

# Eternal bash history.
# ---------------------
# Undocumented feature which sets the size to "unlimited".
# http://stackoverflow.com/questions/9457233/unlimited-bash-history
export HISTFILESIZE=
export HISTSIZE=
export HISTTIMEFORMAT="[%F %T] "
# Change the file location because certain bash sessions truncate .bash_history file upon close.
# http://superuser.com/questions/575479/bash-history-truncated-to-500-lines-on-each-login
export HISTFILE=~/.bash_eternal_history
# Force prompt to write history after every command.
# http://superuser.com/questions/20900/bash-history-loss
PROMPT_COMMAND="history -a; $PROMPT_COMMAND"

Bash Completion

echo "source /etc/bash_completion.d/git-prompt" >> ~/.bashrc
echo "source /etc/bash_completion.d/maven" >> ~/.bashrc
echo "source /etc/bash_completion.d/docker" >> ~/.bashrc

. ~/.bashrc

Install VMWare Tools

Virtual Machine > Install VMware Tools (or VM > Install VMware Tools).

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential

sudo mkdir /mnt/cdrom
sudo mount /dev/cdrom /mnt/cdrom
ls /mnt/cdrom
tar xzvf /mnt/cdrom/VMwareTools-x.x.x-xxxx.tar.gz -C /tmp/
cd /tmp/vmware-tools-distrib/
sudo ./vmware-install.pl -d
sudo reboot

install vmware tools

Atom Text Editor

Atom Packages

  • atom-beautify
  • language-beautify
  • minimap

Clearing out old kernels

How To Fix “Not Enough Free Disk Space On /boot” In Ubuntu

You need to run this command in the terminal window:

dpkg -l | grep linux-image

The output will show what kernels you have installed. The following commands are for Debian/Ubuntu based distros, To remove unwanted kernels have a look at this example to see the command structure:

CAUTION: DO NOT RUN THIS COMMAND UNLESS YOU WANT TO REMOVE THIS KERNEL.

sudo apt-get remove --purge linux-image-3.13.0-45-generic linux-image-extra-3.13.0-45-generic

If you have several redundant kernels, add them to the command. Please understand that this is only an example. After you have selected the kernel(s) and removed them, you can run:

sudo apt-get clean && sudo apt-get autoclean && sudo apt-get autoremove -y

This will tidy things up. I always keep two kernels. The current one and the previous one to fall back to if it all goes wrong.

[http://www.unixmen.com/how-to-fix-not-enough-free-disk-space-on-boot-in-ubuntu/]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment