Quickly Setup Ubuntu Desktop or Server with all-in-one Bash Scripts.

Config Ubuntu

This is for a Ubuntu, I have run this on 14, 15, and 16 as a Desktop and a Server.

Terminal Help Has been moved:

Script Files

There are two main script files:

  • ./ Options to install desktop items.
  • ./ Options to install server items, you can do this on your desktop too.

Table of Contents

(Back to top)

Order of Grub

If you are running Grub as your default boot-loader, you can use this application to make it easier to change the order.

sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update && sudo apt-get install grub-customizer

Load the application either with <Super> and look for grub customizer or terminal gksudo grub-customizer.

Go to the General Settings tab, and you’ll see default entry.

  • Click the drop-down list and you can either select Entry By Order (Left Column) Or a specific Item (Right Column).
  • If you are dual booting Windows and want Windows the default, Select the right column for Windows.
  • The reason is if more items are added, perhaps new kernels, then if Position 5 which held Windows will no longer be the default.

(Back to top)

Dot Files

Here are some shortcuts for the dotfiles if you use them:

Shortcut Action
mkproject &lt;name&gt; virtualenv in ~/projects/&lt;name&gt;
workon &lt;name> load virtualenv in ~/projects/&lt;name&gt;
l ls -la
la ls -la
.. cd ..
cd ../../
…. cd ../../../
ffile find . name &lt;your_file&gt; (Searches for file in current folder)
ftext ftext () { grep -rnwi &lt;your_text&gt; . ;} (Searches for text in file of current folder)
ip current IP address
ports see open ports
update apt update
updatey apt update && install -y
ngmake vim etc/nginx/sites-available/&lt;name&gt;
ngenable enable nginx &lt;name&gt;
ngdisable disable nginx &lt;name&gt;
h history
codi python interactive scratch pad, See: Codi
Git Alias Command (See ~/.gitconfig)
git lg git log –graph –pretty=format:‘long-string’
git co git checkout
git ci git commit
git aa git add –all
git st git status
git di git diff
git dc git diff –cached

Tweaking the UI

This is for tweaking the UI

sudo apt-get install -y\
  • The Tweak Tool works great for Applying the Numix theme
  • Compiz is good for customizing everything, make sure to save a profile when you make your UI how you like.


These are some common items I enjoy using

sudo apt-get install -y\

Convert PPK to SSH Key

Already included in the utils is putty-tools. To convert a *.ppk (Putty Key) to an SSH or EC2 valid key do the following.

puttygen your_key.ppk -O private-openssh -o id_dsa
puttygen your_key.ppk -O public-openssh -o

Then move it to your SSH folder with proper permissions:

mv -i ~/id_dsa* ~/.ssh
chmod 600 ~/.ssh/id_dsa
chmod 644 ~/.ssh/

RedShift For Eye Strain

sudo apt-get install redshift

Create your configuration file:

sudo vim ~/.config/redshift.conf

Adjust the temperatures you prefer. I like mine to be very yellow and dim. (The lower the dimmer)

; Set the screen brightness. Default is 1.0.
; It is also possible to use different settings for day and night
; There are more settings for Gamma, Location Provider, Manual Location, etc.

Close and reload redshift. If you cannot find the icon anywhere run this in terminal:

pkill redshift-gtk && pkill redshift

If RedShift gives you a Geoclue2 error do this:

sudo vim /etc/geoclue/geoclue.conf

Append these lines at the bottom:


A newer version of redshift will install a desktop file so a Geoclue2 warning won’t happen on newer systems.

Numix Theme

Use the Unity Tweak Tool to set these. (Apply Icon & Themes)

sudo add-apt-repository ppa:numix/ppa
sudo apt-get update
sudo apt-get install -y numix-gtk-theme numix-icon-theme numix-icon-theme-circle

Turn it on using Tweak UI


To run windows applications Wine is the best option. I often use HeidiSQL with Wine.

sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get install -y wine1.7-amd64

If you need a 32bit installation:

sudo apt-get install -y wine1.7-i386

USB Maker for Windows ISO on Linux

You can easily use Startup Disk Creator and UNetbootin to create Linux to USB. But if you need Windows to USB from your Linux OS use Win USB:

sudo add-apt-repository ppa:colingille/freshlight
sudo sh -c "sed -i 's/trusty/saucy/g' /etc/apt/sources.list.d/colingille-freshlight-trusty.list"
sudo apt-get update && sudo install -y winusb

We replace the sources.list back to saucy in order to get it to work for ubuntu 14, that is the purpose of the sed command.

(Back to top)


Linux Apache MySQL PHP

- Installation for the following: - PHP 5.5+ (and Modules) - Apache 2 (and Modules) - Nginx (Optional) - MySQL - Redis - and Header Files.


PHP7 Ships with Ubuntu 16

It’s important to install php5-dev if you want to compile any add-ons later. We also want composer (PHP Package Manager) to be installed globally and accessible via $ composer

sudo apt-get install -y php5 php5-dev php5-curl libpcre3-dev

curl -sS | php && sudo mv composer.phar /usr/local/bin/composer

If you are looking for more PHP modules try:

sudo apt-cache search php5-


sudo apt-get install -y apache2 libapache2-mod-php5

If you are looking for more Apache modules try:

sudo apt-cache search libapache2-mod


Or if you prefer to use nginx

sudo apt-get install -y nginx


sudo apt-get install -y mysql-server mysql-client php5-mysql
sudo sed -i 's/bind-address/bind-address =' /etc/mysql/my.cnf

The last line simply allows you to connect from outside of the machine. A good example of wanting that is if you had a Vagrant Box.


This is a very nice utility in Python

pip install mycli

Usage (See the documents from the git link above for more example):

mycli -h localhost -u root
mycli -h localhost -u root -p


sudo apt-get install -y redis-server


sudo apt-add-repository ppa:phalcon/stable
sudo apt-get update
sudo apt-get install -y php5-phalcon

Phalcon Dev Tools

This is an easy to use install script that will cleanup after itself. It can also be used for updating:

sudo bash

To test it run: $ phalcon

Secure Permissions

We will use the Access Control Lists (ACL) or (Filesystem Access Control List). We will use group permissions for folders so you don’t have to make the public writable, because 777 is dangerous.

# Make sure you have ACL installed
sudo apt-get install acl

Look for your main partition with:

$ df

Mine happens to be dev/root, yours may be dev/sda or something. Make sure to replace that below:

sudo /sbin/tune2fs -o +acl /dev/root

To see what file system you are using ext3, ext4, etc, use the partition:

sudo file -sL /dev/root

We have to put the partition in read-only mode, then remount it:

sudo /bin/mount -o remount /dev/root

Apply Group

# This sets the Defaults
setfacl -Rd g:www-data:rw /var/www
# This sets future file
setfacl -Rm g:www-data:rw /var/www

To Modify

setfacl -Rm g:www-data:rw /var/www

Otherwise you could always set up a crontab such as:

crontab -e

Then append this to run every five minutes.

*/5 * * * * /home/ramesh/ chgrp -R www-data /var/www && chmod g+rw /var/www

Lastly, you could have a deploy script that does this for you, such as Python Fabfile, but that’s another topic.

(Back to top)


Python is installed by default on Ubuntu, version 2.7 is suitable. I strongly recommend installing python-dev for headers to compile certain PIP packages.

sudo apt-get install -y python-dev
sudo apt-get install -y python-pip
sudo pip install fabric virtualenv virtualenvwrapper

If you plan on using SSL or PIL(Pillow) for Image manipulation, I’d have these dependencies pre-installed:

sudo apt-get install -y\

Note: Some programs use libffi (Foreign Functions Interface) and need the dev headers to build from it, as well as the other dev packages, yet FFI just looks funny to read.

(Back to top)


Install Ruby 2.X with header files in ruby2.3-dev, this will keep your gems from having issues.

sudo apt-get install -y\

For Ruby RVM (Version Management)

gpg --keyserver hkp:// --recv-keys D39DC0E3
\curl -sSL | bash -s stable

(Back to top)


I am using a PPA to fix the nodejs path issue(s)

sudo apt-get install nodejs
sudo chown -R $(whoami) ~/.npm
sudo npm install bower gulp grunt-cli -g

If installing coffee-script and typing $ coffee produces an error, make sure coffee is not within the $PATH

echo $PATH

Upgrade NodeJS

Clear NPM’s cache:

sudo npm cache clean -f

Install a helper called n

sudo npm install -g n

Install latest stable NodeJS version

sudo n stable

Or pick a specific version:

sudo n 0.8.20

(Back to top)


I use the default JRE/JDK, the others are up to you.

To insteall Default JRE/JDK

sudo apt-get install -y\ 

To install OpenJDK (7, 8, or 9)

sudo apt-get install -y\

To install Oracle JDK (7, 8, or 9)

sudo add-apt-repository ppa:webupd8team/java

sudo apt-get install oracle-java7-installer
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java9-installer

(Back to top)

Google Chrome

Version 41 has some annoying issues. It’s best to revert to version 40, and Ubuntu does not auto update Chrome without you doing a update.

Stable versions at at:

If you have chrome installed, I’d backup anything if you need it, and remove it (If you are sync’d, you won’t lose anything):

sudo apt-get purge google-chrome-stable
rm -rf ~/.config/google-chrome

Then install an older version – This is 40 for a 64-bit OS:


sudo dpkg -i google-chrome-stable_40.0.2214.95-1_amd64.deb

Then launch it with $ google-chrome and you can pin it to a unity bar.

(Back to top)

Ubuntu Fixes

These are solutions to fix problems I’ve encountered.

Sound Indicator Not Showing

This appears in the top-right menu on Unity. Tested in 1415.

This will also fix Tweak UI if a sound item is missing.

sudo apt-get install indicator-sound

For Unity (Default)

killall unity-panel-service

For Gnome

killall gnome-panel

Install Gnome 3

If you prefer Gnome 3 over the Unity desktop it’s easy to install:

sudo apt-get install ubuntu-gnome-desktop
sudo service gdm restart (Or a reboot is easier)

Unity uses lightdm and Gnome uses gdm, it’s easiest to stick with lightdm.

If you want the default login a certain one select either lightdm or gdm. If you want to change it later run:

sudo dpkg-reconfigure gdm

Easy Window Resize

Without Compiz, you can resize windows very nicely: - Focus on a window - Hold ALT + Middle Mouse Click + Drag - Note: Depending on where you position your mouse to will resize up/down/left/right

Left or Right Close Buttons

Run this simple command in the terminal and you will see the positions change right away.

Move to right (terminal)

gsettings set org.gnome.desktop.wm.preferences button-layout ':minimize,maximize,close'

Move to left (terminal)

gsettings set org.gnome.desktop.wm.preferences button-layout 'close,minimize,maximize:'

Fix Gnome Lockscreen

In terminal make sure this is false, then try your hotkey ctrl+alt+l or if you set it like min super+l in the settings:

gsettings set org.gnome.desktop.lockdown disable-lock-screen 'false'

My Gnome Extensions

You need to use Firefox or IceWeasle at to toggle these items. I suggest creating an account so you have a record.

You can use TweakUI to toggle Extensions when they are installed.

Reload Gnome Freeze

This is a rare things for me, it happens much more in unity and requires a lot more “damaging” things. To fix a gnome that seems frozen do the following:

ALT + F2 enter in r (lowecase) and press Enter

(Back to top)

Adjust Mouse and Devices

When using a USB mouse sometimes the speed is just not right, in my case it’s too slow often. Here is how to adjust it:

xinput --list

I get something like this:

⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ ETPS/2 Elantech Touchpad                  id=15   [slave  pointer  (2)]
⎜   ↳ Logitech Unifying Device. Wireless PID:101b   id=12   [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Power Button                              id=8    [slave  keyboard (3)]

The ID of my mouse is 12. You can see all the properties with:

$ xinput --list-props 12

Then you can adjust the settings the String value and a value at the end:

$ xinput --set-prop 12 "Device Accel Constant Deceleration" 2

Preserve Settings

To keep the settings in Gnome, do the following:

$ cd ~
$ touch && chmod +x

Example of file (Note: You can call it whatever you like):

xinput --set-prop 12 "Device Accel Constant Deceleration" 4

Then Add the Bash script the Gnome Session:

$ gnome-session-properties

(Back to top)

Virtual Machine Related

This has to do with VirtualBox, not VMWare even though I favor it.

Fix Mouse Side Buttons in VMWare

Append the following to yourbox.vmx with the machine off.

mouse.vusb.enable = "TRUE"
mouse.vusb.useBasicMouse = "FALSE"
usb.generic.allowHID = "TRUE"

Vagrant VBGuest Fix:

vagrant plugin install vagrant-vbguest

vagrant ssh
sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions

Windows 8 VirtualBox Fix

Running Windows 8 in Virtualbox has an odd error, run this in cmd or powershell, or terminal on linux.

vboxmanage list vms
vboxmanage setextradata "The Box Name" VBoxInternal/CPUM/CMPXCHG16B 1

Install ATI Drivers

sudo apt-add-repository ppa:xorg-edgers/ppa
sudo apt-get update

sudo apt-get install fglrx
sudo amdconfig --initial
sudo apt-get install gksu

To Edit Catalyst Settings; Type the following in the Global Launcher (Super Key/Windows Key):

gksu amdcccle

Remove ATI Drivers

sudo apt-get remove --purge fglrx fglrx_* fglrx-amdcccle* fglrx-dev*
sudo rm /etc/X11/xorg.conf
sudo apt-get install --reinstall xserver-xorg-core libgl1-mesa-glx libgl1-mesa-dri libgl1-mesa-glx libgl1-mesa-dri
sudo dpkg-reconfigure xserver-xorg

(Back to top)

Chrome Addons

(Back to top)

Other Applications

By JREAM 2014-2015

(Back to top)

Related Repositories



My xmonad config for Ubuntu 14.04 and 12.04, including package list, config files, and instructions. ...



Quickly Setup Ubuntu Desktop or Server with all-in-one Bash Scripts. ...



A shell script for install rails app instance for production, include bash config, nginx, percona mysql, rvm, unicorn, and deploy user ... etc ...



How to Configure a GPU Cluster Running Ubuntu Linux ...



Configuration for Nginx (under Ubuntu/Debian) web server hosting Symfony2 application and accellerated by Varnish on . ...

Top Contributors



-   0.1 zip tar