"A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects." (Robert A. Heinlein)
Showing posts with label Development. Show all posts
Showing posts with label Development. Show all posts

Saturday, 7 July 2018

The joy of virtualization: Docker


I took a relative pause from experimenting with Raspberry Pi to report my first experiences with something completely different. One of the first things you realize while programming server-side is how your program is only one piece of a bigger puzzle. Your application usually runs inside a container, connects to a database, expose or consume services and so on ... Solving this puzzle means defining an installation procedure that becomes different and sometime more complex by changing or scaling the installation target.

Docker

Docker is an container platform that overcomes the installation problems by producing a ready-to-install standardized operating-system-level virtual machine, packed with everything your application needs to be run. Unlike other virtualization solutions a Docker image only contains what your application needs without having to install and run a full hardware simulation like, for example, in Virtual Box.

Installation

Docker is available in two versions a professional “enterprise” edition and a community one (Docker CE) free to download. Installing Docker CE on Ubuntu is just matter of adding Docker repository address
sudo apt-get update

sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
Then installing it using the usual apt command
sudo apt-get updatesudo apt-get install docker-ce
Once the installation completed the current user, or any user who will use Docker, must be added to the “docker” group.
sudo adduser maxx docker
After logging out and in again Docker was ready for use and command
docker info
Correctly reported the empty environment initial state

First run

In order to test Docker is correctly installed and running a simple “hello-world” image is available. Just by calling the command:
docker run hello-world
Docker take care of downloading the image from its repository, installing and running it.

Another interesting image to start with is, as suggested in hello-world printout, the “ubuntu” image that installs and starts a console-only Ubuntu virtual machine with no effort.

Saturday, 13 October 2012

Android Development on Netbeans (and the EEEPC)


In my previous post I moved my first steps in Android development world by installing Android SDK and Eclipse IDE on my desktop computer. After successfully writing my first Android hello-world I went, almost immediately, on how to do Android development on the EEEPC 900. If it's true the desktop computer is much more suited for writing code it's the EEEPC tho one I always bring with me and I use for my experiments.
I'm a big fan of Eclipse and I use it everyday at work but, when it comes using it on a netbook, it performs very poorly. Worst of all some Eclipse configuration windows are too big to fit into the small EEEPC screen and even lack of scroll-bars. This is why I use Netbeans on the EEEPC. After a brief looking-up on the 'net I came to NBAnroid plug-in page.

Installing Netbeans to 7.2

Even if it isn't required I decided to upgrade my Netbeans installation to the latest 7.2 version. I so removed previous version by launching Netbeans removal script
sudo /usr/local/netbeans-7.1.2/uninstall.sh
then I downloaded latest Netbeans version from its download page and launched the auto-installing script
chmod +x netbeans-7.2-ml-javase-linux.sh
sudo ./netbeans-7.2-ml-javase-linux.sh
this started the usual Netbeans installation wizard 
after some “I agree” and several “Next” I got the new version installed.

Installing Android SDK

Like in my previous post I downloaded Android SDK from Google's page and extracted it on my home folder
mkdir android
mv Downloads/android-sdk_r20.0.3-linux.tgz android/
cd android/
tar -xf android-sdk_r20.0.3-linux.tgz

Saturday, 29 September 2012

The many steps of an Android Hello-World


As I promised on my last post, I couldn't resist not to write at least a hello-world application on my new phone. I went so through the, a bit long, task of installing the Android developer tools and writing my first program with it. I followed, step-by-step, instructions provided from Google Android SDK how-to pages. As a start I installed on my desktop computer but, soon, I'll try installing Android SDK on the EEEPC too.

Installation

The first step I took has been, of course, installing Eclipse IDE, a quite plain install from the software centre apart from some compatibility problem with Oracle Java 7. I had to revert to OpenJDK as default JVM in order to make Eclipse start.
The second step has been downloading and extracting Google's Android SDK. I though, at the beginning, about installing on a system folder like “/opt”, until I discovered that Android's Eclipse plug-in takes care of downloading and upgrading files on the SDK folder. I so went back to installing it on my home folder since running Eclipse as root user every time you have to do an upgrade is far from being advisable. By the way installing the SDK has only matter of extracting the downloaded file:
tar -xf android-sdk_r20.0.3-linux.tgz
Then I started Eclipse and selected the “Install new software” option from the “Help” menu opening the plug-in installation form. Here I added Google plug-in update URL (with the “Add...” button) and selected all the “Developer tools” items.