Friday, February 12, 2016

Install docker on MAC

I had docker on my ubuntu and I do not remember going through much for installing docker on ubuntu .

But for MAC i had to follow these instructions ( in case anybody is looking for these)

    brew install docker
    brew install boot2docker
    boot2docker up
    boot2docker init
    boot2docker up
    export DOCKER_HOST=tcp://192.168.59.103:2375
    export DOCKER_CERT_PATH=/Users/yours/.boot2docker/certs/boot2docker-vm
    export DOCKER_TLS_VERIFY=1
    boot2docker ip

Monday, January 25, 2016

Debugging openstack ....logs , services e.t.c

Something is broken ...
lets say heat is not starting up ..
what do we do ?

calm down!
check logs ( /var/log/heat-api.log,  /var/log/heat-api-cfn.log, /var/log/heat-engine.log)

Do you see any errors there ?? ( most of the times this should be sufficient)

but what if there is not error in the logs.. since the service is not even starting ?
try restarting the service(systemctl comes to rescue)

systemctl list-units |grep heat
systemctl status openstack-heat-api.service
systemctl status openstack-heat-api-cfn.service
systemctl status openstack-heat-engine.service


Just getting a failed status but no details ?try debugging
journalctl -u openstack-heat-api-cfn.service


here are few links which will help

https://access.redhat.com/articles/systemd-cheat-sheet

https://cdn.rawgit.com/ruzickap/linux.xvx.cz/gh-pages/files/systemd_cheatsheet/systemd_cheatsheet.pdf


Wednesday, December 16, 2015

Beginners guide to cloud and openstack

Disclaimer :-- all the content is sourced from various pages on openstack .. I am just putting together that information in a crash course :)

 

What is Cloud?

Let's quickly review just what exactly we mean by cloud technologies?
 Cloud technologies are built on existing technologies such as virtualization and clustering to virtualize hardware, software, storage, and networking resources into flexible units that are quickly allocated to meet demand. So rather than the old static model of dedicated hardware servers for various tasks, and static network and storage configurations, all of those formerly specialized devices are assimilated into a common resource pool. It's a more efficient use of hardware, and very fast to scale up or down according to demand. You can even configure self-service for users so they can grab whatever they need when they need it.
Types of cloud ?
  • Private
  • Public
  • Hybrid

  •  
     
All computing resources are shareable in a cloud, and there are three basic service models:
  • SaaS, software as a service
  • PaaS, platform as a service
  • IaaS, infrastructure as a service


What is Openstack? 
Open Source Cloud Computing platform (short answer).
OpenStack is a cloud operating system that controls large pools of compute, storage, and networking resources throughout a datacenter, all managed through a dashboard that gives administrators control while empowering their users to provision resources through a web interface.
https://en.wikipedia.org/wiki/OpenStack (long answer)





What are  Openstack components? 




core projects (short answer):
  • Identity (Keystone)
  • Dashboard (Horizon)
  • Orchestration (Heat)
  • Metering (Celiometer)
  • Object stroage (Swift)
  • Image service (Glance)
  • Networking (Quantum now Neutron)
  • Compute (Nova)
https://en.wikipedia.org/wiki/OpenStack (not so long answer)
https://www.openstack.org/software/ (long answer)




How do these Openstack Components talk to each other?
  1. Messaging Queues: AMQP is the messaging technology chosen by the OpenStack cloud.The OpenStack components such as Nova , Cinder , Quantum communicates internally via AMQP(Advanced Message Queue Protocol) and through eachother using REST-call. The AMQP broker, RabbitMQ , sits between any two internal Openstack components and allows them to communicate in a loosely coupled fashion i.e its components has, or makes use of, little or no knowledge of the definitions of other separate components. More precisely, Nova components (nova-api, nova-scheduler , nova-compute) use Remote Procedure Calls (RPC) to communicate to one another.
    In OpenStack the Nova ,Cinder and Quantum implements RPC (both request+response, and one-way, respectively nicknamed ‘rpc.call’ and ‘rpc.cast’) over AMQP by providing an adapter class which take cares of marshaling and unmarshaling of messages into function calls. Each Nova components (for example api ,compute, Scheduler, etc.) , Cinder components ( for example volume, Scheduler) , Quantum Components( for example quantum-server , agents ,plugins )  create two queues at the initialization time, one which accepts messages with routing keys ‘NODE-TYPE.NODE-ID’ (for example compute.hostname) and another, which accepts messages with routing keys as generic ‘NODE-TYPE’ (for example compute) .
  2.  

Tuesday, December 15, 2015

Beginner's links to find out about openstack

playing with openstack HEAT : beginners introduction

  • Install heat
  • Heat templates reside here
  1.  https://github.com/openstack/heat-templates
  2. which can be seen on the vm its in /vagrant/heat_templates
  3. there are test templates in root dir as well ex:- /root/heat_test_template.yml
  • on the controller vm this is how to use heat to spin up nodes
    1. heat stack-create -f heat_templates/test.yml test
    2. once its created you should be able to see it using CLI like this :-
      [root@controller-01 vagrant(keystone_admin)]$ heat stack-list

       +--------------------------------------+------------+---------------+----------------------+
      | id                                   | stack_name | stack_status  | creation_time        |
      +--------------------------------------+------------+---------------+----------------------+
      | xxxx-xxxxx | test       | CREATE_FAILED | 2015-11-16T20:59:49Z |
      +--------------------------------------+------------+---------------+----------------------+
    3. on horizon you can see it here 


          7.  If you click the "stack name" link you can get into more details of your stack.
          8. There are Actions like "resume stack, suspect stack , delete stack" e.t.c that you can perform
         9.  You can get different details on the stack on horizonw including the template itself and you can change the template
     
  • General Heat Resources :-

Friday, November 13, 2015

why use HSM(Hardware Security Module) ? What to look for in a HSM?

Let's answer first why ? Why a HSM should be used?
We all know security has sort of become a myth. Specially in today's interconnected, big data, cloud crazy world. The questions is How to secure data ? documents ? keys? passwords?

Very sensitive applications have to protect several different forms of data and in some industries (banking, health, complaint heavy ones) we absolutely can not overlook the possibility of security compromises.

Solutions with various encryption technologies came up when the field of security was burgeoning but they were only safe as long as the keys are safe . How do you keep the keys safe? Store your software key in some software? NAAA!! that won't work.
Store them in tapes like Millitary ? NAAA!! that won't work
Store them in a tamper proof hardware with multiple level of authentications? May be !!  atleast to some extent!

That's where Hardware Security Module HSM comes into play (added bonus it can help you clear  your industry's security compliance needs )

Now that we know why ( and there are more use cases here  if you still need more reasons) the nest question is what to look for in an HSM?

Lets list the technical factors that might help  :-
  • Performance -  encryption/decryption/key generation/signing, symmetric, asymmetric, decide based on your application needs
  • Redundancy - consider the failover cases, how often can it happen? How easy is it to replace it? Assess the impact of it on your operations and have a plan in place and in case that happens or look for a more robust one. Dual NIC or not , down time e.t.c are questions to be asked.
  • Backups - No matter how robust HSM is you can not afford to not think about backups because of the very real possibility of loosing access to your data forever. Consider how easy it is to backup your data (in a secure way ofcourse) , restore your data in HSM. 
  • Scalability -  Most HSMs have limit on slots available, number of keys you can stores, number of users you can add e.t.c e.t.c Have the scale in mind. What if you need to scale up or down ( for cost cutting) 
  • Procedures - Lets face it .. using HSM is not gonna make things simple .. its gonna make them more complex.  The real cost of using HSM is felt in operations because of the complexity that is introduced.A good HSM will come with a detailed usage manual which describes how things should be done to make sure its used correclty. It's not the hardware which matters, but how you use it. So consider APIs, Device management options , customer support , policy level controls , configuration options  e.t.c
  • Physical/Logical Security -  Ofcourse all HSMs should be able to tackle physical or logical hacking in to the hardware/software of HSM. Most HSMs as a result have tamper proof cases, hardcase ,  multiple level of authentications and "wipe everyhting" attitude for intrusion attacks. 
  • Complaince - If you have any compliance requirements make sure HSM supports it.



















    

    

Tuesday, August 18, 2015

Mixed expereinces of my first hackathon last year: How AT&T can legally steal your idea and own it

I wanted to share my unexpected and mixed experiences from my hackathon last year.
 http://www.eventbrite.com/e/att-mobile-app-hackathon-dallas-connected-car-tickets-12156796305

I attend that hackathon in aug 2015..pitched an idea for connected car theme "how about smart cars save babies in locked in carseat when parents are away from the carseat?"  we called it "childcheck" and talked about sensors detecting temperature rise and visual monitoring of the car and sending voivemails/pusnotifications/alerts to car owners( parents)
 and in 2015 a year later
At&t comes up with the same idea :)
http://mobile.pcmag.com/news/56056-at-and-ts-hot-car-sensor-could-save-babies-lives?origref=http:%2F%2Fabout.att.com%2Finnovation%2Ffoundry

and here are we presenting out project on the same idea at At&T hackathon

https://www.facebook.com/attdeveloper/photos/a.757760704270652.1073741892.151603081553087/757760794270643/?type=3&theater


so this is how it started:-
I was always cribbing not to be able to go to these cool weekend hackathons since the other half of me would strictly instruct me to spend all my weekend with my darling son .. who does not get enough of me on weekdays :) (neither do i get enough of him)

One day one of my good friend tells me that she quit her job and she is gonna look into starting a startup. She asked me if i was interested ( in working/investing) to which i was not very receptive ( good thing it had no impact on your friendship) and  she also asked if I would be interested in coming to this hackathon taking place over the weekend in Dallas. She is not a techie (she is the queen of business ;)) and i though to myself .. if she is going why don't i give it a shot ? ( I will get a ride with her as well ;))

So that's how I checked one more thing on my bucket list .. "attend a hackathon".

Since i had absolutely not idea about the hackathon i was going to .. I was totally unprepared. I did not have an idea .. and I just assumed I will just join somebody's  team  and work on their idea (whichever idea appealed to me). We had just bought a new laptop ..I ripped its packaging took it to the hackathon.

This was the hackathon we attended :- AT&T connected car hackathon 2014
 http://www.eventbrite.com/e/att-mobile-app-hackathon-dallas-connected-car-tickets-12156796305

Once we reached there I found a lot of folks ..sitting around .. not talking too much and still mingling around with "Hi" and Hellos.  I was happy to see guacamole and chips ( I was hungry !!)  I think there are many others like me who would go to hackathons jsut for free food ;) ( if only they served good vegetarian food and did not have families to take care of)

As per my nature .. and since I had not looked into the topic at all before ..I started asking people questions.."what is a connected car?", "what can a connected car do?" " do we have a cpapabilities document on connected car?" "what is your idea?" e.t.c e.t.c   Sometimes I got smirks, sometimes unrelated comments and sometimes a big laugh .. and out of all those was the most useful comment "its a hackathon .you can make the connected car do whatever you want .. hypothetically speaking..nobody has specs/asnwers/documentation e.t.c in a hackathon ..just a theme"

That comment was pretty revealing and got my brain cells racing .. then came the pitch time and there were a handful of ideas ( i guess 4-5 ) that were pitched .. i was suprised since there were soo many people out there i expected more ideas i could choose from.
and the sad part was that none of the ideas were on which i would want to work on .. since most of them were jsut about more and more data consumption. "A freind is going on a road trip .. this idea is to make the song playlist of the road-tripper crowd sourced from his friends"  and there were  3-4 more ideas along the same line of though .. "speeding and cop around ..raise an alert" e.t.c  Later on i was told that not everybody who comes with an idea lieks to pitch it .. they like to keep their idea secret and work in secret .. ( to me that totally did not make sense ..since I though attendees came here to work together on some idea ..not in silos) ..Respectfully all were nice ideas but none good enough to entice me  and now I had to make a choice .. either i work for their idea ( which i do not like ) or I leave or the last option is I come up with a idea i like and pitch it!!

I took the last option and since connected car can do anything you want ..had my brain cells still racing my idea was ..."can we make a smart car realize/detect there is a baby in the car locked in high heat and alert the parent?"  I scoped it out more while pitching .. How about we put something in place in baby's carseats to detect that baby is in the car alone and the car is locked and may be a sensor on car to detect car's temperature and then If all these conditions are satisfied then "extreme temp+baby in locked car alone" -> send message to car's oswner's cellphone (text/call/pushnotification/anything)

I gathered all my courage and pitched the idea since i know as a mother .. this was my biggest fear.. so many babies die every summer in texas in a matter of minutes because of being locked in car accidentally .. specially for new parents exhaustion is very real .. you are soo exhausted/absent mindede with soo many things to take care of it is a very realistic scenario that you forget that you have a little passenger in the back.  By the time you come back its too late .. sometimes the temperature rises too quickly and it happens all too fast !!

Finally I was the last one to pitch this new minted idea by my brain and people heard it .. some complained that i am not speaking loud enough .. so I shouted on top of my voice .. the idea (with passion :) )  ...Could not entice many .. some looks were encouraging but not many came forward . I assumed nobody is interested. My friend was .. and she said she could market the idea :) ..then 3 more folks came (all parents i think ..though i did not ask .. but who could relate to the idea i guess)

AND we have a team!! I was happy .. we all went home to start working on the idea next morning. ( while the winning team stayed overnight and worked on the idea right away :))

Next day we worked on the idea .. I must admit we did make good progress but not a stellar progress on the idea I admit and I realized how true the saying is "ideas are dime a dozen .. its the execution that matters".
By the time it was demo time in the evening we were able to "simulate temperature rising in a car" through a script and send pushnotification and place calls  one a given cellphone number when the temperature crosses the threshold. We had many other things we wanted to work on "a thermal sensor in to place in car" for temperature detection , "a visual sensor in car" (camera?) to detect baby in the car seat. (later one some people suggested we should also consider pets for this idea ..though detecting a baby was easier since baby would be in car seat visual matching is easier) ...but there is limited time and energy.

When the time for presentations came .. it was extremely interesting to see what other people had some up with. even though the ideas in my opinion were not that impressive .. some of the exceution of ideas totally blew me over .. like wow .. they did all this in last 24 hrs? amazing!!
Then came a team of 2 girls .. who basically pretty much copied our idea and implemented the hardware side of it. I could not believe my eyes!! None of us could .. they blatantly copied our idea ..put a spin on it and basically demo'd who their sensor with detect a change in temperature in the car.

I felt sooooo disappointed .. are like back to high-school .. with petty jealousies and competition wars ? why the hell did these 2 girls not join our team rather than copying( or should i call stealing) the idea? we had the software side figured out ..they had the hardware side .. we could have actually presented  and working end to end solution!!!

That was my biggest experience .. that no matter your age .. deep inside we are all insecure scared and competitive :)

we did not win  .. the idea with the crowd-sourced play list on a road trip won ..  http://www.eventbrite.com/e/att-mobile-app-hackathon-dallas-connected-car-tickets-12156796305


I wished there were more ideas on solving real-life problems .. rather than jsut more data consumption apps :( but then who am I to judge ? FB, twitter all are succesfull.

  I think in these things, more realistic and practical ideas don't get the attention or winning results but only those that seem cool do.

The most interesting thing is that recently I came across this :)
:-

http://mobile.pcmag.com/news/56056-at-and-ts-hot-car-sensor-could-save-babies-lives?origref=http:%2F%2Fabout.att.com%2Finnovation%2Ffoundry


Is it too much of a coincidence ?? That i pitch the same idea a year ago in a AT&T hackathon and then they come up with a technology on the same idea? Or are ideas everywhere dime a dozen??

Coming across this post is what actually made me realise that i should have written this post last year rather than this year .. but then as somebody wisely said i guess ..its the execution that matters and I am glad at&t took the idea ahead ..

Lessons learned from my first hackathon:-

1) be discreet about your idea
2) go well prepared with softwares , IDE e.t.c that you will need
3) may be not go to hackathons .. to reveal your real idea but just learn other's ideas and execute their ideas (since they might never find out)
4) blog about your idea .. before the company that sponsored your hackathon claims it as theirs.
5) Get some students on yrou team who can work overnight on your idea ;)