Skip to main content

Posts

Accessing OCI public services via private network

Introduction When you running your workloads on any public cloud, protecting your network, data, instance from prying eyes and hands is one of the most important things. But whenever you need to access public services offered by a cloud, one has to go through the internet. When your data is going through the internet, your network/instance(if not using NAT) and data are exposed to the public. Is there a way to access public services offered by a public cloud safely, securely and with the same performance and high availability? So if you are using Oracle Cloud Infrastructure(OCI), look no further, your answer is Service Access Gateway(SGW). OCI users can access all these services directly from their Virtual Cloud Network(VCN) with private Subnet without any NAT, IGW by using SGW(No need to go to the internet). All traffic for these services is routed through OCI's internal network, thus protecting your data/network/instance. How to set up an SGW? This section explains ...

Introduction to SoftLayer/IBM's Cloud Load Balancer.

IBM Cloud Load Balancer(CLB) Introduction. They have couple of other LBaaS services but here we are going talk to about the Cloud Load Balancers. IBM introduced a new Cloud Load Balancer, which is equal to Amazons AWS (elasticity, ssl termination and L7/Application load balancing, auto recovery etc etc). All these in one LBaaS unlike AWS. IBM CLB offers couple of variations which user can apply at the time of CLB creation. For e.g. Select which data center one wants to create the CLB in. User can select a private CLB or Public CLB. Public CLB can be reached from the public networks where as private CLB can only reached within ones private network.  For Public CLB one can select which public VLAN one can use. There is an option to use the IBMs public VLAN where customer doesn't have any control or user can select to get the public VAN from their own account, where customer have absolute control over it. Which private VLAN to use. Customize CIPHER for SSL HTTPS support ...

PART 1: How to use SoftLayer Python library.

Install the SoftLayer's Python library.  pip install softlayer or clone the source code from the github and install from source code. git clone https://github.com/softlayer/softlayer-python.git python setup.py install Once we have installed the SoftLayer Python library we are ready to use it as shown in the following example. You need your username and api key to run the below example. One can get both user name and api key at the following link once you login successfully. https://control.softlayer.com/account/user/profile Accounts username and API key E.g. showing how to use SoftLayer Python library. import SoftLayer from SoftLayer.managers.image import ImageManager client = SoftLayer.Client(username='', api_key='') image_manager = ImageManager(client) mask = "mask[id,name,note]" imageTemplates = image_manager.list_private_images(mask='id,name,note') print("ID - Name - Note") for template in imageTem...

Enable stats GUI on haproxy.

Add bottom snippet to the haproxy.conf below the defaults section. listen  stats         bind 19.41.259.10:1234         mode            http         log             global         maxconn 10         clitimeout      100s         srvtimeout      100s         contimeout      100s         timeout queue   100s         stats enable         stats hide-version         stats refresh 30s         stats show-node         stats auth admin:password         stats uri  /haproxy?stats Make sure you are updating the IP address on the bind to your VIP and if you want, you can change th...

How to enable Openstack Octavia, LBaaS V2 with devstack.

Little Intro to Octavia. Octavia is a service manager for Openstack Load balancer as a service. Neutron LBaaS V2 plugin talks to Octavia through Octavia driver. Octavia driver talks to Octavia api(o-api) and that in turn talks to Octavia control worker(o-cw). Neutron LBaaS V2 Plugin ----> Octavia plugin driver -----> o-api ----> o-cw Other than o-api and o-cw Octavia has 2 more components, housekeeping(o-hk) and health manager(o-hm). o-api Octavia api server which receives all the request from octavia LBaaS driver and passes it to o-cw. o-cw It's the main workhorse, it creates the load balancer VMs( amphorae ), configures them. o-hk keeps track of spare amphorae. o-hm Manages the health of the amphorae through heartbeats, collects the stats and takes care of fail over by creating a new amphora when it fails to get the heartbeat. How to enable Openstack Octavia, LBaaS V2 with Devstack. Since octavia uses a VM for loadbalancer its needs good a...

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...

error: command 'gcc' failed with exit status 1 while installing eventlet[Solved] for centos or ubuntu

Solution : Install python-devel using following command. yum install python-devel FYI, OS I was running. # uname -a Linux Dell620 2.6.32-220.17.1.el6.x86_64 #1 SMP Wed May 16 00:01:37 BST 2012 x86_64 x86_64 x86_64 GNU/Linux # cat /etc/redhat-release   CentOS release 6.2 (Final) for Ubuntu use the following command  aptitude install python-dev

How to debug a deadlock in multithreaded c/c++ program

Debugging a deadlock in multithreaded program can be little tricky . So the rescuer GDB is there for the help.I am just giving here the head start one needs to debug a multithreaded program for deadlocks. Run your program in GDB, wait until the deadlock happens and then use the following commands. 1. info threads which will list all of the threads that are running and a little * on the one which is currently running. Sample output  5 Thread 0x7ffff6be3700 (LWP 20175) 0x00000032cf6de8b3 in select () from /lib64/libc.so.6 3 Thread 0x7ffff75e4700 (LWP 20173) 0x00000032cf6ab15d in nanosleep () from /lib64/libc.so.6 2 Thread 0x7ffff7fe5700 (LWP 20172) 0x00000032cf6cd177 in sched_yield () from /lib64/libc.so.6 * 1 Thread 0x7ffff7fe7720 (LWP 20168) 0x00000032cf6de8b3 in select () from /lib64/libc.so.6 So one can see where all the threads are waiting at this point, so if happens to be a dead lock, threads must be stuck on lock or unlock. to see whats the thread name and all o...