<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-1878358855636852054</atom:id><lastBuildDate>Thu, 04 Oct 2018 08:39:43 +0000</lastBuildDate><category>OpenSource</category><category>Cloud Computing</category><category>OpenStack</category><category>Tricks</category><category>Amazon</category><category>EC2</category><category>SaltStack</category><category>Security</category><category>Windows</category><category>.NET</category><category>ADFS</category><category>Federated Identity</category><category>Identity Federation</category><category>Pip</category><category>Python</category><category>SSL</category><category>TripleO</category><category>Trove</category><title>Open Tech</title><description></description><link>http://www.otechpad.com/</link><managingEditor>noreply@blogger.com (Saurabh Surana)</managingEditor><generator>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1878358855636852054.post-6455903996090000969</guid><pubDate>Mon, 02 Jun 2014 02:26:00 +0000</pubDate><atom:updated>2014-06-01T21:30:22.523-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">OpenSource</category><category domain="http://www.blogger.com/atom/ns#">Pip</category><category domain="http://www.blogger.com/atom/ns#">Python</category><title>TypeError: unicode does not have the buffer interface</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;You will encounter this error if you installed latest pip and setup tools (if you use tools like this:&amp;nbsp;&lt;a href=&quot;http://pip.readthedocs.org/en/latest/installing.html&quot;&gt;http://pip.readthedocs.org/en/latest/installing.html&lt;/a&gt;&amp;nbsp;for pip installation).&lt;br /&gt;&lt;br /&gt;The error pattern should look similar to :&amp;nbsp;&lt;a href=&quot;https://gist.github.com/saurabhsurana/db696248f5dddbfbd23d&quot;&gt;https://gist.github.com/saurabhsurana/db696248f5dddbfbd23d&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The issue happened when new setup tools (&lt;a href=&quot;https://pypi.python.org/pypi/setuptools/4.0&quot;&gt;setuptools-4.0&lt;/a&gt;) was released on June 1st.&lt;br /&gt;&lt;br /&gt;Work around here is to revert back to setuptools 3.6, then things should work fine for you.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;pip install -U &quot;setuptools==3.6&quot;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;~Thanks,
Saurabh

FWCAFX47R5GU&lt;/div&gt;</description><link>http://www.otechpad.com/2014/06/pip-install-error-type-error-unicode.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1878358855636852054.post-2716045375591587519</guid><pubDate>Sun, 16 Mar 2014 22:25:00 +0000</pubDate><atom:updated>2014-05-09T19:36:05.489-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">OpenSource</category><category domain="http://www.blogger.com/atom/ns#">OpenStack</category><category domain="http://www.blogger.com/atom/ns#">TripleO</category><title>OpenStack TripleO</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;OpenStack TripleO (OOO - OpenStack On OpenStack ) project is aimed at simplifying OpenStack installation.&lt;br /&gt;TripleO is a combination of multiple small services, it combines the powers of OpenStack Disk Image Builder (Image Building) and OpenStack Heat (Orchestration service) to deliver a simplified OpenStack installation process. The process involves set of scripts and mustache templates for configuration file that are configured with the help of disk image builder, and then set of services that read the data from Heat metadata service and applies that to the mustache templates when instance is running. &lt;br /&gt;TripleO uses some keywords very frequently, which were very confusing at first.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Seed Cloud/Bootstrap/TripleO CD:&lt;/h3&gt;Seed Cloud is the host on which TripleO CD or bootstrap disk is loaded with, which allows you to setup/run the TripleO UnderCloud installation. Once the UnderCloud is up and running, Seed Cloud can continue to exist or it might go away, as the sole purpose of the Seed Cloud is to help setup the UnderCloud layer.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;UnderCloud:&lt;/h3&gt;This the bootstrap host (one single standalone host in most cases), on which is running all the major OpenStack services (nova, glance, keystone, heat etc). This can be considers a OpenStack installation in itself, but instead of creating VMs for you, this will go an install OpenStack on your bare-metal server. In simple terms, it will treat your bare-metal as any other nova resources and will load them with pre-build images of the specific service that you want to install on the particular host. UnderCloud hosts/services are used by Admin directly/indirectly (with the help of some scripts) to standup the actual OpenStack Cloud. End Users of your intended OpenStack service will never have to deal with UnderCloud or they will not even know about its existence Although it will continue to exist/run to help you manage your OpenStack installation (lets say you want to re-image and existing host or add new host to the setup etc). &lt;br /&gt;&lt;br /&gt;&lt;h3&gt;OverCloud:&lt;/h3&gt;This is the real OpenStack installation which was setup by the UnderCloud. With the help of UnderCloud once all the bare metal servers are setup with necessary OpenStack service, that give you a real OpenStack Cloud Service Setup which is referred to as OverCloud. This is the OpenStack cloud service which your users will use to create OpenStack/Nova resources like instances, networks, volumes etc.  &lt;br /&gt;&lt;br /&gt;&lt;h3&gt;InCloud:&lt;/h3&gt;This is the set of resources end users will create using the OverCloud OpenStack services. These are actual virtual resources like nova compute instances or cinder volumes.   &lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://lh6.ggpht.com/-l5P9Q2_Aajc/U2gQB8m6MqI/AAAAAAAABFw/fKyR6pzno4Q/s1600-h/TechSaga-TripleO%25255B9%25255D.jpg&quot;&gt;&lt;img alt=&quot;TechSaga-TripleO&quot; border=&quot;0&quot; src=&quot;http://lh6.ggpht.com/-xboSjW6rd6U/U2gQC5aqu_I/AAAAAAAABF4/1XbMZguZgRE/TechSaga-TripleO_thumb%25255B7%25255D.jpg?imgmax=800&quot; height=&quot;374&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; margin-right: auto;&quot; title=&quot;TechSaga-TripleO&quot; width=&quot;660&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;~Thanks,
Saurabh

FWCAFX47R5GU&lt;/div&gt;</description><link>http://www.otechpad.com/2014/03/openstack-tripleo.html</link><author>noreply@blogger.com (Saurabh Surana)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/-xboSjW6rd6U/U2gQC5aqu_I/AAAAAAAABF4/1XbMZguZgRE/s72-c/TechSaga-TripleO_thumb%25255B7%25255D.jpg?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1878358855636852054.post-973669329006481763</guid><pubDate>Sun, 20 Oct 2013 08:53:00 +0000</pubDate><atom:updated>2014-05-09T19:40:24.682-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">OpenSource</category><category domain="http://www.blogger.com/atom/ns#">SaltStack</category><category domain="http://www.blogger.com/atom/ns#">Tricks</category><title>SaltStack Multiple Salt Master Setup</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;SaltStack supports configuring salt minions to talk to multiple salt master. This allows us to have a HA salt master setup. Which means if one of the salt master dies, minions will still be reachable from the second salt master.&amp;nbsp; If you are running your salt-stack setup inside the cloud, this is very helpful.&lt;br /&gt;&lt;h2&gt;Configuring Salt Minion:&lt;/h2&gt;In order to configure a minion to talk to multiple master, minion’s configuration may looks something like this&lt;br /&gt;&lt;blockquote&gt;&lt;pre class=&quot;csharpcode&quot;&gt;master:&lt;br /&gt;  - &amp;lt;IP Of Salt Master Host-1&amp;gt;&lt;br /&gt;  - &amp;lt;IP Of Salt Master Host-2&amp;gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;After this when salt minion service starts up, the minion will establish connection with both the master (will perform the key exchange with both of the masters separately). But for things to work correctly, both the masters needs to accept the key of the minion, if for any reason one of the master reject the key, then minion will not be able to talk to any of the masters. &lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://lh6.ggpht.com/-nbNBDsHG8LI/U2YAiWwayNI/AAAAAAAABFY/ZiQEGMdZyiQ/s1600-h/MultiSaltMaster11.jpg&quot;&gt;&lt;img alt=&quot;Multi-Salt-Master&quot; border=&quot;0&quot; src=&quot;http://lh3.ggpht.com/-6ljC43S0f7Y/U2YAi695MtI/AAAAAAAABFc/3K1fb3PYbO8/MultiSaltMaster_thumb9.jpg?imgmax=800&quot; height=&quot;500&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;&quot; title=&quot;Multi-Salt-Master&quot; width=&quot;647&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Configuring Salt Master:&lt;/h2&gt;&lt;br /&gt;No doubt that both the salt master should look identical in terms of configurations, data (states/pillar) available on them. But in its current form, SaltStack doesn’t provide any in-built functionalities for maintaining these salt masters in sync. So one will have to create their own setup for maintaining sync. Your best available bets right now are some combination of rsync and use of the salt stack to control the salt master, refer to &lt;a href=&quot;http://saurabhsurana.blogspot.com/2013/10/managing-salt-master-as-any-other-minion.html&quot; target=&quot;_blank&quot;&gt;this&lt;/a&gt; post.&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;~Thanks,
Saurabh

FWCAFX47R5GU&lt;/div&gt;</description><link>http://www.otechpad.com/2013/10/saltstack-multiple-salt-master-setup.html</link><author>noreply@blogger.com (Saurabh Surana)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/-6ljC43S0f7Y/U2YAi695MtI/AAAAAAAABFc/3K1fb3PYbO8/s72-c/MultiSaltMaster_thumb9.jpg?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1878358855636852054.post-2144862948632230925</guid><pubDate>Mon, 07 Oct 2013 06:21:00 +0000</pubDate><atom:updated>2014-05-09T19:40:32.024-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">OpenSource</category><category domain="http://www.blogger.com/atom/ns#">SaltStack</category><category domain="http://www.blogger.com/atom/ns#">Tricks</category><title>Managing salt master as minion</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;Although SaltStack provides a simplified approach to infrastructure management, one of the most critical pieces of the setup, Salt Master, needs to be managed in the same setup.&amp;nbsp; One of the challenges of maintaining/managing salt master is to be able to reproduce the same state of the salt master in case of failures or be able to manage multiple salt master maintain multiple salt master in identical configuration over a period of time.&lt;br /&gt;A simple trick for solving this problem would be to install a minion on the master itself and manage that salt minion just like any other node in the infrastructure. This will not only help us maintain the same state on multiple salt master but will also help us reproduce the state of the machine if required.&lt;br /&gt;The only risk I see in managing master as any other minion is to avoid managing salt-master service and if possible avoid managing salt master configuration file. Apart from these two things I think we should be able to manage any other thing on the salt master with salt stack.&lt;br /&gt;&lt;a href=&quot;http://lh4.ggpht.com/-jGn8VqcAobQ/U1yjFZ2iOnI/AAAAAAAABE8/2TxcwsyJOcM/s1600-h/TechSaga%25255B40%25255D.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;TechSaga&quot; border=&quot;0&quot; src=&quot;http://lh3.ggpht.com/-j0T43P8RvEA/U1yjF1DP66I/AAAAAAAABFE/xtoACvoVqtI/TechSaga_thumb%25255B36%25255D.jpg?imgmax=800&quot; height=&quot;286&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;&quot; title=&quot;TechSaga&quot; width=&quot;660&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;~Thanks,
Saurabh

FWCAFX47R5GU&lt;/div&gt;</description><link>http://www.otechpad.com/2013/10/managing-salt-master-as-any-other-minion.html</link><author>noreply@blogger.com (Saurabh Surana)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/-j0T43P8RvEA/U1yjF1DP66I/AAAAAAAABFE/xtoACvoVqtI/s72-c/TechSaga_thumb%25255B36%25255D.jpg?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1878358855636852054.post-8541605607017107888</guid><pubDate>Mon, 30 Sep 2013 00:53:00 +0000</pubDate><atom:updated>2014-05-01T00:18:46.192-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">OpenSource</category><category domain="http://www.blogger.com/atom/ns#">SaltStack</category><title>SaltStack Introduction</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;SaltStack is an awesome tool, can be used for Configuration Management, Remote Execution, Infrastructure Automation etc etc etc.&amp;nbsp; Moreover its OpenSource, very powerful, easily extendible, used by large organizations for managing huge infrastructure setups, what else you want.&amp;nbsp; Simply put its Just an AWSOME tool and its powers are beyond your expectation. The best thing I like about salt stack is if configured correctly, you never have to login to multiple machines, you always login into SaltMaster and from there you can pretty much control everything in your whole environment.&lt;br /&gt;Usually a SaltStack setup has one master and multiple minion in the setup. Salt Master has States and PIllar configured for every node in the infrastructure.&amp;nbsp; Every node in the infrastructure that needs to be managed by salt, has salt minion installed on it and is configured to talk to Salt Master. When a minion starts talking to master, minion presents it public RSA key to the master. If master accepts the key for the minion, it then starts identifying that minion with a specific id.&lt;br /&gt;&lt;h3&gt;State:&lt;/h3&gt;state is configuration in the yaml format, that defines what packages to be installed, what configuration files to be copied, or what services to be enabled/started, etc. Salt Stack has in build states for general purpose uses but for specific cases you an extend and add your own salt state. In the state file that we define on the salt master, we just configure these in build or custom defined states to suite to our needs. &lt;br /&gt;&lt;h3&gt;Pillar:&lt;/h3&gt;Salt Pillar is set of data that can be used to configure the state more effectively. Pillar can be data that might change over a period of time. Things like IP address of remote machines, credentials, Package Versions etc can be configured in pillar data. If you plan on using the same states on multiple environments, you can use the pillar data to configure things per environment. &lt;br /&gt;&lt;h3&gt;Modules:&lt;/h3&gt;SaltStack modules are set of commands that you can run on the minion to control it remotely. Modules are powerful and allow you to control every node in your infrastructure remotely from the master. You can use large set of in build salt modules, or can write your own.&lt;br /&gt;Salt has much more than only states or pillar. It has grains, which can be used to get more information about every minion and the configure your states/pillar accordingly. It has returners that allows you to grab the output of every salt commands.&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;~Thanks,
Saurabh

FWCAFX47R5GU&lt;/div&gt;</description><link>http://www.otechpad.com/2013/09/saltstack.html</link><author>noreply@blogger.com (Saurabh Surana)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1878358855636852054.post-7169841399725657310</guid><pubDate>Sun, 16 Jun 2013 21:06:00 +0000</pubDate><atom:updated>2014-05-09T19:37:46.667-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Cloud Computing</category><category domain="http://www.blogger.com/atom/ns#">OpenSource</category><category domain="http://www.blogger.com/atom/ns#">OpenStack</category><title>OpenStack : Authentication Model</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;OpenStack has multiple different services that work together to provide a end to end cloud computing experience.&lt;br /&gt;Keystone is an OpenStack project that provides Identity, Token, Catalog and Policy services for all the projects/services in OpenStack. &lt;br /&gt;Overall authentication process works like this:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;In order to use any of the OpenStack services user needs to first get a auth_token from the keystone service. User provides Credentials (Username/password) in the POST body to the Keystone Token Service. User after acquiring the token should be able to use the same token until the specified token validity period (Most of the OpenStack CLI exploit this and instead of storing the token they will always go back to the keystone and get a new token for every cli command, but if you are writing the script, you can optimize this, as the standard token validity is at least few hours). If you want to see the token you can use ‘nova credentials’ cli call to get a token and check its validity etc.  &lt;/li&gt;&lt;li&gt; Once user gets the token from Keystone, this same token will be used in all the subsequent calls to any of the OpenStack Services. The token goes in the request header “X-Auth-Token”.  &lt;/li&gt;&lt;li&gt;Service API layer then extracts this token and validates this token with keystone and ensures that token is not expired and it was issued to the correct tenant who has made the API call &lt;/li&gt;&lt;li&gt;In many cases where one OpenStack service needs to talk to other OpenStack service to complete the user action (like Nova talking to Cinder while creating a instance with volume etc) will use the same token that it extracted from user’s request header, and will pass on that header in the request to the next service. &lt;/li&gt;&lt;li&gt;The next service will against validate this token with keystone.&lt;/li&gt;&lt;/ol&gt;&lt;a href=&quot;http://lh3.ggpht.com/-xNzIXLjDN_4/U21EgLHBLqI/AAAAAAAABGI/8sHfjmWKEOw/s1600-h/TechSaga-OpenStack-Auth-Model%25255B5%25255D.jpg&quot;&gt;&lt;img alt=&quot;TechSaga-OpenStack-Auth-Model&quot; border=&quot;0&quot; src=&quot;http://lh5.ggpht.com/-XCZIpaYOzoo/U21Eg9UosII/AAAAAAAABGQ/qYeRyks8mfg/TechSaga-OpenStack-Auth-Model_thumb%25255B3%25255D.jpg?imgmax=800&quot; height=&quot;437&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; margin-right: auto;&quot; title=&quot;TechSaga-OpenStack-Auth-Model&quot; width=&quot;660&quot; /&gt;&lt;/a&gt;  &lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;~Thanks,
Saurabh

FWCAFX47R5GU&lt;/div&gt;</description><link>http://www.otechpad.com/2013/06/openstack-authentication-model.html</link><author>noreply@blogger.com (Saurabh Surana)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/-XCZIpaYOzoo/U21Eg9UosII/AAAAAAAABGQ/qYeRyks8mfg/s72-c/TechSaga-OpenStack-Auth-Model_thumb%25255B3%25255D.jpg?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1878358855636852054.post-5100719535536267803</guid><pubDate>Mon, 13 May 2013 06:27:00 +0000</pubDate><atom:updated>2014-05-09T19:38:33.011-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Cloud Computing</category><category domain="http://www.blogger.com/atom/ns#">OpenStack</category><category domain="http://www.blogger.com/atom/ns#">Security</category><title>Openstack Nova Instance Security Group</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Once you create a instance with Openstack nova, now you need a way to access that instance. &lt;br /&gt;A Security group is sort of a local firewall for your nova instance (behind the scene it is a set of iptable rules on the compute host). It lets you configure access to your instance with the help of REST API, where you can define the inbound access &lt;br /&gt;&lt;ul&gt;&lt;li&gt;To individual port or range of port  &lt;/li&gt;&lt;li&gt;For a particular network protocol (tcp, udp, icmp etc)  &lt;/li&gt;&lt;li&gt;From a network CIDR (a single IP address or a range of IP address&lt;/li&gt;&lt;/ul&gt;For the Ubuntu instances we booted in &lt;a href=&quot;http://saurabhsurana.blogspot.com/2013/04/creating-instance-on-openstack.html&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;, we will enable SSH access to this instance with the help of security group added to the instance. Security group that is associated with the instance can be identified with ‘&#39;nova show’ command, this lists all the attribute of the nova instance.&lt;br /&gt;Once you have security group associated with the instance, there are security group rules command to help you manage the group. To enable SSH access, we will have to enable access to port 22 and&amp;nbsp; TCP protocol.&amp;nbsp; &lt;br /&gt;&lt;blockquote&gt;&lt;pre class=&quot;csharpcode&quot;&gt;$ nova secgroup-add-rule dev tcp 22 22 10.20.4.29/32&lt;br /&gt;+-------------+-----------+---------+---------------+--------------+&lt;br /&gt;| IP Protocol | From Port | To Port | IP Range      | Source Group |&lt;br /&gt;+-------------+-----------+---------+---------------+--------------+&lt;br /&gt;| tcp         | 22        | 22      | 10.20.4.29/32 |              |&lt;br /&gt;+-------------+-----------+---------+---------------+--------------+&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;This will enable access to port 22 from IP address 10.20.4.29. Instead of a single IP, one can specify a range with the help of correct CIDR to allow access from a specific network.&lt;br /&gt;&lt;br /&gt;Security group is a very good way of controlling access to your instances which run in the open stack cloud, and one should really lock these rules down to only what is essentially required. Like open access only from your network and try to avoid using CIDR 0.0.0.0/0 which allows access from anywhere. &lt;br /&gt;&lt;br /&gt;For production services, it is always advisable to also consider using iptables on your local nova instances. Security groups although being a set of iptables, they are applied on the compute host and not directly on your instance. &lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;~Thanks,
Saurabh

FWCAFX47R5GU&lt;/div&gt;</description><link>http://www.otechpad.com/2013/05/openstack-nova-instance-security-group.html</link><author>noreply@blogger.com (Saurabh Surana)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1878358855636852054.post-4216854927780505224</guid><pubDate>Sun, 28 Apr 2013 18:51:00 +0000</pubDate><atom:updated>2014-05-09T19:39:50.505-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">OpenStack</category><title>Creating instance on OpenStack</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;After you get your nova/OpenStack account, the first thing that you would want to do is create/boot a cloud instance in that account. &lt;br /&gt;Here are the steps that will help you in creating your first OpenStack/nova instance: &lt;br /&gt;&lt;h4&gt;Selecting the image to boot your instance from:&lt;/h4&gt;In order to create a nova instance we will need to specify the OS image that we want to boot/create the instance from. Usually you should have some (public) images available on nova, image-list should list the available images, from this list you can pick the image of your choice: &lt;br /&gt;&lt;blockquote&gt;&lt;pre class=&quot;csharpcode&quot;&gt;$ nova image-list&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;+--------+--------------------------------------------------+--------+---------+&lt;br /&gt;| ID     | Name                                             | Status | Server  |&lt;br /&gt;+--------+--------------------------------------------------+--------+---------+&lt;br /&gt;| 54021  | CentOS 5.8 Server                                | ACTIVE |         |&lt;br /&gt;| 78265  | Debian Squeeze 6.0.3 Server 64-&lt;span class=&quot;kwrd&quot;&gt;bit&lt;/span&gt;               | ACTIVE |         |&lt;br /&gt;| 209316 | Fedora 18 Server 64-&lt;span class=&quot;kwrd&quot;&gt;bit&lt;/span&gt;                          | ACTIVE |         |&lt;br /&gt;| 80812  | Ubuntu Precise 12.04 LTS Server 64-&lt;span class=&quot;kwrd&quot;&gt;bit&lt;/span&gt;           | ACTIVE |         |&lt;br /&gt;| 190306 | Ubuntu Quantal 12.10 Server 64-&lt;span class=&quot;kwrd&quot;&gt;bit&lt;/span&gt;               | ACTIVE |         |&lt;br /&gt;| 367479 | Ubuntu Raring 13.04 Server 64-&lt;span class=&quot;kwrd&quot;&gt;bit&lt;/span&gt;                | ACTIVE |         |&lt;br /&gt;+--------+--------------------------------------------------+--------+---------+ &lt;/pre&gt;&lt;/blockquote&gt;&lt;h4&gt;Selecting the key_name: &lt;/h4&gt;After the instance is created, for being able to ssh into the instance, we should specify the key_name with which the instance should be booted. keypair-list should give list of existing keys available on nova, while choosing the key name from the list, make sure that you have the private key for that:&lt;br /&gt;&lt;blockquote&gt;&lt;pre class=&quot;csharpcode&quot;&gt;$ nova keypair-list&lt;br /&gt;+-------------------+------------------------------------------------------------+&lt;br /&gt;| Name              | Fingerprint                                                |&lt;br /&gt;+-------------------+------------------------------------------------------------+&lt;br /&gt;| dev               | 75:56:d7:06:49:33:53:8a:bb:9e:03:34:6c:56:34:12            |&lt;br /&gt;+-------------------+------------------------------------------------------------+&lt;/pre&gt;&lt;/blockquote&gt;&lt;h4 align=&quot;left&quot;&gt;Selecting Security Group: &lt;/h4&gt;After When Instance is running, there should be a security group associated with the instance that defines the access for instance. Nova Security Group is set of rules that defines port access from set of IP range. SecGroup-List should show the list of security groups available on nova.&lt;br /&gt;&lt;blockquote&gt;&lt;pre class=&quot;csharpcode&quot;&gt;$ nova secgroup-list&lt;br /&gt;+----------+-------------+&lt;br /&gt;| Name     | Description |&lt;br /&gt;+----------+-------------+&lt;br /&gt;| default  | default     |&lt;br /&gt;| dev      | dev         |&lt;br /&gt;+----------+-------------+&lt;/pre&gt;&lt;/blockquote&gt;&lt;h4&gt;Selecting Instance Flavor: &lt;/h4&gt;While starting a new instance we have to specify the flavor, which defines the resources (CPU, Memory, Disk etc) for the instance being started. Choose your flavor type wisely, this the settings that defines the cost of your instance.&lt;br /&gt;&lt;blockquote&gt;&lt;pre class=&quot;csharpcode&quot;&gt;$ nova flavor-list&lt;br /&gt;+-----+--------------------+--------------+------+-------------+------+---------+&lt;br /&gt;| ID  | Name               | Memory_MB    | &lt;span class=&quot;kwrd&quot;&gt;Disk&lt;/span&gt; | Ephemeral   | Swap | VCPUs   | &lt;br /&gt;+-----+--------------------+--------------+------+-------------+------+---------+&lt;br /&gt;| 100 | standard.xsmall    | 1024         | 30   | N/A         | 0    | 1       |  &lt;br /&gt;| 101 | standard.small     | 2048         | 60   | N/A         | 0    | 2       |  &lt;br /&gt;| 102 | standard.medium    | 4096         | 120  | N/A         | 0    | 2       |  &lt;br /&gt;| 103 | standard.&lt;span class=&quot;kwrd&quot;&gt;large&lt;/span&gt;     | 8192         | 240  | N/A         | 0    | 4       | &lt;br /&gt;| 104 | standard.xlarge    | 16384        | 480  | N/A         | 0    | 4       | &lt;br /&gt;| 105 | standard.2xlarge   | 32768        | 960  | N/A         | 0    | 8       |&lt;br /&gt;+-----+--------------------+--------------+------+------------+------+----------+&lt;/pre&gt;&lt;/blockquote&gt;Now since we have identified minimum items that we needs, lets start with booting a instance. ‘nova boot` command on nova will take these parameters and will start a nova instance with those settings.&lt;br /&gt;&lt;blockquote&gt;&lt;pre class=&quot;csharpcode&quot;&gt;$ nova boot --flavor 101 --image 75845  --security_group dev  --key_name dev Dev&lt;br /&gt;+------------------+------------------------------------------------------------+&lt;br /&gt;| Property         | Value                                                      |&lt;br /&gt;+------------------+------------------------------------------------------------+&lt;br /&gt;| image            | Ubuntu Precise 12.04 LTS Server 64-bit                     |&lt;br /&gt;| flavor           | standard.small                                             |&lt;br /&gt;| id               | 1923229                                                    |&lt;br /&gt;| security_groups  | [{u&lt;span class=&quot;str&quot;&gt;&#39;name&#39;&lt;/span&gt;: u&lt;span class=&quot;str&quot;&gt;&#39;dev&#39;&lt;/span&gt;,  u&lt;span class=&quot;str&quot;&gt;&#39;links&#39;&lt;/span&gt;:                              |&lt;br /&gt;|                  | [{u&lt;span class=&quot;str&quot;&gt;&#39;href&#39;&lt;/span&gt;: u&lt;span class=&quot;str&quot;&gt;&#39;http://192.168.1.1/v1.1/1234/os-security-groups/314739&#39;&lt;/span&gt;,|   &lt;br /&gt;|                  |   u&lt;span class=&quot;str&quot;&gt;&#39;rel&#39;&lt;/span&gt;: u&lt;span class=&quot;str&quot;&gt;&#39;bookmark&#39;&lt;/span&gt;}], u&lt;span class=&quot;str&quot;&gt;&#39;id&#39;&lt;/span&gt;: 314739}]                   |&lt;br /&gt;| user_id          | 4567                                                       |&lt;br /&gt;| uuid             | c5de77e2-5e0a-4cf1-827e-dc92e5af4cb9                       |  &lt;br /&gt;| accessIPv4       |                                                            |&lt;br /&gt;| accessIPv6       |                                                            |&lt;br /&gt;| metadata         | {}                                                         |&lt;br /&gt;| status           | BUILD(scheduling)                                          |&lt;br /&gt;| updated          | 2013-07-20T18:39:26Z                                       |&lt;br /&gt;| hostId           |                                                            |&lt;br /&gt;| key_name         | dev                                                        |&lt;br /&gt;| name             | Dev                                                        |&lt;br /&gt;| created          | 2013-07-20T18:39:26Z                                       |&lt;br /&gt;| tenant_id        | 1234                                                       |&lt;br /&gt;| adminPass        | bYUcg4vSArNqfEZT                                           |&lt;br /&gt;| config_drive     |                                                            |&lt;br /&gt;+------------------+-------------------------------------------------------------+&lt;/pre&gt;&lt;/blockquote&gt;When we do nova list we can see the instance status the other details like IP address&lt;span style=&quot;font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre class=&quot;csharpcode&quot;&gt;$ nova list&lt;br /&gt;+---------+-----------+----------+--------------------------------------------+&lt;br /&gt;| ID      | Name      | Status   | Networks                                   |&lt;br /&gt;+---------+-----------+----------+--------------------------------------------+&lt;br /&gt;| 1923229 | Dev       | ACTIVE   | private=10.4.45.149, 15.185.126.57         |&lt;br /&gt;+---------+-----------+----------+--------------------------------------------+&lt;/pre&gt;&lt;/blockquote&gt;Nova list will list the instance and other details like status and network. Network will list the IP address with which you can access/reach this instance. There are usually two IP addresses listed in nova list output, first one is the private IP (accessible only within the network) and the second one is public IP, accessible over internet. If you have a floating IP assigned to the instance that will be the third IP in that list. When instance status is ACTIVE, at this time we can try login to the instance, with a SSH session. If you are in the same network as that of the instance, you might be able to use the private IP, but if you are reaching this over internet choose the public IP.&lt;br /&gt;&lt;blockquote&gt;&lt;pre class=&quot;csharpcode&quot;&gt;$ ssh –i &amp;lt;&lt;span class=&quot;kwrd&quot;&gt;Path&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;of&lt;/span&gt; SSH Private &lt;span class=&quot;kwrd&quot;&gt;Key&lt;/span&gt;&amp;gt; &lt;a href=&quot;mailto:ubuntu@15.185.126.57&quot;&gt;ubuntu@15.185.126.57&lt;/a&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;~Thanks,
Saurabh

FWCAFX47R5GU&lt;/div&gt;</description><link>http://www.otechpad.com/2013/04/creating-instance-on-openstack.html</link><author>noreply@blogger.com (Saurabh Surana)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1878358855636852054.post-5648813186926208392</guid><pubDate>Sun, 21 Apr 2013 04:18:00 +0000</pubDate><atom:updated>2014-04-26T15:44:34.031-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">OpenStack</category><category domain="http://www.blogger.com/atom/ns#">Trove</category><title>Using Nova CLI</title><description>&lt;div style=&quot;text-align: left&quot; dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;For installing nova client, we need pip installed on the machine. (For installing pip ) &lt;br&gt; &lt;blockquote&gt;&lt;pre class=&quot;csharpcode&quot;&gt;$ pip install python-novaclient&lt;/pre&gt;&lt;/blockquote&gt;&lt;b&gt;Using Environment Variables:&lt;/b&gt;&lt;br&gt;&lt;!--CRLF--&gt;&lt;br&gt;After nova client is installed, export following environment variables to help point CLI to correct endpoints with required credentials&lt;br&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre class=&quot;csharpcode&quot;&gt;export OS_PASSWORD=demo_password&lt;br&gt;export OS_AUTH_URL=http://10.9.128.184:5000/v2.0&lt;br&gt;export OS_USERNAME=demo&lt;br&gt;export OS_TENANT_NAME=demo&lt;/pre&gt;&lt;/blockquote&gt;If your credentials and URL is correct then at this stage you should be able to at least get a valid token back: &lt;br&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span style=&quot;font-size: x-small&quot;&gt;$ nova credentials&lt;br&gt;+------------------+-----------------------------------------------------------+&lt;br&gt;| User Credentials | Value                                                     |&lt;br&gt;+------------------+-----------------------------------------------------------+&lt;br&gt;| id               | 4330bcb01bbb45c8af382b72a1f46fff                          |&lt;br&gt;| name             | admin                                                     |&lt;br&gt;| roles            | [{&lt;span class=&quot;str&quot;&gt;&quot;name&quot;&lt;/span&gt;: &lt;span class=&quot;str&quot;&gt;&quot;demo&quot;&lt;/span&gt;}, {&quot;name&quot;: &quot;member&quot;}, {&lt;span class=&quot;str&quot;&gt;&quot;name&quot;&lt;/span&gt;: &lt;span class=&quot;str&quot;&gt;&quot;demo&quot;&lt;/span&gt;}]  |&lt;br&gt;| roles_links      | []                                                        |&lt;br&gt;| username         | admin                                                     |&lt;br&gt;+------------------+-------------------------------------------------------- --+&lt;br&gt;+-----------+------------------------------------------------------------------+&lt;br&gt;| Token     | Value                                                            |&lt;br&gt;+-----------+------------------------------------------------------------------+&lt;br&gt;| expires   | 2013-04-21T05:05:55Z                                             |&lt;br&gt;| id        | MIIQQwYJKoZIhvcNAQcCoIIQNDCCEDACAQExCTAHBgUrDgMCGjCCDpkGCSqGSIb3 |&lt;br&gt;............&lt;br&gt;|           | WqY8IykYMUIn8zLkOUP0U68noC8GN3XqnBnbWJdKc31On3aI3NnrGNI          |&lt;br&gt;| issued_at | 2013-04-21T04:05:55.189632                                       |&lt;br&gt;| tenant    | {&lt;span class=&quot;str&quot;&gt;&quot;enabled&quot;&lt;/span&gt;: &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&quot;description&quot;&lt;/span&gt;: &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&quot;name&quot;&lt;/span&gt;: &lt;span class=&quot;str&quot;&gt;&quot;demo&quot;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&quot;id&quot;&lt;/span&gt;:     |&lt;br&gt;|           | &lt;span class=&quot;str&quot;&gt;&quot;31afefb2955b4575aea1ccb4729380ea&quot;&lt;/span&gt;}                              |&lt;br&gt;+-----------+------------------------------------------------------------------+&lt;/span&gt;&lt;/pre&gt;&lt;/blockquote&gt;From this above output you will get details about your account. User ID, Roles, Tenant ID, and Authentication Token (which will be used while talking to other Openstack services like nova-api, cinder etc&lt;br&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;~Thanks, Saurabh FWCAFX47R5GU&lt;/div&gt;  &lt;div class=&quot;blogger-post-footer&quot;&gt;~Thanks,
Saurabh

FWCAFX47R5GU&lt;/div&gt;</description><link>http://www.otechpad.com/2013/04/using-nova-cli.html</link><author>noreply@blogger.com (Saurabh Surana)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1878358855636852054.post-4822243130763449122</guid><pubDate>Mon, 30 Jan 2012 18:23:00 +0000</pubDate><atom:updated>2012-04-29T13:23:59.124-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Amazon</category><category domain="http://www.blogger.com/atom/ns#">Cloud Computing</category><category domain="http://www.blogger.com/atom/ns#">EC2</category><title>Amazon RDS</title><description>&lt;div style=&quot;text-align: left&quot; dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;&amp;nbsp; &lt;br&gt;Amazon RDS allows us to quickly create a relational database instance and flexibly scale the associated compute resources and storage capacity to meet our application demand. Amazon RDS manages the database instance on our behalf by performing backups, handling failover, and maintaining the database software. By using Amazon RDS we offload DB management tasks(resizing, replication, patch management) to Amazon who maintain network infrastructure and datacenters, leveraging the same industry-leading practices and procedures that keep web properties running optimally.&lt;br&gt;&lt;br&gt;&lt;b&gt;Security:&lt;/b&gt; &lt;br&gt;By default all the ports to Amazon RDS are blocked and we can provide authorized access from certain specific list of IP addresses to the RDS port. It also support SSL connection to encrypt the traffic between the Database server and client. Moreover RDS can be hosted inside the VPC. Slightly annoying feature for RDS that, at the time of creation it ask for master username and password, but that account is really not a root account for database and still has slightly stricter permission that default root on locally install RDS.&lt;br&gt;&lt;br&gt;&lt;b&gt;Reliability and Backup:&lt;/b&gt; &lt;br&gt;Amazon&#39;s Multi-AZ deployment model that enhances database availability while protecting our latest database updates against unplanned outages. When we create or modify our DB Instance to run as a Multi-AZ deployment, Amazon RDS automatically provision and manage a “standby” replica in a different Availability Zone (independent infrastructure in a physically separate location, but in the same region). Database updates are made concurrently on the primary and standby resources to prevent replication lag. In the event of planned database maintenance, DB Instance failure, or an Availability Zone failure, Amazon RDS automatically failover to the up-to-date standby so that database operations can resume quickly without administrative intervention.&lt;br&gt;&lt;br&gt;&lt;b&gt;What makes it tempting:&lt;/b&gt;&lt;br&gt; &lt;ul style=&quot;text-align: left&quot;&gt; &lt;li&gt;Automatic backup : You can configure the backup retention policy in terms of days. &lt;li&gt;Choice of backup/maintenance window: You can choose, to select the backup and maintain windows for your DB instance, such that those operations will be performed in that window to ensure the uptime of your service.&lt;/li&gt;&lt;/ul&gt;This information can be updated without restarting the Amazon RDS DB instance, thus giving us 24/7 availability &amp;amp; seamless control of the database access. Amazon RDS generates an SSL certificate for each DB Instance, thus allowing us to encrypt the DB Instance connections for enhanced security. &lt;br&gt;At the time of deletion, the DB Instance is marked for deletion and once the instance no longer indicates ‘deleting’ status, it has been removed. At this point the instance is no longer accessible and unless a final snapshot copy was asked for, it cannot be restored and will not be listed by any of the tools or APIs.&lt;br&gt;&lt;br&gt;Amazon RDS hosted on cloud will always serve traffic originating from Amazon VPC (Virtual private cloud). Amazon VPC allows us to provision a private, isolated section of the Amazon Web Services (AWS) Cloud where we will launch AWS resources in a virtual defined network. With Amazon VPC, we can define a virtual network topology that closely resembles a traditional network which anyone can operate in their own datacenter. By doing this, we gain complete control over our virtual networking environment, including selection of our own IP address range, creation of subnets, and configuration of route tables and network gateways.&lt;br&gt;&lt;br&gt;For example, we have a public-facing subnet for Expressway Service Gateway (ESG) which serve legitimate traffic with mutual authentication mechanism from the Internet, and place our backend systems such as tenant-manager and tenants hosted on boot strap agents on a private-facing subnet with no Internet access. We leverage multiple layers of security, including security groups and network access control lists, to help control access to Amazon EC2 instances in each subnet. Any traffic originating from this point (either via tenant-manager or tenants) will be redirected to RDS via Amazon VPC internet gateway over https channel.&lt;br&gt;&lt;br&gt;Using Amazon Cloud Watch we can monitor activities on Amazon RDS. Amazon Cloud Watch provides monitoring for AWS cloud resources and the applications we run on AWS. System administrator can use it to collect and track metrics, gain insight, and react immediately to keep our applications and businesses running smoothly. Administrator can also monitor custom metrics generated by RDS. With Amazon Cloud Watch, we gain system-wide visibility into resource utilization, application performance, and operational health status of RDS. &lt;br&gt;Links for reference: &lt;br&gt;&lt;a href=&quot;http://aws.amazon.com/rds/&quot;&gt;http://aws.amazon.com/rds/&lt;/a&gt; &lt;br&gt;&lt;a href=&quot;http://docs.amazonwebservices.com/AmazonVPC/latest/UserGuide/VPC_Scenario2.html&quot;&gt;http://docs.amazonwebservices.com/AmazonVPC/latest/UserGuide/VPC_Scenario2.html&lt;/a&gt; &lt;br&gt;&lt;a href=&quot;http://d36cz9buwru1tt.cloudfront.net/AWS_Running_Databases_in_the_Cloud.pdf&quot;&gt;http://d36cz9buwru1tt.cloudfront.net/AWS_Running_Databases_in_the_Cloud.pdf&lt;/a&gt; &lt;br&gt;&lt;a href=&quot;http://aws.amazon.com/rds/#features&quot;&gt;http://aws.amazon.com/rds/#features&lt;/a&gt;&lt;/div&gt;  &lt;div class=&quot;blogger-post-footer&quot;&gt;~Thanks,
Saurabh

FWCAFX47R5GU&lt;/div&gt;</description><link>http://www.otechpad.com/2012/01/amazon-rds.html</link><author>noreply@blogger.com (Saurabh Surana)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1878358855636852054.post-7382963468464093193</guid><pubDate>Sun, 15 Jan 2012 17:30:00 +0000</pubDate><atom:updated>2012-04-29T13:26:07.274-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Amazon</category><category domain="http://www.blogger.com/atom/ns#">Cloud Computing</category><category domain="http://www.blogger.com/atom/ns#">EC2</category><title>Amazon VPC</title><description>&lt;p&gt;Amazon offers VPC service which allows having a private subnet in the cloud. Although the main feature of this service is ability to setup a VPN between cloud and on premise network, ability to setup a private network is a feature we cannot ignore.  &lt;p&gt;There are 4 different VPC flavors offered by EC2, mainly differentiated on the basis of Public or Private Subnet.  &lt;p&gt;&lt;strong&gt;Public Subnet :&amp;nbsp; &lt;/strong&gt;A public subnet is the one which hosts instances which are directly addressable over internet (when an Elastic IP is associated with them), and these instances also can access internet directly without any proxy or gateway.  &lt;p&gt;&lt;strong&gt;Private Subnet : A&lt;/strong&gt; private subject is one where instances are not addressable over internet. These instances in turn can not directly accesses internet. If internet access is required it can only be done through a NATed gateway instance which resides in Public subnet or through a internet gateway which resides in the remote network (with which VPN is setup).  &lt;p&gt;&amp;nbsp; &lt;p&gt;&lt;strong&gt;&lt;font size=&quot;3&quot;&gt;VPC with a Single Public Subnet Only:&lt;/font&gt;&lt;/strong&gt;  &lt;p&gt;This allows one to host a VPC with a public network. Such that all the instances will be directly accessible over internet (if assigned an EIP), and in turn can have direct connection to internet.  &lt;p&gt;One can use this option If  &lt;ol&gt; &lt;li&gt;Service is to be hosted on the same/private subnet  &lt;li&gt;You need ability to choose the IP address for your instances&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&lt;strong&gt;&lt;font size=&quot;3&quot;&gt;VPC with Public and Private Subnets&lt;/font&gt;&lt;/strong&gt;  &lt;p&gt;This one is useful when you need to deploy a multi layer application, such that your presentation tier (web server etc) is hosted in the public subnet such that its accessible over public internet, and remaining middle and data tier is hosted on the private subnet such that only internal components (on private subnet) presentation tier has access to it, providing much needed security on a publicly deployed system. This is the most useful architecture/flavor which will be used for application deployment in cloud.  &lt;p&gt;&lt;strong&gt;&lt;font size=&quot;3&quot;&gt;VPC with Public and Private Subnets and Hardware VPN Access&lt;/font&gt;&lt;/strong&gt;  &lt;p&gt;This one is useful when a service to be deployed depends on a VPN access to lets say an on premises setup (lets say hosting LDAP which is needed for Authentication/Authorization in the publicly deployed application).  &lt;p&gt;&lt;strong&gt;&lt;font size=&quot;3&quot;&gt;VPC with a Private Subnet Only and Hardware VPN Access&lt;/font&gt;&lt;/strong&gt;  &lt;p&gt;This is useful when a cloud setup is to be used for things like backup/processing, and mainline services like backend etc are hosted on premise and connected using a VPN to the cloud setup. Lets say cloud setup is used for testing on wide range of platforms, but all necessary backend are hosted on premise.&lt;/p&gt;  &lt;div class=&quot;blogger-post-footer&quot;&gt;~Thanks,
Saurabh

FWCAFX47R5GU&lt;/div&gt;</description><link>http://www.otechpad.com/2012/01/amazon-vpc.html</link><author>noreply@blogger.com (Saurabh Surana)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1878358855636852054.post-3907182178768731671</guid><pubDate>Sun, 17 Jul 2011 03:00:00 +0000</pubDate><atom:updated>2011-07-16T22:02:10.436-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tricks</category><category domain="http://www.blogger.com/atom/ns#">Windows</category><title>Get MD5 sum on Windows 2008</title><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Windows doesn’t have inbuilt tools or commands to get MD5 sum. But Microsoft provides a tool that you can use on windows to get MD5 sum for any file.&lt;/p&gt; &lt;p&gt;You can download File Checksum Integrity Verifier (FCIV) utility from &lt;a href=&quot;http://support.microsoft.com/kb/841290&quot;&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Download and extract this utility to C:\Tools and use following commands to get the MD5 sum:&lt;/p&gt; &lt;p&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;strong&gt;C:\Tools&amp;gt;fciv.exe –add sample.zip -md5&lt;/strong&gt;&lt;/font&gt; &lt;p&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;strong&gt;// File Checksum Integrity Verifier version 2.05.&lt;/strong&gt;&lt;/font&gt; &lt;p&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;strong&gt;9f14f0605d0fa5c21b83e972394f50db sample.zip &lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;div class=&quot;blogger-post-footer&quot;&gt;~Thanks,
Saurabh

FWCAFX47R5GU&lt;/div&gt;</description><link>http://www.otechpad.com/2011/07/get-md5-sum-on-windows-2008.html</link><author>noreply@blogger.com (Saurabh Surana)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1878358855636852054.post-5105791024713628582</guid><pubDate>Wed, 15 Jun 2011 20:56:00 +0000</pubDate><atom:updated>2011-07-13T23:52:05.419-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ADFS</category><category domain="http://www.blogger.com/atom/ns#">Federated Identity</category><category domain="http://www.blogger.com/atom/ns#">Identity Federation</category><category domain="http://www.blogger.com/atom/ns#">Security</category><title>Identity Federation</title><description>&lt;blockquote&gt;&lt;/blockquote&gt;Federating an individual’s or an entity’s identity in order to facilitate Single sign-on across intranet site or across multiple domains, achieved by setting up required trust relationships between the Identity provide and service provider.&lt;br /&gt;Identity provider is an entity which stores the identity (authentication and authorization) information for the users. So every time user wants to access a services, instead of providing the authentication parameters (username password, certificates, tokens) directly to the service, its provided to the identity provider which host this information. On successful authentication, Idp provides an security token to the user which he can take it to the service. Service instead of authenticating the user, tries to validate the token and makes sure that it is issued by the authority which is trusted by the service. If token found legitimate, it grants the access to the user.&lt;br /&gt;Lets look at a real life example of this federation scenario; lets say you go to a car rental company. Obviously car rental company will never ask you to prove yourself that you can drive the car, because it trusts DMV for doing that, so it asks you to go to DMV for verifying that you can drive. When you go to DMV, it tests your driving skill and if found eligible, issues an Driver’s License, which is nothing but your proof that you know driving and the rules of the road. When you go to a car rental company it will never ask you about your ability of driving but will just validate the Driving license.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://lh5.ggpht.com/-vY1hONph4SE/Th50vc5l7sI/AAAAAAAAA3k/rc0WgggftTs/s1600-h/image14.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;260&quot; src=&quot;http://lh6.ggpht.com/-YUSFcNAy6H8/Th50wXaCwXI/AAAAAAAAA3o/FoFt-9gcPgs/image_thumb10.png?imgmax=800&quot; style=&quot;background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;image&quot; width=&quot;394&quot; /&gt;&lt;/a&gt;&lt;br /&gt;In this example you would see that, Car Rental trusts DMV for verifying an individual’s ability to drive. This way both Car Rental Company and DMV does what they do best, one rents the car to the driver’s who need it and one verifies the individual’s ability to drive. More over, the License issued by the DMV has many more attribute and also used an an Identity Proof, so it is used to validate a user for multiple services.&lt;br /&gt;&lt;br /&gt;See following Kapsule for more details&lt;br /&gt;&lt;br /&gt;&lt;object classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; height=&quot;390&quot; width=&quot;550&quot;&gt;   &lt;param name=&quot;movie&quot; value=&quot;http://beta.kpointbeta.com/kpoint/player/KWebPlayerUI.swf&quot;&gt;&lt;/param&gt;&lt;param name=&quot;quality&quot; value=&quot;high&quot;&gt;&lt;/param&gt;&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot; /&gt;  &lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;param name=&quot;bgcolor&quot; value=&quot;#000000&quot;&gt;&lt;/param&gt;&lt;param name=&quot;FlashVars&quot; value=&quot;startlayout=S&amp;startpaused=true&amp;enablejsapi=false&amp;startinteract=true&amp;token=WvabtnKvGm2QItgwBXDnaazh1eL6hUXZKrIYQ2deCvv0vLPywWvk8ZzO6PRMQBTttTJ4JDmFt1ETTuW2Qe_etCEkfsQxYwTMPtb3nk0VftiH8T2R9gOBnrmuQ3CcGr2X_5Bzz56dkFQpoxZ34KM4R9x_hZu38yFlkD0Y_QmLpDfNSNLzE9JOIgwx539pFsPriNb7WPvaeELkAyMv2LVAS5U6ldZnoRRa6sjzg_Grwxm5QpNgrvYUQzeHd661yHZ3hyyI2Q4Qx88kQ2YZeDwQwWFJbWcn1Hlp1igapP0V9_rWXZxzOeXbSdZ6pdXKK2vrUQV5uU2rDjITcIwpG8536VOggC/CxwxoC5sJHM9S75VKAWANr87172rfVoS2Tt2J&amp;vsrc=em&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://beta.kpointbeta.com/kpoint/player/KWebPlayerUI.swf&quot; quality=&quot;high&quot; bgcolor=&quot;#000000&quot; width=&quot;550&quot; height=&quot;390&quot; align=&quot;middle&quot; play=&quot;false&quot; loop=&quot;false&quot; quality=&quot;high&quot; allowFullScreen=&quot;true&quot; allowScriptAccess=&quot;always&quot; wmode=&quot;transparent&quot; FlashVars=&quot;startlayout=S&amp;startpaused=true&amp;enablejsapi=false&amp;startinteract=true&amp;token=WvabtnKvGm2QItgwBXDnaazh1eL6hUXZKrIYQ2deCvv0vLPywWvk8ZzO6PRMQBTttTJ4JDmFt1ETTuW2Qe_etCEkfsQxYwTMPtb3nk0VftiH8T2R9gOBnrmuQ3CcGr2X_5Bzz56dkFQpoxZ34KM4R9x_hZu38yFlkD0Y_QmLpDfNSNLzE9JOIgwx539pFsPriNb7WPvaeELkAyMv2LVAS5U6ldZnoRRa6sjzg_Grwxm5QpNgrvYUQzeHd661yHZ3hyyI2Q4Qx88kQ2YZeDwQwWFJbWcn1Hlp1igapP0V9_rWXZxzOeXbSdZ6pdXKK2vrUQV5uU2rDjITcIwpG8536VOggC/CxwxoC5sJHM9S75VKAWANr87172rfVoS2Tt2J&amp;vsrc=em&quot; type=&quot;application/x-shockwave-flash&quot; pluginspage=&quot;http://www.adobe.com/go/getflashplayer&quot; swliveconnect=&quot;true&quot;&gt;     &lt;/embed&gt; &lt;/object&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;~Thanks,
Saurabh

FWCAFX47R5GU&lt;/div&gt;</description><link>http://www.otechpad.com/2011/06/identity-federation.html</link><author>noreply@blogger.com (Saurabh Surana)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/-YUSFcNAy6H8/Th50wXaCwXI/AAAAAAAAA3o/FoFt-9gcPgs/s72-c/image_thumb10.png?imgmax=800" height="72" width="72"/><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1878358855636852054.post-5800351991846600793</guid><pubDate>Tue, 01 Mar 2011 05:00:00 +0000</pubDate><atom:updated>2011-07-14T00:00:31.552-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tricks</category><category domain="http://www.blogger.com/atom/ns#">Windows</category><title>Simple Password on Windows 2008</title><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Windows 2008 by default needs a complex password. Here is how you can disable that setting and use your own favorite password. &lt;/p&gt; &lt;p&gt;I think its always good to have complex password set, but in your test/lab environment if you cannot use use simple password that drives me crazy and I hate when I have to remember multiple password for my lab machines.&lt;/p&gt; &lt;p&gt;So this work around should only be used for non-production/non-publically hosted machines, and of course it’s a workaround so not a recommended setting at all.&lt;/p&gt; &lt;p&gt;&lt;a href=&quot;http://lh3.ggpht.com/-2iSXMMksYqk/Th53bVl_SSI/AAAAAAAAA3s/Az58FU_tOTI/s1600-h/image9.png&quot;&gt;&lt;img style=&quot;background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh3.ggpht.com/-f8N8BvgTuIA/Th53hZTfNLI/AAAAAAAAA3w/IYy-N9OA6Fk/image_thumb7.png?imgmax=800&quot; width=&quot;693&quot; height=&quot;521&quot;&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class=&quot;blogger-post-footer&quot;&gt;~Thanks,
Saurabh

FWCAFX47R5GU&lt;/div&gt;</description><link>http://www.otechpad.com/2011/03/simple-password-on-windows-2008.html</link><author>noreply@blogger.com (Saurabh Surana)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/-f8N8BvgTuIA/Th53hZTfNLI/AAAAAAAAA3w/IYy-N9OA6Fk/s72-c/image_thumb7.png?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1878358855636852054.post-6710500396270540485</guid><pubDate>Thu, 21 Oct 2010 02:40:00 +0000</pubDate><atom:updated>2011-08-24T21:41:12.714-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tricks</category><category domain="http://www.blogger.com/atom/ns#">Windows</category><title>File Transfer to remote machine with RDP</title><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;When you are connected to remove machine over RDP, there is an easy way to copy files to/from the local machine. No its not with the help of sharing file/folders…that’s not a good option for multiple reasons, not safe, cannot be used if you are behind firewall or proxy (file sharing port won’t be available).&lt;/p&gt; &lt;p&gt;If you explore the RDP dialog, you would see that you can share local resources with the remote machine. If you go to Local Resources tab, and click on More, it will open up a dialog where you can select local resources that you want to share. Notice that Clipboard will be selected by default that’s why you will be able to share the clipboard content between these two machines.&lt;/p&gt; &lt;p&gt;If you have more than one drive, you can select the one that you want to share.&lt;a href=&quot;http://lh4.ggpht.com/-I6eValYZL3Y/TlW2QVHV-oI/AAAAAAAAA4Y/4US8zSrPV7w/s1600-h/RDP%252520Drive%252520Share%25255B5%25255D.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;RDP Drive Share&quot; border=&quot;0&quot; alt=&quot;RDP Drive Share&quot; src=&quot;http://lh6.ggpht.com/-bLcD0BMzCG8/TlW2R15pUiI/AAAAAAAAA4c/ShphdQI9Ldw/RDP%252520Drive%252520Share_thumb%25255B3%25255D.png?imgmax=800&quot; width=&quot;464&quot; height=&quot;787&quot;&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;After then when you connect to remote machine, you would see that selected drive will appear there as local driver, which will allow you to copy content to/from these machines.&lt;/p&gt;  &lt;div class=&quot;blogger-post-footer&quot;&gt;~Thanks,
Saurabh

FWCAFX47R5GU&lt;/div&gt;</description><link>http://www.otechpad.com/2010/10/file-transfer-to-remote-machine-with.html</link><author>noreply@blogger.com (Saurabh Surana)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/-bLcD0BMzCG8/TlW2R15pUiI/AAAAAAAAA4c/ShphdQI9Ldw/s72-c/RDP%252520Drive%252520Share_thumb%25255B3%25255D.png?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1878358855636852054.post-356087245758307436</guid><pubDate>Thu, 24 Jun 2010 12:27:00 +0000</pubDate><atom:updated>2010-06-24T07:27:09.632-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Amazon</category><category domain="http://www.blogger.com/atom/ns#">Cloud Computing</category><category domain="http://www.blogger.com/atom/ns#">EC2</category><title>Amazon EC2 : Reserved Instance</title><description>&lt;p&gt;I was using Amazon windows instance for one of our client. We wanted to continue using this for some more time so we thought of exploring some options where we can minimize the cost (Reserved Instances). &lt;/p&gt;  &lt;p&gt;Amazon offers Reserved Instance where in you have to pay much lesser cost for the instances that you plan to use for a longer period of time. The way it works is,    &lt;br /&gt;1) You decide how long you want to commit to the instance 1 Year or 3 years.     &lt;br /&gt;2) You decide the region in which you want the instance    &lt;br /&gt;3) Decide the type of instance you want to go for. &lt;/p&gt;  &lt;p&gt;Be very cautious while choosing various options here because whatever you choose is not reversible or editable at all. &lt;/p&gt;  &lt;p&gt;After this, once your payment is done, (probably at the end of the month when your bill is generated), you are eligible for the EC2 Reserved Instance, and your billing will now be at a very low price per hour. If you have a running instance it will be billed as a reserved instance or if you bring up new instance of the same configuration then it will be treated as the Reserved Instance. What ever option you go for the key is, same region and same configuration that you had chosen while specifying the configuration for Reserved Instance. If you have multiple instances of the same configuration in the same region then the one which is on for the longer period of time will be billed under Reserved Instance &lt;em&gt;&lt;/em&gt;&lt;/p&gt;  &lt;h5&gt;&lt;em&gt;(Amazon make sure that you pay less, they are being very nice to their customers :) )&lt;/em&gt;&lt;/h5&gt;  &lt;p&gt;&lt;strong&gt;How much do I save?&lt;/strong&gt;&lt;/p&gt;  &lt;p align=&quot;left&quot;&gt;Although the usage charges are radically different for On Demand and Reserved Instances, there is a upfront cost that you pay for the later one. So unless you plan to use it for more than 5/8 months, you don&#39;t really save a lot. But if you have plan for using the instance for more time than this, then Reserved Instance is the best option to go for. For a longer use the savings are really significant.&lt;/p&gt;  &lt;p align=&quot;left&quot;&gt;I did some calculations for the instance that I was using Standard- Large (m1.large):&lt;/p&gt;  &lt;p align=&quot;left&quot;&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p align=&quot;left&quot;&gt;&lt;strong&gt;Windows:&lt;/strong&gt;&lt;/p&gt;  &lt;p align=&quot;left&quot;&gt;For 4 months you pay $1283 for On Demand Instance. And pay $1486 for Reserved Instance.&lt;/p&gt;  &lt;p align=&quot;left&quot;&gt;For 5 months you pay $1728 for On Demand instance, and $1630 for Reserved Instance.&lt;/p&gt;  &lt;p align=&quot;left&quot;&gt;So your saving starts from 5th month on wards. &lt;/p&gt;  &lt;p align=&quot;left&quot;&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p align=&quot;left&quot;&gt;&lt;strong&gt;Linux:&lt;/strong&gt;&lt;/p&gt;  &lt;p align=&quot;left&quot;&gt;For 6 months you pay $1468 for On Demand Instance, and $1428 for Reserved Instance. &lt;/p&gt;  &lt;p align=&quot;left&quot;&gt;For 7 months you pay $1713 for On Demand instance, and $1514 for Reserved Instance. &lt;/p&gt;  &lt;p align=&quot;left&quot;&gt;So your saving starts from 7th month on wards (obviously these figures are considering that your machine always on :) )&lt;/p&gt;  &lt;p align=&quot;left&quot;&gt;&amp;#160;&lt;/p&gt;  &lt;p align=&quot;left&quot;&gt;Savings would change depending upon the instance that you are using but surely you will save a lot in the long run. &lt;/p&gt;  &lt;p align=&quot;left&quot;&gt;&amp;#160;&lt;/p&gt;  &lt;p align=&quot;left&quot;&gt;Another interesting comparison is available @ &lt;a href=&quot;http://spreadsheets.google.com/pub?key=rNtzGcAig_2X0xAP28V_2Jg&quot;&gt;http://spreadsheets.google.com/pub?key=rNtzGcAig_2X0xAP28V_2Jg&lt;/a&gt;&lt;/p&gt;  &lt;p align=&quot;left&quot;&gt;&amp;#160;&lt;/p&gt;  &lt;p align=&quot;left&quot;&gt;   &lt;div style=&quot;padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px&quot; id=&quot;scid:0767317B-992E-4b12-91E0-4F059A8CECA8:8a078906-3713-47ca-932b-988493859b3f&quot; class=&quot;wlWriterEditableSmartContent&quot;&gt;Technorati Tags: &lt;a href=&quot;http://technorati.com/tags/Amazon&quot; rel=&quot;tag&quot;&gt;Amazon&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/EC2&quot; rel=&quot;tag&quot;&gt;EC2&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/Cloud+Computing&quot; rel=&quot;tag&quot;&gt;Cloud Computing&lt;/a&gt;&lt;/div&gt;&lt;/p&gt;  &lt;div class=&quot;blogger-post-footer&quot;&gt;~Thanks,
Saurabh

FWCAFX47R5GU&lt;/div&gt;</description><link>http://www.otechpad.com/2010/06/amazon-ec2-reserved-instance.html</link><author>noreply@blogger.com (Saurabh Surana)</author><thr:total>3</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1878358855636852054.post-6477233910580082873</guid><pubDate>Wed, 16 Jun 2010 11:55:00 +0000</pubDate><atom:updated>2010-12-27T17:31:25.822-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">Security</category><category domain="http://www.blogger.com/atom/ns#">SSL</category><title>Handling Self Signed Certificate (SSL) Error in .NET Application</title><description>When you install self sign certificate on your web server and try to access your application over HTTPs, your browser shows you a security warning saying that it cannot trust the certificate as its not issued by a valid authority. This is important because in the case where you are accessing a site for the first time, you can be a little cautious when you see this error.&lt;br /&gt;When you try to access such application from your .NET client, it always fails to connect as because of this certificate error. To overcome this situation you will have to override the certificate validation check. First you need to add the validation certificate call back handler with the help of following code:&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;ServicePointManager&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;.ServerCertificateValidationCallback = RemoteCertificateValidationCB;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;After this in the call back handler just return true, which tells that its a valid certificate and then the communication/negotiation between your client and the server goes to the next level. You can do this with the help of following code&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;private static bool &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;RemoteCertificateValidationCB(&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;    Object &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;sender, &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;X509Certificate &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;certificate, &lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;    X509Chain &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;chain, &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;SslPolicyErrors &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;sslPolicyErrors)&lt;br /&gt;{&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;    //If it is really important, validate the certificate issuer here.&lt;br /&gt;&lt;br /&gt;    //For now, accept any certificate&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;    return true&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;;&lt;br /&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;code&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;code&quot;&gt;&lt;/pre&gt;Remember to change this before deploying your application to the production system, if you have a valid certificate there.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;wlWriterEditableSmartContent&quot; id=&quot;scid:0767317B-992E-4b12-91E0-4F059A8CECA8:f3c08513-3e03-4663-8685-8ff46d20e6a3&quot; style=&quot;display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Technorati Tags: &lt;a href=&quot;http://technorati.com/tags/Security&quot; rel=&quot;tag&quot;&gt;Security&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/SSL&quot; rel=&quot;tag&quot;&gt;SSL&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/Self+Signed+Certificate&quot; rel=&quot;tag&quot;&gt;Self Signed Certificate&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/.NET+Application&quot; rel=&quot;tag&quot;&gt;.NET Application&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;~Thanks,
Saurabh

FWCAFX47R5GU&lt;/div&gt;</description><link>http://www.otechpad.com/2010/06/handling-self-sign-certificate-ssl.html</link><author>noreply@blogger.com (Saurabh Surana)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1878358855636852054.post-4980018292086151118</guid><pubDate>Tue, 15 Jun 2010 11:50:00 +0000</pubDate><atom:updated>2010-12-27T17:32:01.008-06:00</atom:updated><title>Alternative for large Switch case or Else-If ladder</title><description>&amp;nbsp;Recently I came across a situation where I ended up writing a long switch statements with more than 50 cases each one having a code of more than 10/15 lines and again some cases which had similar codes to be executed. As I went on adding the cases the code started looking very clumsy and my heart forced me to refractor that. I just thought of sharing it here, as I didn&#39;t saw something similar when I did a google about it.&lt;br /&gt;I ended up writing &lt;i&gt;&lt;b&gt;a dictionary of delegates to replace the cases&lt;/b&gt;&lt;/i&gt;, and then &lt;i&gt;&lt;b&gt;a dictionary look-up to replace the switch&lt;/b&gt;&lt;/i&gt;. Here is a sample code for it.&lt;br /&gt;Lets say I have this Maths operations class:&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt; &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;class &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;MathOperations&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre class=&quot;code&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;    delegate float &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;OperationDelegate&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;(&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;float &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;var1, &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;float &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;var2);&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;    Dictionary&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Operation&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;, &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;OperationDelegate&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;gt; caseList;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;    public &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;MathOperations()&lt;br /&gt;    {&lt;br /&gt;        caseList = &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;new &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Dictionary&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Operation&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;, &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;OperationDelegate&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;gt;();&lt;br /&gt;        caseList.Add(&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Operation&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;.Add, &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;new &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;OperationDelegate&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;(add));&lt;br /&gt;        caseList.Add(&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Operation&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;.Subtract, &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;new &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;OperationDelegate&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;(subtract));&lt;br /&gt;        caseList.Add(&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Operation&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;.Multiply, &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;new &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;OperationDelegate&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;(multiply));&lt;br /&gt;        caseList.Add(&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Operation&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;.Divide, &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;new &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;OperationDelegate&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;(divide));&lt;br /&gt;    }&lt;br /&gt;    ...&lt;br /&gt;}&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre class=&quot;code&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-weight: normal; white-space: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;br /&gt;This is the replacement for my cases, every case is replaced by a delegate which is pointing to a specific method(obviously all the methods need to have same signature).&lt;br /&gt;&lt;br /&gt;Now for replacement of Switch statement, I have a PerformOperations method which will do a look-up the in the dictionary and will call the appropriate method using the delegate from the dictionary.&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; white-space: pre;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; white-space: pre;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;if &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;(caseList.ContainsKey(operation))&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre class=&quot;code&quot;&gt;&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{&lt;br /&gt;    OperationDelegate del = caseList[operation] &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;as &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;OperationDelegate;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;    if &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;(del != &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;)&lt;br /&gt;    {&lt;br /&gt;        del(val1, val2);&lt;br /&gt;    }&lt;br /&gt;}&lt;/span&gt;&lt;/strong&gt;&lt;/pre&gt;&lt;pre class=&quot;code&quot;&gt;&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-weight: normal; white-space: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/pre&gt;&lt;br /&gt;So next time if you end up writing a &lt;b&gt;huge switch statement&lt;/b&gt;, which your heart doesn&#39;t agree upon, and you feel that its unmanageable, you can use something like this.&lt;br /&gt;&lt;br /&gt;Let me know if you have a better approach to solve this problem.&lt;div class=&quot;blogger-post-footer&quot;&gt;~Thanks,
Saurabh

FWCAFX47R5GU&lt;/div&gt;</description><link>http://www.otechpad.com/2010/06/alternative-for-large-switch-case-or.html</link><author>noreply@blogger.com (Saurabh Surana)</author><thr:total>1</thr:total></item></channel></rss>