Debian Tricks and Tips
Like most of you, I’ve given up on Ubuntu it had a great run but it’s all over baby-blue, it’s turned into a Mac wanna be. Granted yes it’s super easy to learn, and I highly suggest it to Winblows users as a easy linux start.
But coming from the days of Fiesty and before, I don’t like Unity bla and some of the other junk out there. So I’ve moved back to Debian and kind of forgot a lot of Debian since I’ve been so used to Ubuntu.
The First thing I needed as a PHP development envirment on the ASAP, so that’s a LAMP stack, we already have the L so we just need the AMP! for those not in the know, LAMP stands for Linux, Apache, MySql and PHP, all of which are easy to install in Synaptics.
Now one thing I’ve grown pretty used to was PPA packages. So let’s get them started and hopefully some Ubuntu packages can be installed easily.
Debian is different then Ubuntu in that you need the old school keys for packages, what security in place? OMG! No this is easy stuff on the Terminal and if you don’t wanna be in the Terminal, get a Mac or Ubuntu.
I like the launchpad PPA’s namely for Sublime and some other goodie’s, so without drum roles, 21 gun sallutes ( yea I know I cant spell, I’m sure you know what I’m saying or get me a Gizoo to fix these things! Google it hint Flintstones)
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys XXXXXXX
Let’s break that down, for once I’m gonna explaign! Apt is short for aptitude yep remember that? Now, the XXXXXX thing, that’s your key. When you goto your Launchpad PPA, there’s a key kinda looks like 1024 / XXXXXXX, take the / XXXXX and put it there.
After that, let’s add our sources, update and get jiggy wit it.
In there just grab the “deb *****” junk, ( yes I will show a install soon ) drop them in and run
sudo apt-get update
That updates are apt sources, then install something. Now since I’m setting up a Dev env, I want Sublime text editor to start. Which looks like this.
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
sudo apt install sublime-text
And yes I did forget to give you the PPA but it changes, I got mine from WebUpd8
And they have some great information and other goodies on there website. Google it
Another Editor I like to use is Geany
You can install it from Synaptic’s which makes it easier, just search for geany and grab whatever you need.
I also like to add the solorized color schemes, you can get them for github
Just clone it, copy the colorschemes and filedefs folders to
PHP Install tricks and tips
PHP was easy to install on Debian, some of the modules weren’t included in the base so lets add Curl, Mcrypt, etc
Just drop this in terminal
sudo apt-get install curl libcurl3 libcurl3-dev php5-curl php5-mcrypt phpmyadmin
Once I got PHP installed I needed PHPDocumentor, and CodeSniffer so let’s go get that stuff.
pear channel-discover pear.phpdoc.org
pear install phpdoc/phpDocumentor
pear install phpdoc/phpDocumentor_Template_responsive
pear install PHP_CodeSniffer
Another thing I needed was Mod Rewrite enabled ib Apache so just enable it.
sudo a2enmod rewrite
One more thing I always need is Virtual Hosts since the days of FTPing are almost over, I work local then gitpush it the servers mostly cloud based nowadays so, lets go through and make one easy like. This assumes you’ve done this before.
First copy the example
sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/new
Go inside there change what you need, make sure Allowoverride is set to All, and then enable it
sudo a2ensite new
sudo service apache2 restart
And that’s a virtual host.
NodeJS and Ruby like the Hipsters Do!
Ok ok, what Dev envirment would I be creating with out NodeJS and Ruby, I know so let’s get started shall we, hopefully you won’t be growing a beard and calling everyone Braj after this……Right on Braj :P
One again pop open the terminal, which you should be living in anyway. And let’s toss some commands out there.
Step one, install the build essentals which you should already have.
sudo apt-get update && apt-get install git-core curl build-essential openssl libssl-dev
After that, let’s clone Node and compile from source cuz we cool like that right Braj?
git clone https://github.com/joyent/node.git
# 'git tag' shows all available versions: select the latest stable.
git checkout v0.6.8
# Configure seems not to find libssl by default so we give it an explicit pointer.
# Optionally: you can isolate node by adding --prefix=/opt/node
sudo make install
node -v # it's alive!
# Lucky us: NPM is packaged with Node.js source so this is now installed too
# curl http://npmjs.org/install.sh | sudo sh
npm -v # it's alive!
Now that we have NodeJS going, lets drop in what I use alot
npm install recess -g
Ok that’s Node, Ruby is even easier here.
First thing’s first, we need to install abunch of build-dependicy’s for Rails, otherwise you’ll get errors eventually.
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
bash < <(curl http://rvm.beginrescueend.com/releases/rvm-install-latest)
apt-get install ruby rubygems libzlib-ruby rdoc irb
gem install rubygems-update
gem install rvm
Now we need to adjust the .bashrc and or .zshrc if using it
if [[ -s /home/<username>/.rvm/scripts/rvm ]]; then
I had to install this too
apt-get install file
Change to whatever version of ruby u want to use you can install more then one
rvm install 1.x.x
If you have any errors try checking the requirements for rvm
Once Rails and RVM are setup let’s get the Gems I like.
gem install compass
gem install sass
gem install bundler
gem install css2less
gem install less
Ok that’s the start of my Debian install. Stay Tuned for more Adventures in Linux land!