Monday, September 10

Netbeans and PHPUnit again ...

Well in Ubuntu 12.04 the steps to install PHPUnit had changed a bit ...

Install the latest PHPUnit with ant

I got this instructions from a blog, but searching I cannot find which one ... anyway, the last steps seems redundant but this will ensure that the correct version of PHPUnit is installed

$ sudo apt-get install ant php5-dev php-pear
$ sudo pear channel-discover
$ sudo pear channel-discover
$ sudo pear channel-discover
$ sudo pear update-channels
$ sudo pear upgrade-all
$ sudo pear install --alldeps phpunit/PHPUnit
$ sudo pear install PhpDocumentor

Now we need to install PHPUnit from the repositories, this will create the phpunit file in /usr/bin, I'm sure there is a better way for this but I did't had the time to check

$ sudo apt-get install phpunit

The last step broke phpunit, so we need to reinstall it ...

$ sudo pear uninstall phpunit/PHPUnit
$ sudo pear install phpunit/PHPUnit 

Make work PHPUnit with Netbeans again

Open the Netbeans preferences, go to the "PHP" tab and in that tab select the "Unit Testing" tab
Type /usr/bin/phpunit into the first box, click "OK"

Now at your project right click the "Include Path" and select the "properties"

Click "Add Folder .,." and select the folder /usr/share/php/PHPUnit Click "OK"

Now you will have the autocomplete running for abstract classes, methods, asserts, etc.

As always pressing alt + F6 the unit tests will run in Netbeans providing a useful output and code coverage

Sunday, September 2

12+ Must have apps for LAMP development

Now that I am moving to a new job I need to install again my computer, so here is a list of applications that are often needed in a LAMP environment

1. Choose the right Linux distribution

I've always been a fan to ubuntu, but the latest releases of ubuntu are far to buggy and unstable, so I ended up switching to Linux Mint, the reasons are many, the ia32libs are not broken, it has java out of the box, not Oracle's but still ... in any case ane distribution you feel comfortable is fine.

2 Choose your desktop environment

Linux is vast and any desktop environment has it's unique features, my option on this is Gnome Shell available in the repositories, if not using gnome usually KDE is my next option

$ sudo apt-get install gnome-shell gnome-session

3. Choose your IDE

This is a controversial point, I often have many IDEs to code, my favorite is becoming PHPStorm, followed by NetBeans, Eclipse and Aptana, also have Komodo in the installers just in case.
When switching to android Eclipse is pretty much the best option

4. Web Browser

A nice web browser is key to productivity, my choices are simple Chrome / Chromium or Firefox with firebug, I got more used to Chrome altrough Chromium is on the repositories and firefox is almost always pre-installed

$ sudo apt-get install chromium-browser

5. Color Picker

Even working with backend sometimes is needed to grab a color from a design, here comes Gpick, a small utility that is in the Mint repositories that gives the HEX value of any pixel in the screen, reminds me of the old days using InstantEyeDropper in windows

$ apt-get install gpick

6. Screenshot tool

It's always needed a good tool to take screenshots, Gimp has this feature but I found Shutter to be one of the best options available, it is available on the repositories

$ sudo apt-get install shutter

7. Image Editor

A good image editor is always needed, the support for psd files and low memory consuption makes Gimp the best choice even when I had some serious issues reading psds created by Adobe Photoshop specially in the layers, so make sure you use this tool with caution

$ sudo apt-get install gimp

8. Database E-R Tool

A tool to see the E-R diagram of a database is really important, specially when defining a new database or reverse engineering an old one, MySql Workbench has proven to me many times even with it's bugs

$ sudo apt-get install mysql-workbench

9. File synchronization

Often I send myself unfinished code that would break the code in the version control, for this situations the cloud storage is the best solution, Dropbox has a native application, Box and Google Drive can be easily mounted using Nautilus and Secure WebDAV so the coice is yours, I use more Dropbox since the application is better for android

10. Virtualization

There are many options here, my favorite is Virtualbox, is easy to install and it behaves consistently with the hosted operative systems

11. SSH manager

I have access to many servers, dev, staging. produccion, several clients ... and sometimes is difficult to keep track of all the passwords and servers available I found a few solutions here but the one most rewarding was Gnome Connection Manager

12. Remote management

Sometimes I had to left the PC at work on, so to handle it remotely I found that Team Viewer is the best solution, it works even if a public IP is not available and the android app is very decent

Extra, Gnome Shell Extensions

If you choose to use gnome shell, there are some very interesting extensions available online, from themes to pomodoro clocks, just take a look into the directory and pick the ones you want