How to install your Raspberry Pi OS (Raspbian) in 4 minutes

This tutorial will take you through the steps to install Raspbian, the official OS optimized for Raspberry Pi.



  • Rapsberry Pi (any model)
  • SD card (for Pi version 1), or micro SD card (for Pi version 2 & 3)
  • SD Card reader (for your Mac/PC from which you will format the SD card)
  • A Mac / PC / Linux computer.

Download, unzip and burn the image

Download the Raspbian image

Raspbian is declined in two version. Raspbian Jessie Lite comes as a minimal image based on Debian Jessie without graphical environment. So it is a light version (~308.5MB) and it is a good candidate if you intend to install a server. (Direct download to Raspbian Jessie Lite)
The second variant is Raspbian Jessie with PIXEL. Much heavier (~1.57GB) but comes with some extra features such as X-server and its component. (Direct download to Raspbian Jessie with PIXEL)Screen Shot 2017-04-02 at 17.27.27

Note that, at any time, you can install a desired package with apt-get, and go from the minimal image to the full Raspbian Jessie with Pixel if needed.
PIXEL is not a name but an acronym. It stands for Pi Improved Xwindows Environment, Lightweight, which makes fully sense in that context.

Unzip the image

On Linux, Unix and MacOS platform there is no problem to unzip the image. But if you have a Windows operating system, the specialized forums recommend you to use 7zip to decompress the file.

For this tutorial, I will uncompress the Raspbian Jessie Lite variant and will get:
Screen Shot 2017-04-03 at 21.18.19

Alternative way (for BSD or macOS): you can unzip and burn the image in one statement:

unzip -p 2017-03-02-raspbian-jessie-lite | dd of=/dev/sdb bs=1M

Time to use strong acid to cut the metal!

Etcher (meaning) is a fantastic tool (developed with electron) to easily burn images to SD cards & USB drives. You can download it from here: link

After the installation, select the image, connect the drive (SD card), and burn it. It’s easy and simple.

Screen Shot 2017-04-03 at 21.36.35!! Do not forget to safely eject your SD card !!

When it’s done, you are welcome to plug into your RPi and enjoy your newly born OS.

Alternative tool: I can also recommend you UNetbootin to burn images to USB drives or SD cards. 


How to install your Raspberry Pi OS (Raspbian) in 4 minutes

Forget about Bash Shell, Zsh+Oh-My-Zsh is sexier!

For any developer, the terminal is THE most important daily tool. And Even if Bash and Zsh are both excellent Shells, we all have our preferences.

In my opinion, a product itself is nothing comparing to an ecosystem or a community. And this is why I love Zsh: this tool is great for my needs.

Four reasons to use Zsh over Bash:

  1. Autocorrection – try to type gir -m ‘my commit message’ in a Bash or in a Zsh to see the autocorrection in action.
  2. If you are on MacOS, your bash is old! Type a bash –version in your terminal to compare with the actual stable version 4.4.5
  3. Command completion – git and cd command completion are more powerful on Zsh than Bash.
  4. The greatest of the path replacement

Enough talk, let’s cut to the chase!


  • Internet connection
  • Homebrew
  • Admin rights

Install Zsh and Zsh-Completions

To check if you already have a version, type:

which zsh

I have already a version of Zsh on my MacOS but it isn’t the newest. So I decide to update this system-provided version using Homebrew and Zsh-Completions

brew install zsh zsh-completions

Change the default Shell to Zsh

To add or change the user database information and in particulary change the user shell, type this command:

chsh -s /usr/local/bin/zsh

Install Oh-My-Zsh

Now it’s time to get additional functionality with Oh-My-Zsh framework on top of Zsh. To do this, you will need to go back to your home directory and install Oh-My-Zsh:

cd ~
curl -L | sh

After a restart to load the Zsh shell, you can already notice the change:


[Optionally] Apply another theme and configure your .zshrc

Open the .zshrc file with your favorite text editor, for example

vim ~/.zshrc

and apply for example the theme ‘agnoster‘: at the line 9 (in my version), change it with:


save it.

Go to Powerline-Fonts, download it, unzipped, and install it:


To have some eye friendly colour combinations, we have to install Solarized Light and Solarized Dark themes. Go to, under the Download section get the lastest .zip file. Then:

unzip ~/Downloads/solarized

Go under Downloads/solarized/ and with the ‘alt’ key pressed (to bypass the macOS defenses) click on the Solarized Dark ansi.terminal and Solarized Light ansi.terminal

In the terminal preferences (Settings -> Profiles), click on Solarized Dark and then the Default button.

Screen Shot 2017-02-24 at 22.40.36.png

Finally, you should see your terminal ending like:

Screen Shot 2017-02-24 at 22.55.22.png

[Optionally] Add some plugins to your Oh-My-Zsh

You also can add some plugins to simplify your daily life. In my .zshrc file, I have replaced plugins=(git) with the following:

plugins=(git colored-man colorize github brew osx zsh-syntax-highlighting sublime xcode)


Forget about Bash Shell, Zsh+Oh-My-Zsh is sexier!

REST – the architectural style of the Web

There are numerous ways to bind a system to another such as sockets, named pipes, RPC, CORBA, RMI, Web services and shared memory to name a few of them. But why the Representational State Transfer (REST) has such an impact as architectural style for designing scalable distributed applications?

REST is an easy to use revolution

The best concept often comes with the simplest way to solve the problem. Although REST is not a standard, it is widespread due to its simplicity and ease to use and it is still a simpler alternative to SOAP, WSDL-based Web services.

Millions of people use the Web daily and thousands of us have studied what the Web is. But have we used the full potential of the World Wide Web just by jumping from one document to another through URLs over the network named Internet? Think wider!

Loose coupling

When two systems are so tight to each other, that they are not separable, then you have a monolith. This is the worst scenario of a good architecture principle which says that two systems must be independent as possible to be deployed, maintained, modified and removed with ease. This is why components communicate through interfaces and are so isolated from the others.

A web browser is loose coupled with a server since it is based on standard interfaces to communicate with a wide panel of servers, which provide a HTTP service.


Interoperability is the possibility that different systems can communicate through a determined common standard. In the Web ecosystem the standard are HTTP, URIs, XML, HTML, and so on. Most of the technologies on the Web communicate through HTTP such as SOAP, COM, CORBA and RMI. Quasi all systems support HTTP as application protocol and URIs as identifier mechanism.


A lot of technologies solicit a massive reuse of other technologies to keep the software engineering as low as possible. A reuse of existing components is a common pattern to maximise the benefit on business and growth.

In the REST world, there is just ONE interface. Each client can use this only interface to communicate with the REST service.


The user of an application does not care about the complexity of a system. What matters is the response time. So the system has to answer in a small time box. The intern architecture and the implementation will determine if the overall system will be efficient, such as computing on a multitude of clusters. REST and HTTP have not a large influence on distributed systems.

REST helps this web infrastructure’s maturity such as cache mechanism and proxies.


As the REST approach is completely stateless, meaning same request yields same result (idempotency) the question on where to hold the state or alter objects comes in place.[more to come]


[more to come]


[more to come]

REST – the architectural style of the Web

How to add a datasource to Wildfly

This tutorial explains 3 methods how to add a datasource to the application server Wildfly from Redhat. If you don’t have Wildfly installed on your machine, you can follow my other posts:


Even if these steps are driver-agnostic, the example will use MySQL Connector (in other words, the JDBC Driver for MySQL) and Wildfly 10.0.0-Final.

For the next steps, you will need:

  • Wildfly installed and started
  • MySQL, MariaDB, PostgreSQL or any datasource compatible with Wildfly
  • The RDMS started and a database created (e.g. database: tutorial)

Notice that all these 3 methods have those steps in common:

  1. Add the JDBC Driver (a.k.a. Connector)
  2. Configure you datasource

Method 1: Add datasource via Admin-Console (the easy method)

1. Add the JDBC Driver

  1. Open the console from the browser (http://localhost:9990/console for a local server)Screen Shot 2016-07-23 at 16.21.50
  2. Then in Deployments, to add to open the wizardScreen Shot 2016-07-23 at 16.25.10
  3. After having clicked next, upload your Connector (i.e. JDBC Driver)Screen Shot 2016-07-23 at 16.26.50Here is the MySQL page to download the driver: MySQL Connector URL
  4. After uploading it, you may want to change the connector name. My recommendation is to name your connector with the provider-name, type and the project’s name that will use it, since your application server my have some projects with different versions of the same connector provider. Screen Shot 2016-07-23 at 16.34.17Note that the name is how the deployment is known to the users and must be unique. The runtime name is how is known to the server. This way you may have multiple names but refering to the same runtime name.
    Do not forget to enable your new deployment! (It should be enabled by default)
  5. Press finish to deploy your connector to your application server.

2. Configure you datasource

  1. Add a new datasource by clicking on ‘Start’ on the right of ‘Create a Datasource’. This will define a datasource to be used by deployed applications.
    Screen Shot 2016-07-23 at 16.48.22
  2. Then select ‘Subsystems’ and ‘Datasources’ and either Non-XA or XA depending of your project type. This tutorial needs a Non-XA datasource. Then click ‘Add’.
    Screen Shot 2016-07-23 at 16.53.52
  3. Then click ‘Add’, choose your datasource (MySQL Datasource for this tutorial) and click next.
    Screen Shot 2016-07-23 at 16.55.30
  4. Give to the attributes name and a JNDI name to your datasource. The JNDI name is like a name in a directory service allowing your programs to discover the data and object. Both name and JNDI name have to be unique. Then click ‘next’.
    Screen Shot 2016-07-23 at 17.00.40
  5. Then select your JDBC Driver you have deployed before. To do that, click on ‘Detected Driver’ and select it and click ‘next’
    Screen Shot 2016-07-23 at 17.27.23
  6. Then add the attributes you will need to connect to your RDMS server.
    Screen Shot 2016-07-23 at 17.53.37
  7. On the next screen, you can easily test your connection. In case of failure, the details will guide you to the solution.
    Screen Shot 2016-07-23 at 18.03.07

Pros / Cons

+ Easy to configure
+ No coding
– Need to use the management console, could be a security issue for a company
– Need to reboot your server to add a datasource.

Method 2: Add datasource via standalone.xml

The file that configures your server is named ‘standalone.xml’ and it is located in your wildfly installation directory under:


Important: The management console is updating the standalone.xml. Hence all we have done in method 1 is actually an abstraction of what we will do here.

1. Add the JDBC Driver

  1. With help of your window manager, go under
  2. Then create a subdirectory for your JDBC Driver representing the package structure of your Connector. So create the subfolder:
  3. Copy your JDBC Driver into the directory you have just created.
  4. Create a XML file in the directory named module.xml.
  5. $ pwd
    $ cd modules/system/layers/base/com/mysql/
    $ touch module.xml
  6. Then copy this into the module.xml you created:
    <?xml version="1.0" encoding="UTF-8"?>
    <module xmlns="urn:jboss:module:1.3" name="com.mysql">
        <resource-root path="mysql-connector-java-5.1.39-bin.jar"/>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>
  7. Edit the standalone.xml file located:
  8. Find the <drivers> element (after the <datasource> element). Then is add this snippet:
     <driver name="mysql" module="com.mysql">
  9. That’s it, the driver has been added to Wildfly. Now let’s configure the datasource.

2. Configure you datasource

  1. Just above the driver snippet, add this datasoure snippet:
    <datasource jta="true" jndi-name="java:/MySqlDS" pool-name="MySqlDS" enabled="true" use-ccm="true">
      <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
      <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>

    Make sure that the name of the driver (between the <driver> element are the name given to your driver). You can also configure the username, password and database name.

  2. Restart Wildfly and verify by checking the connection to the database through the mangement console:
    Screen Shot 2016-07-23 at 18.03.07

Pros / Cons

+ Standanlone.xml file can be part of your deployment, which is handy.
– Critical if multiple application run on the same server.
– Need to reboot your server to add a datasource.

Method 3: Add datasource via CLI

CLI stands for Command Line Interface and is a command line management tool for JBoss Application Server. It allows a developer / operator to execute management operations and includes these features:


  • connect to the specific controller or server instance;
  • view the available managed components, their attributes and operations;
  • deploy and undeploy standard packages at runtime in standalone and domain modes;

The two main advantages of the CLI is:

  • You can automate your interactation with Wildfly through a script.
  • You can run this on a running Wildfly server.

The CLI is located at:


1. Add the JDBC Driver

  1. Start the command line interface with the following command:
    ./ --connect controller=
  2. Then install the JDBC jar by loading it into a module.
    module add --name=com.mysql --resources=~/Downloads/mysql-connector-java-5.1.39/mysql-connector-java-5.1.39-bin.jar --dependencies=javax.api,javax.transaction.api

    Important: pay attention to where to add a space, and where not to add a space, this is scripting 😉

2. Configure you datasource

  1. Add the driver to the data-sources subsystem.

    It returns {“outcome” => “success”} in case of success.

  2. Create the datasource that uses the JDBC driver we just installed.
    data-source add --jndi-name=java:/MySqlDS --name=MySqlPool --connection-url=jdbc:mysql://localhost:3306/mysqldb --driver-name=mysql --user-name=root
  3. Test your connection and that’s it.Screen Shot 2016-07-23 at 18.03.07

    Pros / Cons

    + Best option from a dev-ops perspective. A script can be run before deploying an application and the script can be part of your deployment as well.
    + Plays very well with technologies like Docker.
    + Configuration can be changed at runtime! So no reboot required.


byteslounge: container vs application managed entity manager

mastertheboss: configuring a datasource with postgresql and wildfly

Thanks to

  • David Kühner for the technical review

How to add a datasource to Wildfly