Tampilkan postingan dengan label Ubuntu. Tampilkan semua postingan
Tampilkan postingan dengan label Ubuntu. Tampilkan semua postingan

Selasa, 26 Juli 2016

Cacti Plugin in ubuntu server 14.04

A big strength of Cacti is its possibility to use other tools into plugins in its web interface. The plugins will be useful if you want to group some network related softwares into one interface.
On the cactiusers.org website, you can find and download all the available plugins. We chose here the tutorials about three very useful plugins: NTOP, syslog-ng and PHP Weathermap.

The first thing to do is to install a mandatory plugin, which is required before installing the other one, it is called the "architecture" plugin.

- For Cacti 0.8.6i & j, it can be downloaded (1.1) on the cactiusers.org website.
- For Cacti 0.8.6h, it can be downloaded (1.0) on our website.

If you install cacti with apt (packaged install), you can know your cacti version with the "apt-cache policy cacti" command.

Uncompress the file you just downloaded.

#tar -xvf /home/user/Desktop/cacti-plugin-arch.tar.gz
Move the files inside the architecture plugin directory you just downloaded into the directory containing the cacti website.

#cp /home/user/Desktop/cacti-plugin-arch/* /usr/share/cacti/site/ -R
#cd /usr/share/cacti/site/
Then run the command below:
Just be CAREFUL to run the patch matching your cacti version.

For cacti-0.8.6h:

#patch -p1 -N < cacti-plugin-0.8.6h.diff
For cacti-0.8.6i:

#patch -p1 -N < cacti-plugin-0.8.6i.diff
For cacti-0.8.6j:

#patch -p1 -N < cacti-plugin-0.8.6j.diff

THE CACTI PLUGINS:

1. NTOP (v 0.1) 2. PHP WEATHERMAP (v 0.82) 3. SYSLOG-NG (v 0.4)

1. NTop PLUGIN

NTop is a tool that will provide statistics about network usage.


#apt-get install ntop
download the plugin and uncompress it in the ntop directory.

#tar -xvf /home/user/Desktop/ntop-0.1.tar.gz
Copy the ntop directory in the /usr/share/cacti/site/plugins/ directory

#cp /home/user/Desktop/ntop /usr/share/cacti/site/plugins/ -R
We have to edit the /usr/share/cacti/site/include/config.php file and add just after the line beginning with "$plugins = array();":

$plugins[] = ‘ntop’;
Run ntop

ntop -u user -w 3000
Under the cacti web interface, don't forget to enable the NTOP plugin:

Login in to your cacti interface -> click on the console tab -> click on "User Management" in the "Utilities" section -> click on an user -> enable the "View NTop" checkbox.


2. PHP WEATHERMAP PLUGIN

For more information about PHP Weathermap, read the the PHP Weathermap tutorial.

Download the plugin and uncompress it in the weathermap directory. Enter the following command from where you downloaded Weathermap:

#tar -xvf /home/user/Desktop/php-weathermap-0.82.zip
Copy the weathermap directory in the /usr/share/cacti/site/plugins/ directory

#cp /home/user/Desktop/weathermap/ /usr/share/cacti/site/plugins -R
We have to edit the /usr/share/cacti/site/include/config.php file and add just after the line beginning with "$plugins = array();":

$plugins[] = ‘weathermap’;
Under the cacti web interface, don't forget to enable the weathermap plugin:

Login in to your cacti interface -> click on the console tab -> click on "User Management" in the "Utilities" section -> click on an user -> enable the "View Weathermaps" checkbox.

See the weathermap tutorial for help to configure the tool.



3. SYSLOG-NG PLUGIN (0.4)

An impressive plugin that permit to read the syslog-ng messages.


You can trigger alerts or remove logs from the interface.


For more information about syslog-ng, read the the php-syslog-ng tutorial.

download the plugin and uncompress it in the haloe directory. Enter the following command from where you downloaded haloe:

#tar -xvf /home/user/Desktop/haloe-0.4.tar.gz
Copy the haloe directory in the /usr/share/cacti/site/plugins/ directory

#cp /home/user/Desktop/haloe /usr/share/cacti/site/plugins/ -R
We have to edit the /usr/share/cacti/site/include/config.php file and add just after the line beginning with "$plugins = array();":

$plugins[] = ‘haloe’;
If you don't already have it, you have to install syslog-ng et forward the logs collect by it towards the MySQL database.

Install syslog-ng:

#apt-get install syslog-ng
Syslog-ng will uninstall the default syslog server.
We have to configure the /etc/syslog-ng/syslog-ng.conf file

Syslog changes

To receive logs from a remote machine trough the network, uncomment (ie remove the #) the line containing udp();

# use the following line if you want to receive remote UDP logging messages
# (this is equivalent to the "-r" syslogd flag)
udp();
Forward the logs to the MySQL database.

Add the lines below always in the /etc/syslog-ng/syslog-ng.conf file:

log {
source(s_all);
destination(d_mysql);
};

# pipe messages to /var/log/mysql.pipe to be processed by mysql
destination d_mysql {
pipe("/var/log/mysql.pipe"
template("INSERT INTO syslog_incoming
(facility, priority, date, time, host, message, seq, status)
VALUES ( '$FACILITY', '$PRIORITY', '$YEAR-$MONTH-$DAY', '$HOUR:$MIN:$SEC', '$HOST', '$MSG', '$SEQ', '$STATUS' );\n") template-escape(yes));

};
Database settings.

We need to create the MySQL database and then import the tables with the sql file.

#mysqladmin -u root -p create haloe
#mysql -u root -p haloe < /home/user/Desktop/haloe/syslog.sql
We give all the rights to a new MySQL user called haloeuser on the haloe database:

#mysql -u root -p haloe
>GRANT ALL ON haloe.* TO haloeuser@localhost IDENTIFIED BY 'haloepassword';
>flush privileges;
Configure the MySQL connection settings in the /usr/share/cacti/site/plugins/haloe/config.php file:

$haloedb_type = "mysql";
$haloedb_default = "haloe";
$haloedb_hostname = "localhost";
$haloedb_username = "haloeuser";
$haloedb_password = "haloepassword";
In the same file, to see colored lines in your syslog plugin, you need to change the lines beginning with "$haloe_colors" by the lines below:

$haloe_colors["emerg"] = "FF0000";
$haloe_colors["crit"] = "FF0000";
$haloe_colors["alert"] = "FF0000";
$haloe_colors["err"] = "FFAB00";
$haloe_colors["warning"] = "FFFF00";
$haloe_colors["notice"] = "FFAB00";
// $haloe_colors["info"] = "FFAB00";
// $haloe_colors["debug"] = "D0D0D0";
The MySQL pipe file.

Now, we have to create the temporary MySQL insertion file (pipe file):

#mkfifo /var/log/mysql.pipe
We have to push the logs inside the database with a bash script:

Create a new file and insert the line below, save the file as syslog2mysql.sh in the /usr/share/cacti/site/plugings/haloe directory.
Don't forget to change the MySQL username and password.

#!/bin/bash

if [ ! -e /var/log/mysql.pipe ]
then
mkfifo /var/log/mysql.pipe
fi
while [ -e /var/log/mysql.pipe ]
do mysql -u haloeuser --password=haloepassword haloe < /var/log/mysql.pipe >/dev/null
done
The script means that if the mysql.pipe file does not exist, create it.
Then, while the mysql.pipe exists, open a MySQL connection, and send the "buffered" data the database.

Run the syslog2mysql script to see if everything is okay. Errors will be displayed in case of problems.

#/usr/share/cacti/site/plugins/haloe/syslog2mysql.sh
Stop the script with "Ctrl+C".

Final step:

To run the syslog2mysql.sh script without the root user, we need to change a file ownership:

#chown user /etc/cacti/debian.php
It's important that the www-data user, in other words the apache web server user, has the read permission on this file. Normally, it's already the case:

#ls -l | grep debian.php
-rw-r----- 1 user www-data 557 2006-11-18 14:00 debian.php
Run the syslog2mysql.sh script under the user of your choice:

#su user
user@linux#/usr/share/cacti/site/plugins/haloe/syslog2mysql.sh
Finally, we need to configure two cron jobs.

crontab -e -u user
# when the computer boots, it starts automatically the syslog2mysql.sh script.
@reboot /usr/share/cacti/site/plugins/haloe/syslog2mysql.sh
# A command required to transfer the data stored
# into the syslog_incoming table to the syslog table. (every 1 minute)
# For an unknown reason this is not done automatically by the syslog plugin.
*/1 * * * * php5 -q /usr/share/cacti/site/plugins/haloe/syslog_process.php
The crontab command will update the /var/spool/cron/crontabs/user file.

Under the cacti web interface, don't forget to enable the syslog-ng plugin:

Login in to your cacti interface -> click on the console tab -> click on "User Management" in the "Utilities" section -> click on an user -> enable the "View Syslog" checkbox.

Minggu, 24 Juli 2016

Install flex on ubuntu

Before starting, please check to see if there is a latest version available to download. Visit http://flex.sourceforge.net/ to find out about the available versions. IMPORTANT: See "Configuring Ubuntu Linux After Installation" to install the development tools required to compile and install flex from source code.

Steps to download, compile, and install are as follows. Note: Replace 2.5.33 with your version number:
  • Downloading Flex (The fast lexical analyzer):

    Run the command below,
    wget http://prdownloads.sourceforge.net/flex/flex-2.5.33.tar.gz?download
  • Extracting files from the downloaded package:

    tar -xvzf flex-2.5.33.tar.gz
    Now, enter the directory where the package is extracted.
    cd flex-2.5.33
  • Configuring flex before installation:

    If you haven't installed m4 yet then please do so. Run the commands below to include m4 in your PATH variable.
    PATH=$PATH:/usr/local/m4/bin/
    NOTE: Replace '/usr/local/m4/bin' with the location of m4 binary. Now, configure the source code before installation.
    ./configure --prefix=/usr/local/flex
    Replace "/usr/local/flex" above with the directory path where you want to copy the files and folders. Note: check for any error message.
  • Compiling flex:

    make
    Note: check for any error message.
  • Installing flex:

      
  • As root (for privileges on destination directory), run the following.
    With sudo,
    sudo make install
    Without sudo,
    make install
    Note: check for any error messages.
That’s it. Flex has been successfully installed.

Jumat, 13 Mei 2016

Install command line on ubuntu 14.04 lts


========================================================================
# install openjdk
sudo apt-get install openjdk-7-jdk

# download android sdk
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz

tar -xvf android-sdk_r24.2-linux.tgz
cd android-sdk-linux/tools

# install all sdk packages
./android update sdk --no-ui

# set path
vi ~/.zshrc << EOT

export PATH=${PATH}:$HOME/sdk/android-sdk-linux/platform-tools:$HOME/sdk/android-sdk-linux/tools:$HOME/sdk/android-sdk-linux/build-tools/22.0.1/

EOT

source ~/.zshrc

# adb
sudo apt-get install libc6:i386 libstdc++6:i386
# aapt
sudo apt-get install zlib1g:i386


===================================================================================

Sabtu, 29 Agustus 2015

The Zimbra Collaboration Server is a mail server, collaborative web application and a web based mail server admin console in a single application. It provides LDAP, antivirus, antispam, collaboration features and a ajax webmail client. Zimbra is easy to use for administrators as well as end users due to its fast Ajax based web interface.

> Prerequisites

    Ubuntu Server 14.04 - 64bit
    root privileges
    Free space 25 GB
    RAM 4 GB

My zimbra Server profile used in this tutorial:

Domain : networking-router.local
IP     : 192.168.1.101
Mail   : mail.networking-router.local

What we will do in this tutorial:


  -  Install the prerequisite packages
  -  Configure hostname and DNS Server
  -  Download and Install Zimbra
  -  Test the installation

> Installation of prerequisites

Step 1 - connect to your server, get root privileges and install this package.

# apt-get install libgmp10 libperl5.18 unzip pax sysstat sqlite3 dnsmasq wget

> Configure hostname and DNS Server

In this tutorial will use the 'dnsmasq' resolving nameserver to speedup DNS lookups in Zimbra. Dnsmask has been installed as prerequisite in the first chapter, so we just have to configure it now:

Step 1 - Edit hostname and hosts

vim /etc/hostname

change your hostname with this 'mail.networking-router.local'.



vim /etc/hosts

add this line:
 
192.168.1.101   mail.networking-router.local  mail

Step 2 - Edit dnsmasq configuration

vim /etc/dnsmasq.conf
server=192.168.1.101
domain=networking-router.local
mx-host=networking-router.local, mail.networking-router.local, 5
mx-host=mail.networking-router.local, mail.networking-router.local, 5
listen-address=127.0.0.1

Step 3 - Reboot


sudo reboot

Installing Zimbra

Step 1 - Download Zimbra and extract it

wget https://files.zimbra.com/downloads/8.6.0_GA/zcs-8.6.0_GA_1153.UBUNTU14_64.20141215151116.tgz
tar -xvf zcs-8.6.0_GA_1153.UBUNTU14_64.20141215151116.tgz
cd zcs*

Step 2 - Run the Installer

./install.sh

At this step, zimbra will check the required packages and will ask you to agree to their installation.



Agreement Zimbra

and then choose the zimbra package :
Choose Zimbra Installation

here doesn`t need zimbra-dnscache, because in this tutorial use dnsmasq.
You need to wait, because this installation takes some time.
next step is configure "zimbra-store" for getting admin password. See the picture:

Configure Admin Pasword

Choose number "4" and enter. and then type your password:
Changing Password

Apply all Configuration:
Apply all configuration

and wait for Zimbra configuration finished.

Testing Zimbra

To test your zimbra server is running, you can type a command :

su - zimbra
zmcontrol status
try to access zimbra from web browser.  https://192.168.1.101/

Access Zimbra

or try admin page " https://192.168.1.101:7071/ ".

Jumat, 28 Agustus 2015

animated-wallpaper-galaxy

There’s a simple tool to replace your boring default wallpaper with a completely animated OpenGL wallpaper. It’s Android style live wallpaper on Ubuntu Desktop.

It only contains a few wallpapers so far. While it’s under developing, it continues adding new wallpapers.
animated-wallpaper-setting

To install this tool on Ubuntu:
There’s a ppa repository that contains stable packages for Ubuntu 13.04 Raring, 12.10 Quantal, 12.04 Precise and Linux Mint 15, 14, 13.

To add the ppa, press Ctrl+Alt+T, copy and paste below command into terminal and hit run:

sudo add-apt-repository ppa:fyrmir/livewallpaper-stable

Then update via command:
 
sudo apt-get update

Finally install the tool:
 
sudo apt-get install livewallpaper livewallpaper-config livewallpaper-indicator
 
Once installed, open Livewallpaper Config from Unity Dash.

^_^
how to enable Compiz effects Desktop Cute, Rotate Cube, 3D windows on Ubuntu 12.04 Precise Pangolin.

Here we go :
  • 1. Open terminal from the dash home or press Ctrl+Alt+T, execute this command to check if your machine support compiz effects or not:
     
    /usr/lib/nux/unity_support_test -p

    You’ll get this similar output:


  •  
  • 2. Install video card driver by launch Additional Drivers :
  • 3. Install Compiz Config Settings Manager:
    sudo apt-get install compizconfig-settings-manager
  • 4. Launch Compiz Config Stetings Manager (sscm)
  •  
  • 5. Tick on Desktop Cube, Rotate Cube. Press and hold CtrL+Alt then drag your mouse and you get:
  •  
  • 6. Tick on Cube Reflection and Deformation and 3D windows, then hold Ctrl+Alt and drag the mouse.
  •  
  • 7. Top and bottom pictures in cube can be configured under the configuration page of Cube Reflection and Deformation
Enjoy!

Kamis, 27 Agustus 2015

Introduction

Most of our operating systems including Linux can support different user interfaces (UI). The Graphical User Interface (GUI) is a user-friendly desktop interface that enables users to click icons to run an application. The other type of interface is the Command Line Interface (CLI) which is purely textual and accepts commands from the user. A shell, the command interpreter reads the command through the CLI and invokes the program. Most of the operating systems nowadays, provide both interfaces including Linux distributions.


Why create shell scripts?

The shell script is a very useful tool in automating tasks in Linux OSes. It can also be used to combine utilities and create new commands. You can combine long and repetitive sequences of commands into one simple command. All scripts can be run without the need of compiling it, so the user will have a way of prototyping commands seamlessly.

I am new to Linux environment, can I still learn how to create shell scripts?

Of course! Creating shell scripts does not require complex knowledge of Linux. A basic knowledge of the common commands in the Linux CLI and a text editor will do. If you are an absolute beginner and have no background knowledge in Linux Command Line, you might find this tutorial helpful.



Creating my first shell script

The bash (Bourne-Again Shell) is the default shell in most of the Linux distributions and OS X. It is an open-source GNU project that was intended to replace the sh (Bourne Shell), the original Unix shell. It was developed by Brian Fox and was released in 1989.
You must always remember that each Linux script using bash will start with the following line:

#!/bin/bash

Every Linux script starts with a shebang (#!) line. The bang line specifies the full path /bin/bash of the command interpreter that will be used to run the script.

Hello World!

Every programming language begins with the Hello World! display. We will not end this tradition and create our own version of this dummy output in Linux scripting.

To start creating our script, follow the steps below:

Step 1: Open a text editor. I will use gedit for this example. To open gedit using the terminal, press CTRL + ALT + T on your keyboard and type gedit. Now, we can start writing our script.

Step 2: Type the following command at the text editor:
#!/bin/bash
echo "Hello World"

Step 3: Now, save the document with a file name hello.sh. Note that each script will have a .sh file extension.

Step 4: As for security reasons enforced by Linux distributions, files and scripts are not executable by default. However we can change that for our script using the chmod command in Linux CLI. Close the gedit application and open a terminal. Now type the following command:
chmod +x hello.sh

The line above sets the executable permission to the hello.sh file. This procedure has to be done only once before running the script for the first time.

Step 5: To run the script, type the following command at the terminal:
./hello.sh

Let's have another example. This time, we will incorporate displaying some system information by using the whoami and date commands to our hello script.

Open the hello.sh in our text editor and we will edit our script by typing:
#!/bin/bash
echo "Hello $(whoami) !"
echo "The date today is $(date)"

Save the changes we made in the script and run the script (Step 5 in the previous example) by typing:


./hello.sh

The output of the script will be:



In the previous example, the commands whoami and date were used inside the echo command. This only signifies that all utilities and commands available in the command line can also be used in shell scripts.

Generating output using printf

So far, we have used echo to print strings and data from commands in our previous example. Echo is used to display a line of text. Another commmand that can be used to display data is the printf command. The printf controls and prints data like the printf function in C.

Below is the summary of the common prinf controls:
Control Usage
\" Double quote
\\ Backslash
\b Backspace
\c Produce no further output
\e Escape
\n New Line
\r Carriage Return
\t Horizontal tab
\v Vertical Tab

Example3: We will open the previous hello.sh and change all echo to printf and run the script again. Notice what changes occur in our output.

#!/bin/bash
printf "Hello $(whoami) !"
printf "The date today is $(date)"



All lines are attached to each other because we didn't use any controls in the printf command. Therefore the printf command in Linux has the same properties as the C function printf.

To format the output of our script, we will use two of the controls in the table summary above. In order to work, the controls have to be indicated by a \ inside the quotes of the printf command. For instance, we will edit the previous content of the hello.sh into:

#!/bin/bash
printf "Hello \t $(whoami) !\n"
printf "The date today is $(date)\n"
The script outputs the following:

Sabtu, 11 Juli 2015

The package management system on Ubuntu makes it extremely simple to install and remove packages, but sometimes it’s important to figure out what version of a particular package that you actually have installed.
The apt-get utilities are simply a front-end to the debian dpkg utility, which actually does the real work. You can use this utility to figure out what version is installed.
dpkg -s <packagename>
Here’s an example, where I was trying to figure out what version of Ruby I had installed on my system:
geek@ubuntuServ:~$ dpkg -s ruby1.8
Package: ruby1.8
Status: install ok installed
Priority: optional
Section: interpreters
Installed-Size: 272
Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
Architecture: i386
Version: 1.8.4-5ubuntu1.2
Depends: libc6 (>= 2.4-1), libruby1.8 (>= 1.8.4)
Suggests: ruby1.8-examples, rdoc1.8, ri1.8
Description: Interpreter of object-oriented scripting language Ruby 1.8
Ruby is the interpreted scripting language for quick and easy
object-oriented programming. It has many features to process text
files and to do system management tasks (as in perl). It is simple,
straight-forward, and extensible.
.
This package provides version 1.8 series of Ruby.
.
On Debian, Ruby 1.8 is provided as separate packages. You can get
full Ruby 1.8 distribution by installing following packages.
.
ruby1.8 ruby1.8-dev ri1.8 rdoc1.8 irb1.8 ruby1.8-elisp
ruby1.8-examples libdbm-ruby1.8 libgdbm-ruby1.8 libtcltk-ruby1.8
libopenssl-ruby1.8 libreadline-ruby1.8
Original-Maintainer: akira yamada <akira@debian.org>
You can see that I’ve got version 1.8.4 installed.
apt-get
You can run a simulation to see what would happen if you upgrade/install a package:
apt-get -s install <package>
To see all possible upgrades, run a upgrade in verbose mode and (to be safe) with simulation, press n to cancel:
apt-get -V -s upgrade
apt-cache
The option policy can show the installed and the remote version (install candidate) of a package.
apt-cache policy <package>
apt-show-versions
If installed, shows version information about one or more packages:
apt-show-versions <package>
Passing the -u switch with or without a package name will only show upgradeable packages.
aptitude
The console GUI of aptitude can display upgradeable packages with new versions. Open the menu 'Upgradable Packages'. Pressing v on a package will show more detailed version information.
Or on the command-line:
aptitude versions <package>
Passing -V will show detailed information about versions, again to be safe with the simulation switch:
aptitude -V -s install <package>
Substituting install <package> with upgrade will show the versions from all upgradeable packages.

Jumat, 10 Juli 2015

Become a better programmer

Programmers nowadays should all know these 3 very important rules:
  1. Don’t use floating points for money
  2. Store date/time in “UTC” timezone
  3. Always use the “UTF8″ character set
Tom Scott brilliantly explains the above 3 topics in videos that roughly last 10 minutes each. He explains them clearly, with depth and in a passionate way. They are listed below. Start the video’s by clicking on them.

1. Don’t use floating points for money

…never ever…
utf8_video

2. Store date/time in “UTC” timezone

…yes, always…
timezone_video

3. Always use the “UTF8″ character set

…no exceptions…
floating_points_video
IMHO every programmer should watch these videos, because they are very educational. And “Yes”, it will takes you 30 valuable minutes of your precious time. But “No”, you will not regret it, because they teach you some valuable and elementary lessons. Lessons that apply on any software project, written in any programming language.

real_programmers
To convert your Ubuntu 14.04 into a powerhouse for software development for PHP, you need to install some developer tools from the rich set of available software packages. I have made a top 10 of my favorite developer tools.

1) Install Eclipse 3.8 as a complete IDE

Altough everybody I know prefers the JetBrains IDE’s, I am still a sucker for free (as in speech) software. I think Eclipse and the various distributions of Eclipse you can download are just as good, when properly configured.
1
sudo apt-get install eclipse

2) Install Geany 1.23 as a lightweight IDE

I also often find myself using a lightweight IDE. After using way too much “gedit” I have recently (re)discovered “Geany” and I feel it is perfect. With the following commands you install it with a good set of plugins.
1
sudo apt-get install geany geany-plugins
You can find some Geany color schemes on Github that are worth installing as well.
1
2
3
4
5
wget https://github.com/downloads/codebrainz/geany-themes/geany-themes-1.22.2.tar.bz2
tar -xvf geany-themes-1.22.2.tar.bz2
mkdir -p ~/.config/geany/colorschemes/
cp geany-themes-1.22.2/colorschemes/* ~/.config/geany/colorschemes/
rm -Rf geany-themes-1.22.2 geany-themes-1.22.2.tar.bz2

3) Install MariaDB 5.5

MariaDB is the replacement for MySQL now that Oracle has acquired it. This is comparable to the replacement of OpenOffice with LibreOffice after Oracle got their hands on it.
1
sudo apt-get install mariadb-server

4) Install PostgreSQL 9.3

PostgreSQL may be the most powerful database around.
With PostgreSQL 9.2, query results can be returned as JSON data types. Combined with the new PL/V8 Javascript and PL/Coffee database programming extensions, and the optional HStore key-value store, users can now utilize PostgreSQL like a “NoSQL” document database, while retaining PostgreSQL’s reliability, flexibility and performance. (source)
I feel you should always consider using it before choosing any “NoSQL” or “documents-based” database.
1
sudo apt-get install postgresql pgadmin3
Do not forget to set the root (postgres) password.
1
2
3
sudo -u postgres psql postgres
ALTER USER postgres WITH PASSWORD '<password>';
\q

5) Install Apache 2.4 + PHP 5.5 + modules

Install Apache and the default method (mod_php) to serve the new PHP 5.5.
1
sudo apt-get install apache2 libapache2-mod-php5
Install PHP 5 support for MariaDB and PostgreSQL.
1
sudo apt-get install php5-mysql php5-pgsql
Some PHP packages for Symfony development.
1
sudo apt-get install php5-intl php5-sqlite
PHP packages for cURL and XDebug.
1
sudo apt-get install php5-curl php5-xdebug
Optional PHP packages for creating images (GD), doing geolocalization on IP address (GeoIP), encryption and Redis/Memcache caches.
1
sudo apt-get install php5-gd php5-geoip php5-mcrypt php5-redis php5-memcache php5-memcached
Now enable mod_rewrite and restart Apache to make sure everything is loaded.
1
2
sudo a2enmod rewrite
sudo service apache2 restart

6) Install Adminer 4

PhpMyAdmin is a very popular web-based database management tool. Adminer is a drop in replacement that beats it on almost all points. You can install the latest version of Adminer using:
1
2
3
4
5
6
sudo mkdir /usr/share/adminer
sudo wget -O /usr/share/adminer/latest.php "http://www.adminer.org/latest.php"
sudo ln -s /usr/share/adminer/latest.php /usr/share/adminer/adminer.php
echo "Alias /adminer.php /usr/share/adminer/adminer.php" | sudo tee /etc/apache2/conf-available/adminer.conf
sudo a2enconf adminer
sudo service apache2 reload
Now go here to run it: http://localhost/adminer.php
In the future you can easily update Adminer using:
1
sudo wget -O /usr/share/adminer/latest.php "http://www.adminer.org/latest.php"

7) Install Git

Install the Git source code versioning system:
1
sudo apt-get install git
Check out this great Git cheat sheet.

8) Install some compilers and build tools

With the following commands you get most common compilers and build tools.
1
sudo apt-get install gcc build-essential libc6-dev autoconf automake

9) Install the Microsoft fonts

There are always people that rely on the standard Microsoft fonts (like Arial). Although this is bad practice and HTML5 allows you to embed fonts, still it may solve some problems to just install these:
1
sudo apt-get install ttf-mscorefonts-installer

10) Upgrade your Office experience

A developer also needs to read or write some documentation or specifications. Libreoffice Writer is IMHO better than the real thing (Microsoft Word).
1
2
sudo apt-get purge gnumeric abiword
sudo apt-get install libreoffice

Feedback?