Skip to content

Instantly share code, notes, and snippets.

@d70rr3s
Last active May 8, 2018 20:55
Show Gist options
  • Save d70rr3s/3eaf2696cba10b0bc5c27b10544139ec to your computer and use it in GitHub Desktop.
Save d70rr3s/3eaf2696cba10b0bc5c27b10544139ec to your computer and use it in GitHub Desktop.
Customize step-by-step an Ubuntu local machine (for web developers)

Intro

Some personal notes for customize my local Ubuntu machine for work (web development mainly), includes tools a some tweaks. Before anything else lets just create a .tmp dir for .deb and source files.

mkdir -p ~/.tmp
cd .tmp

OS settings

Removing guest session

I found this specially annoying for a personal computer.

sudo mkdir /etc/lightdm/lightdm.conf.d
sudo sh -c 'printf "[SeatDefaults]\nallow-guest=false\n" > /etc/lightdm/lightdm.conf.d/50-no-guest.conf'

For restoring just remove the file

Guake terminal

I love tabbing and I preffer a one-hotkey terminal.

sudo apt-get update
sudo apt-get install guake

And to make it start at login.

sudo ln -s /usr/share/applications/guake.desktop /etc/xdg/autostart/

Num and Caps indicator

Some laptops comes without leds for locks keys. This program displays nifty icon indicators on your taskbar.

sudo add-apt-repository -y ppa:tsbarnes/indicator-keylock
sudo apt-get update
sudo apt-get install -y indicator-keylock

After install, you should run it from CLI and set the indicator to NumLock (used more often than Caps) and check the bottom option that shows the indicator even if no keylock is active.

Sudo insults

Sometimes you need more than "Wrong password" message. Run sudo visudo and edit the setting like this.

Before After
Defaults env_reset Defaults env_reset,insults

Permission denied!

Sudo or not sudo, thats the question. And if you are lazy this is the answer. Open your shell profile (.bashrc in my case) and add this where you fit most (change jodo for your fav word).

alias jodo='sudo $(history -p \!\!)'

NFS service

The best way to share files with your VM's

sudo apt-get install nfs-kernel-server

External links in Chrome

If you like Chrome (as I do, but most Linux users preffer Firefox) by default when yo click an external link it opens a blank tab. This is the solution.

  • Open $HOME/.local/share/applications/google-chrome.desktop with your favourite editor
  • Find the line with Exec=/opt/google/chrome/chrome
  • Add space and %U at the end, your line now should look like this Exec=/opt/google/chrome/chrome %U

Languages and packages

PHP

Though I use VM's for development I need the basics on my local machine.

sudo apt-get update
sudo apt-get install php php-cli php-common php-curl php-gd php-pear php-xdebug php-xsl

Composer

This is a must have for PHP applications.

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
php -r "unlink('composer-setup.php');"
composer global require "hirak/prestissimo:^0.3"
composer global require "deployer/deployer:^3.0"

NodeJS

You can't write Javascript without it.

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install -g bower grunt gulp yo

Ruby

If you wanna make your web apps shiny you need some gems.

sudo apt-get install ruby-full
sudo gem install bourbon neat bitters compass

Tools

Ansible

You cannot install your virtual machines with the right tools.

sudo apt-add-repository -y ppa:ansible/ansible
sudo apt-get update
sudo apt-get install -y ansible

VirtualBox

Free but powerful virtualization provider.

sudo apt-get install virtualbox virtualbox-ext-pack

Vagrant

The swiss-knife for local development with VM's.

wget https://releases.hashicorp.com/vagrant/1.8.6/vagrant_1.8.6_x86_64.deb
sudo dpkg -i vagrant_1.8.6_x86_64.deb
vagrant plugin install vagrant-hostsupdater
vagrant plugin install vagrant-auto_network
vagrant plugin install vagrant-exec

After installing you need to grant sudo rights for Vagrant and it's plugins. Run sudo visudo and add theese lines at the bottom.

# Allow passwordless startup of Vagrant with NFS synced folders
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
Cmnd_Alias VAGRANT_EXPORTS_COPY = /bin/cp /tmp/exports /etc/exports
Cmnd_Alias VAGRANT_NFSD_CHECK = /etc/init.d/nfs-kernel-server status
Cmnd_Alias VAGRANT_NFSD_START = /etc/init.d/nfs-kernel-server start
Cmnd_Alias VAGRANT_NFSD_APPLY = /usr/sbin/exportfs -ar
Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /bin/sed -r -e * d -ibak /tmp/exports
%sudo ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD_CHECK, VAGRANT_NFSD_START, VAGRANT_NFSD_APPLY, VAGRANT_EXPORTS_REMOVE, VAGRANT_EXPORTS_COPY

# Allow passwordless startup of Vagrant with vagrant-hostsupdater.
Cmnd_Alias VAGRANT_HOSTS_ADD = /bin/sh -c echo "*" >> /etc/hosts
Cmnd_Alias VAGRANT_HOSTS_REMOVE = /bin/sed -i -e /*/ d /etc/hosts
%sudo ALL=(root) NOPASSWD: VAGRANT_HOSTS_ADD, VAGRANT_HOSTS_REMOVE

Git + GitKraken

The most popular VCS and the "Unlasher" GUI for it.

sudo apt-get install -y git

For GitKraken download the package from the web. And then from your Downloads folder run.

sudo dpkg -i gitkraken-amd64.deb

PuTTY

Your SSH GUI client.

sudo apt-get install putty putty-docs putty-tools

Filezilla

If you want to work with remote files this is your tool.

sudo apt-get install -y filezilla filezilla-common

Editors and IDE's

Sublime Text

The most powerful text editor for developers (at least with GUI).

wget https://download.sublimetext.com/sublime-text_build-3126_amd64.deb
sudo dpkg -i sublime-text_build-3126_amd64.deb

PHPStorm

The most powerful IDE for the web.

wget https://download.jetbrains.com/webide/PhpStorm-2016.2.2.tar.gz
tar -xvf PhpStorm-2016.2.2.tar.gz
sudo mv PhpStorm-162.2380.11 /opt/phpstorm
sudo /opt/phpstorm/bin/phpstorm.sh
@daniroyo
Copy link

sudo apt-get instal putty putty-docs putty-tools

sudo apt-get install putty putty-doc putty-tools

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