Skip to content

Increasing the number of #posts


Today I’ve decided to increase the number of posts on this blog. I will be publishing one article/post a day week for 365 52 days weeks.While I can’t guarantee that they will be done on a weekly basis I will write 52 posts. Main topics will continue to be tech stuff although I might post some of the places I have traveled to.



Posted in Open Bar.

Tagged with .

Steve Jobs, Apple’s Visionary, Dies at 56

It is sad to say but Steve Jobs died today at age of 56. RIP Steve. He leaves the message “Keep loving what you like till the end of your journey!” Hope to see a cure for cancer soon!


Posted in Knowledge Base.

Tagged with .

How to install Openstack Nova (2011.3-nova-milestone) in all-in-one setup

ARTICLE: Openstack Cloud Software – Ubuntu Openstack – Ubuntu Cloud

In this article I will talk about how to install Openstack (2011.3-nova-milestone) on All-in-One setup. This kind of installation is useful for proof of concept (POC), development environments or if you want to have a basic cloud environment on your local computer.

OpenStack [1] is an IaaS cloud computing project by Rackspace Cloud and NASA. Currently more than 110 companies have joined the project among which are Citrix Systems, Dell, AMD, Intel, Canonical, HP, and Cisco. It is free open source software released under the terms of the Apache License [2].

OpenStack Compute (Nova) is a cloud computing fabric controller (the main part of an IaaS system). It is written in Python, using the Eventlet and Twisted frameworks, and relies on the standard AMQP messaging protocol, and SQLAlchemy for data store access.

Configure Prerequisites

Make sure the host in question supports VT ( Virtualisation Technology ) since we will be using KVM as the virtualization technology. This article was tested on Ubuntu 11.04 with the latest updates.

1. Configure bridging mode
sudo apt-get install bridge-utils

2. Install NTP Server
sudo apt-get install ntp

3. Install MySQL Server
Configure mysql’s root password
sudo apt-get install mysql-server

4. Create a database and mysql user for Openstack
sudo mysql -uroot -p<password> -e “CREATE DATABASE nova;”
sudo mysql -uroot -p<password> -e ‘GRANT ALL ON nova.* TO novauser@localhost IDENTIFIED BY “novapassword” ‘;

5. Install RabbitMQ – Advanced Message Queuing Protocol (AMQP)
sudo apt-get install rabbitmq-server

Install Openstack

6. Configure Official PPA repositories
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:nova-core/milestone
sudo apt-get update

PS: Note that trunk is changing rapidly so installing ppa:/nova-core/trunk may or may not work any given day. An alternative package installation is ppa:nova-core/milestone .

7. Install Openstack components
sudo apt-get install nova-api nova-network nova-volume nova-objectstore nova-scheduler nova-compute euca2ools unzip
sudo apt-get install glance

8. Restart libvirt-bin just to make sure libvirtd is aware of ebtables.
sudo service libvirt-bin restart

9. Edit /etc/nova/nova.conf and add the following

10. restart Openstack services
for i in nova-api nova-network nova-objectstore nova-scheduler nova-volume nova-compute; do sudo stop $i; sleep 2; done
for i in nova-api nova-network nova-objectstore nova-scheduler nova-volume nova-compute; do sudo start $i; sleep 2; done

11. Migrate nova database from sqlite db to MySQL db.
sudo nova-manage db sync
PS: It may take a while.

12. Define a specific private network where all your Instances will run. This will be used in the network of fixed Ips set inside nova.conf.
sudo nova-manage network create –fixed_range_v4 –label private –bridge_interface br100

12.1 Define a specific public network and allocate 32 Floating Public IP addresses for use with the instances starting from
sudo nova-manage floating create –ip_range=

13. Create a user, a project, download credentials and source them:
mkdir nova
cd nova
sudo nova-manage user admin lborda
sudo nova-manage project create project1 lborda
sudo nova-manage project zipfile project1 lborda
source novarc

Register an Ubuntu cloud image

14. Publish an image


uec-publish-tarball lucid-server-cloudimg-amd64.tar.gz lucid_amd64

Running an instance

15. Create a key par
euca-add-keypair lborda > lborda.priv
chmod 0600 lborda.priv

16. Allow icmp (ping) and ssh access to instances
euca-authorize default -P tcp -p 22 -s
euca-authorize -P icmp -t -1:-1 default

17. Then start the instance

emi=`euca-describe-images | awk ‘{print $2}’ |grep -m1 ami`
euca-run-instances $emi -k lborda -t m1.tiny

17.1 Assign public address to the instance
euca-assocate-address  -i <instance_id> <public_ip_address>

18. SSH to the instance
ssh -i lborda.priv ubuntu@<ipaddress>

19. Terminate instances
euca-terminate-instances <instance_id>

20. That is it! Just start using the instance!

Nice commands to know [3]

nova-manage instance_type list
nova-manage flavor list
nova-manage instance_type create m1.xxlarge 32768 16 320 0 0 0
nova-manage instance_type delete m1.xxlarge


[1] –
[2] –
[3] –

Other links
[4] –
[5] –

Posted in Knowledge Base.

Tagged with , , .

How to find all the regions in Amazon EC2

After you have sourced your credentials file you must run:

bordalnx:~/.ec2$ ec2-describe-regions
REGION    eu-west-1
REGION    us-east-1
REGION    ap-northeast-1
REGION    us-west-1
REGION    ap-southeast-1


Posted in Knowledge Base.

Tagged with , , , .

How to create LVM on Ubuntu

Create LVM on Ubuntu

1. Using the whole secondary hard disk for LVM partition:
sudo fdisk /dev/sdb

Once in the fdisk menu:
1. press n to create a new disk partition,
2. press p to create a primary disk partition,
3. press 1 to define it as the first disk partition,
4. press ENTER twice. This converts the whole secondary disk into a single disk partition,
5. press t to select the partition type,
6. press L to list all the supported partition types,
7. press 8e to select Linux LVM partition type,
8. press p to display the secondary hard disk partition setup. it shows you as /dev/sdb1.
9. press w to write the partition table
10. exit fdisk upon completion.

1.1 Assign disk partitions to physical volumes
sudo pvcreate /dev/sdb1

1.2 Create Volume Group VG for the /data and /backup volumes
sudo vgcreate myvg_data /dev/sdb1

pvdisplay and vgdisplay gives you information about LVM.

1.3 Create Logical Volumes ( LV )
sudo lvcreate -L 500G --name data myvg_data

1.4 Format file system
sudo mke2fs -t ext4 -L /data /dev/myvg_data/data

1.5 Mount file system
sudo mkdir /data
sudo mount /dev/myvg_data/data /data
df -hT

Make sure you see the partition mounted and its correct size.

1.7. Add it to the system startup
Check disks UUID by installing blkid and takes not of the UUID from /dev/sdb1 – /dev/myvg_data/data
sudo apt-get install id-utils
sudo blkid

1.8 Add the following entry in /etc/fstab to have the partition mounted
sudo vi /etc/fstab
Add at the end of the file the following lines:
UUID=<enter the uuid number found with blkid> /data ext4 errors=remount-ro 0 1

sudo mount -v
sudo umount --force /data
sudo mount -a
sudo mount -v

1.9 Make sure you can write something in to the new partition
touch /data/file1.asc
ls -la /data

2 Reboot the server and make sure that the /data partition is mounted.

Posted in Knowledge Base.

Tagged with , , , .

Path not the same in Ubuntu when using sudo


In case you run in to the same problem when running an application with sudo. Sudo does not keep the same $path environment as the current user.
This behaviour is the expected behaviour since sudo has been compiled with –with-secure-path=”/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin for security purposes. This change was intentionally done in order to make it harder to run Trojan scripts as root user.

If you want to change that behaviour you can follow the steps below:

Edit /etc/sudoers
$ sudo visudo
Add the following entry to the file
Defaults secure_path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/other_paths/

Save the file.
It should work as expected.


useful words: sudo, ubuntu, $path in ubuntu, environment path

Posted in Knowledge Base.

Tagged with , , , .

Make GNOME terminal behaves like Putty

If you are wondering how to have the same behaviour when copying and pasting text on Gnome terminal here is a different way of doing the same thing.

PuTTY: Highlight = Copy, Right-click = Paste

Gnome: Highlight = Copy, Middle-click (wheel) = Paste


useful words: gnome terminal, gnome copy/paste, putty gnome

Posted in Knowledge Base.

Tagged with , .

How to build rpm packages

Today I am going to show you how to create an environment for building rpm packages. Once you have your rpm environment set up I will show you how to create a haproxy rpm for your CentOS 5.5 version.

Setting up your system environment takes 6 steps:

  1. Install Development Tools
  2. Install rpmdevtools ( found on epel repository ).  The installation of EPEL repository is not part of this presentation. Find out how to install it here.
  3. Install rpmlint ( used to catch errors earlier in the .spec file )
  4. Create a rpmbuilder account
  5. Create the rpm tree
  6. Create a rpm package from an existent spec file for your CentOS specific version.

Setting up the rpm environment

1. Install Development Tools

# yum groupinstall “Development Tools”

2. Install rpmdevtools

# yum –enablerepo=epel install rpmdevtools

3. Install rpmlint

# yum –enablerepo=epel install rpmlint

4. Create a rpmbuilder account

# useradd rpmbuilder

# passwd rpmbuilder <password>

You should never use root to create rpm packages. It is a security risk creating rpm packages as root user.

5. Create the rpm tree

# sudo -u rpmbuilder -i
# rpmdev-setuptree

6. Create a rpm package from an existent spec file for your CentOS specific version.

On this step I will show you how to create a RPM Package for Haproxy (HAProxy – High Performance TCP/HTTP Load Balancer).
Please read the article on how to create a haproxy RPM Package for CentOS 5.5. ( to be written )


Posted in Knowledge Base.

Tagged with , , .

Install epel repository on CentOS 5.5

In order to install EPEL take the following steps:

  1. rpm -ivh
  2. disable epel repository since by default it is enabled. It is not recommended to keep non standard repositories activated. Use it just in case you need.
  3. sed -i “s/enabled=1/enabled=0/” /etc/yum.repos.d/epel.repo
  4. install the packages you’re looking for by using yum
  5. yum –enablerepo=epel install rpmdevtools

That is it!


useful words: centos 5.5 epel, epel centos 5.5, centos epel 5.5, epel 5.5

Posted in Knowledge Base.

Tagged with . ? Ubuntu / Debian ? What is it used for?

If you’re curious about why Ubuntu and Debian have an entry in /etc/hosts mapping to your server name. You’re not alone, in fact this is not a bug nor it has been put in there by mistake.
Looking at the example below we can see the entries of my testbox:    linuxlnx    # Added by NetworkManager    localhost.localdomain    localhost
::1    linuxlnx    localhost6.localdomain6    localhost6 linuxlnx

The reason why you find the in your /etc/hosts is that some applications like GNOME expects that the hostname to be resolved to an ip address with a canonical fully qualified domain name – FQDN. As you can see on Debian documentation:

Some software (e.g., GNOME) expects the system hostname to be resolvable to an IP address with a canonical fully qualified domain name. This is really improper because system hostnames and domain names are two very different things; but there you have it. In order to support that software, it is necessary to ensure that the system hostname can be resolved. Most often this is done by putting a line in /etc/hosts containing some IP address and the system hostname. If your system has a permanent IP address then use that; otherwise use the address localhost linuxlnx

To see whether your system hostname can be resolved to an IP address with a fully qualified domain name, use the hostname –fqdn command.

Also it could be any ip address in the address block since according to the RFC 1700 , addresses are reserved for loopback purposes.

Leonardo (using Ubuntu 10.10 Maverick Meerkat )

useful words: why debian

Posted in Knowledge Base.

Tagged with , , , .