Skip to main content

Posts

Adding a table to the openstack databases using migration scripts

So I had a task of adding a new table to the neutron database and at the same time not to use the neutron's migration script, as we wanted to keep the neutron code pure. I tried to google for the alembic data migration but could not find anything useful. So I started to reverse engineer the migration scripts of the other Openstack projects. I used the db code base from the following link. https://github.com/stackforge/group-based-policy/tree/stable/juno/gbpservice/neutron/db So I ll just mention the modifications we need to do to make it work. Please note that I am doing these changes in the Devstack environment. 1. Create folders for new project. Lets say we are building a new project called test_db. Add a folder named test_db as shown in the below location /opt/stack/test_db/test_db/ (Yes 2 folders just to keep in sync with Devstack Arch) 2. Copy migration folder from the below link to  /opt/stack/test_db/test_db/ https://github.com/stackforge/group-based-pol...

The complete review of the LG's watch and Android Gear.

Its been like 2 weeks since I got a LG's G watch. So here I go with all of the good, bad and ugly things about the LG's G watch and Android Grear. So first lets go over the specs. OS                    Android Wear (Compatible with Android 4.3+) STRAP            22mm (0.86inch) Changeable Watch Strap SCREEN            1.65” IPS LCD DIMENSIONS   37.9x46.5x9.95 mm BATTERY    400 mAh PROCESSING   Qualcomm® Snapdragon™ 400 processor with 1.2GHz CPU MEMORY    512 MB / 4 GB SENSORS    9 Axis (Accelerometer/Compass/Gyro) So why g watch instead of samsung. 1. It was a gift so .... but even if I wanted to buy I would have got g watch instead of samsung's. 2. 400 mAh of battery compared to 300 of samsungs. 3. LCD screen, dont think I am crazy, its a small watch and I think one doesn't need a high res screen w...

How to install openstack with Devstack on a single machine.

I think the best way to start messing with openstack is to install openstack using devstack. Its easy, customizable, easy to debug and the best part is one can simply discard the installed one and install new one in no time ! So I'll be giving you the steps to install  openstack on a physical box.  i.e all the component of the openstack will be installed on a single machine. Steps to follow. 1. Create a user as 'stack'. adduser stack 2.Install sudo and give the user 'stack' the sudo permission as most of the installation requires sudo permission. apt-get install sudo -y || yum install -y sudo echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers 2a. Once done with that, one can assign a password by doing passwd stack and then logout as root and login back as stack for all of the below steps. 3.Get the openstack code. The steps are install git and clone the code from github. sudo apt-get install git -y || yum instal...

A Google Nexus 5 review - All you want to know, battery camera speed and more !!

This post is about the NEXUS 5 , I have been using this phone for around 15 days, I got this phone on 8th November . So to know about the battery life, camera , the pros and cons read it further. Phone spec: 16gb. 5" display.If you have tiny hands it will be difficult to use :) 1920x1080 display. Snapdragon 800, 2.26GHz processor. LTE Enabled. Wireless charging. Android 4.4 aka kitkat. 1.3 MP front facing and 8 MP rear facing camera. 2300 mAh battery. Pros: For me battery life was a huge improvement as I was previously using Samsung galaxy S3 whose battery life sucked big time. Now battery lasts for almost a day (9 AM- 11PM) with the following applications being used : Wi-fi on for all the time. Bluetooth for around 30 mins. All of the auto sync on. Facebooking. Nike+ app running for 30mins without GPS. Playing some small games. Extensive use of google now. With all of these and moderate use of other apps, battery lasts for a day. So, Nexus5 is prett...

How to install rabbitmq on centos 6.

*All the comments are well appreciated * So here we go, one more installation tutorial this time its none other than the great RABBITMQ :) So to install rabbitmq on centos 6 please follow the below east steps. Install the EPEL-6 yum repo which contains Erlang R14B with the following command. This step is only for centos 6. rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm Install Erlang with the following command. yum install erlang Install RabbitMQ from RPM 1.rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc 2.rpm -Uvh http://www.rabbitmq.com/releases/rabbitmq-server/v3.1.4/rabbitmq-server-3.1.4-1.noarch.rpm By this time you are done installing rabbitmq. So just some points for the quick start. To make it run as daemon run this /sbin/chkconfig rabbitmq-server on To start the rabbit mq. /etc/init.d/rabbitmq-server start To stop the rabbitmq /etc/init.d/rabbitmq-server stop If you get into any tr...

Wondering how to start/stop a Python script from init.d ?

If you just looking for the solution please go to solution heading directly!! So I have been asked to start my python server at the time of boot up. As I am pretty new to Python and have never done this, I have to go and find some help from none other than our best bud google. So when I googled I had found couple solution like http://www.pietervanos.net/knowledge/start-python-script-from-init-d/ The problem with the above solution is that when you want to stop your Python script using the above solution it kills all of the python scripts running on the machine. Obviously we don't want to kill other Python script, don't we? And had found couple of other solutions which I was not able to understand or I could not make them work. So the solution which I am using is. Solution : The plan is to make your Python script in my case my Python server to store its pid in some file, lets say in location /var/run/your_script.pid. So I am making your life easy, use this bel...

Sending a SIGHUP signal to some external process from Python script

Code : import psutil import os import signal pids = psutil.get_pid_list() for pid in pids: if psutil.Process(pid).name == "process_name": os.kill(pid,signal.SIGHUP) break Steps to follow. 1.Get the PID of the process, in this case  "process_name"   to which you want to send out a SIGHUP signal. 2.Use os.kill(pid,sig) command to send out the SIGHUP signal to that process. 1.Get the PID of the process to which you want to send out a SIGHUP signal. One has to install a package called psutil by the following command. easy_install psutil Check out the following links for more details https://code.google.com/p/psutil/ https://pypi.python.org/pypi/psutil use psutil.get_pid_list() to get all of the PIDs. psutil.get_pid_list() works in the following manner.  pids = [ int ( x ) for x in os . listdir ( '/proc' ) if x . isdigit ()] return pids once you get all the PIDs get the PID you are i...