Wednesday, 13 July 2016

How to Interface 7-Segment LED using 8 GPIO of Arduino Uno?

7-Segment Led Interfacing Using GPIOs
How many TV shows and movies have some mysterious device counting down to zero those displays are 7 segment displays.With the 7 segment displays you can display any number or some alphabets that your heart desires.

At first controlling a 7 segment display seems quite complex but it quickly becomes clear.

What follows is a quick guide to control a 7 segment display with a arduino board.
  • First let me do it on proteus simulator.


  • Arduino Code:

  1. void setup()
  2. {
  3.  int i=0;
  4.  for(i=0;i<8;i++) 
  5.  {
  6.    pinMode(i,OUTPUT);
  7.  }
  8. }
  9. void loop()
  10. {
  11.  char x=0x00;
  12.  PORTD = x;
  13.  x++;
  14.  delay(500);
  15. }
Common Configuration(Anod/Cathod)

This post is all about how to interface a seven segment display with microcontroller. In this particular example I will interface one seven segment display with PIC24. You may download Proteus Simulations and code from the links given at the bottom of this page.

  1.             I am using MPLAB X IDE and C30 Compiler for 16bit microcontrollers. I supposed that you know how to blink an LED (if not then I suggest you to read this (link) first before continuing this post) and how to generate a delay without timers or with timers ((if not then I suggest you to read this (link1 and Link2) first before continuing this post).

                There are two types of seven segments available in the market
    1)      Common anode.
    2)      Common cathode.

    I will go through from both of them in order to make you understand that what differences will be caused in hardware and software.

    In hardware they are arrange in following type:


    Common Anode Internal configuration.

    Truth table for Common Anode:


    Dp
    (MSB)
    G
    F
    E
    D
    C
    B
    A
    (LSB)
    Value in hex
    0
    1
    1
    0
    0
    0
    0
    0
    0
    0xC0
    1
    1
    1
    1
    1
    1
    0
    0
    1
    0xF9
    2
    1
    0
    1
    0
    0
    1
    0
    0
    0xA4
    3
    1
    0
    1
    1
    0
    0
    0
    0
    0xB0
    4
    1
    0
    0
    1
    1
    0
    0
    1
    0x99
    5
    1
    0
    0
    1
    0
    0
    1
    0
    0x92
    6
    1
    0
    0
    0
    0
    0
    1
    0
    0x82
    7
    1
    1
    1
    1
    1
    0
    0
    0
    0xF8
    8
    1
    0
    0
    0
    0
    0
    0
    0
    0x80
    9
    1
    0
    0
    1
    1
    0
    0
    0
    0x98


    Common Cathode Internal configuration.






    For Reference:


Friday, 1 July 2016

What is Redundant Network Topology ?





Redundancy is a system design in which a component is duplicated so if it fails there will be a backup. Redundancy has a negative connotation when the duplication is unnecessary or is simply the result of poor planning.


NETWORK REDUNDANCY 

The underlying concept behind network redundancy is to provide alternate paths for data to travel along in case a cable is broken or a connector accidentally un-plugged. However, Ethernet as standard cannot have rings or loops in the network as this will cause broadcast storms* and can ultimately cause the network to stop working. An Ethernet network cannot have two paths from point A to point B without a mechanism in place to support this type of topology. To achieve redundancy, the network infrastructure (switches) must support redundancy protocols designed to negate the usual problems of putting loops into an Ethernet network, maintaining a default data path and switching to an alternate one when a fault occurs.
Amplicon

CLASSIC STAR TOPOLOGY Amplicon

A typical Ethernet network employs a star topology as detailed in Figure 1 below.
There are several mechanisms for providing redundancy in a network, the most common being LACP*, RSTP* and ring redundancy. All switches must support the required redundancy capability and the switches must be connected to each other in an appropriate configuration.
For simplicity and ease of expansion, ‘redundant rings’ are becoming the most popular redundancy solution for the BMS market.
Amplicon

REDUNDANT RING TOPOLOGY Amplicon

Using “Industrial Ethernet switches” it is possible to build a ring topology that can suffer a single point failure (cable broken or connector unplugged) and continue to operate as if nothing had changed. This will keep BMS controllers and outstations communicating with each other even in the event of a network failure. Comparing Figure 1 and Figure 2, the difference between a star and a ring network topology is clearly visible.
 Back to top top of pagecorner
Amplicon

HOW DOES RING REDUNDANCY WORK? Amplicon

Consider Figure 2. The network traffic from outstation A follows the default path through the network from switch 2 to switch 1 to switch 4 to the destination - the Supervisor PC. If a cable is broken or a connector un-plugged along this default route, the switches will automatically reconfigure to transmit data the alternative way around the ring – switch 2 to switch 3 to switch 4 to Supervisor. This network reconfiguration can happen in as little as 20mS. Poorly designed redundant networks can have a much higher re-configuration time with BMS data potentially disappearing from the screen for several minutes. Without redundancy, the BMS system may stop working effectively for several days.
Figure 2 shows a network with redundancy at the “network layer” but no redundancy at the “device layer”. If the single link from the Supervisor to the network were broken, access to the live BMS data would be lost. The next logical step is to dual attach the Supervisor PC to the network removing the single point of failure. Dual attachment of Ethernet devices is not always a trivial process. Amplicon’s technical team can help with such requirements.
Redundant Ring topology with all devices dual attached
In highly critical applications, it may be necessary to dual attach all devices (outstations and PCs) to the network to provide a very high level of redundancy. This provides maximum reliability but also generates maximum cost and complexity.
Most vendors of Industrial Ethernet products support a version of the ‘redundant ring’ technology described above. It should be noted that the protocols used are not based on a standard and are generally not interoperable amongst the different switch manufacturers.
 Back to top top of pagecorner
Amplicon

SPANNING TREE Amplicon

TCP provides many network services but is best known for multiplexing, flow control and provision of an entry / exit point to the network. Applications (email, web browser, BMS software) access the network through ports*. By giving each piece of software its own port, it is possible to identify many different applications on a single network device and thus allow many applications on a single to use the same physical network without data getting delivered to the wrong place. This process is referred to as multiplexing as it allows many different data packets to be multiplexed over the network. At the receiving end, TCP de-multiplexes the data stream, distributing the right data packets to the correct applications.
Multiple paths exist between switches in a “mesh” providing a high degree of network redundancy.

POWER REDUNDANCY Amplicon


Many Industrial Ethernet switches support power redundancy, allowing 2 or more power inputs to be used in case of failure of the primary input. This can be a useful selling point for your network over a competitor’s solution and costs little extra to implement.



Reference Link:

Wednesday, 22 June 2016

Many Lives Many Master - Best Ever Read


Book that is going to change your vision about cycle of Life and Death and "NEVER DIE BEFORE YOU DIE " attitude.

 

Here is the best of this book for which I feel


"We must share our knowledge with other people. We all have ability far beyond we use. Some of us find it out sooner than others. That you should check your vices before you come to this point . If you do not than you carry them over with you to another life. ONLY WE CAN RID OVERSELVES..OF THE BAD HABITS that we accumulate when we are in physical state(When we are living). The masters cannot do that for us. IF you fight and not to rid yourself then you will carry them over into another life. And only when you decide you are strong enough to master the external problems, then you will no longer them in your another life."


"We also must learn not just those people whose vibrations are the same as ours. It is normal to feel drawn to somebody who is on the same as outs. But this is wrong. You must also go to those people whose vibration are Wrong....with yours. This is the important ...in helping ...these poeple."

"We are given intuitive powers we should follow and not try to resist. Those who resist will meet to danger. We are not sent back from each plane with equal power. Some of us possess power greater than others, because they have been accrued from other times. THUS PEOPLE ARE NOT CREATED EQUAL. BUT EVENTUALLY WE WILL REACH A POINT WHERE WE WILL ALL BE EQUAL."



"People who are in coma are in state of suspension .They are not ready yet to cross into other plane.....Untill and unless they have decided whether they want to cross or not. Only they can decide this. If they feel they have no more learning ...in physical state... then they are allowed to cross over. But if they have more learning, then they must come back, even if they do not want to. The rest period for them , a time when their mental powers can rest"


"THE EXPERIENCE IS ALAWYS NECESSARY TO ADD EMOTIONAL BELIEFS TO INTELLECTUAL UNDERSTANDING"

-in simple word to convert INFORMATION INTO KNOWLEDGE , experience is REquiRED. 

Friday, 10 June 2016

What is NAT(Network Address Translation) with Example ?


Network Address Translation (NAT) -



It’s known that NAT (Network Address Translation) can ensure security since each outgoing or incoming request must go through a translation process that offers the opportunity to qualify or authenticate the request or match it to a previous request. NAT also conserves on the number of global IP addresses that a company needs and it lets the company use a single IP address in its communication with the world.
There are some other sticky network problems that need NAT (Benefit of NAT)
Static or dynamic translation
We’ve already mentioned that NAT cures duplicate address ranges without readdressing host computers. The translation done by NAT can be either static or dynamic. Static translation is where we specify a lookup table, and one inside address is turned into one pre-specified outside address. Dynamic is where we tell the NAT router what inside addresses need to be translated, and what pool of addresses may be used for the outside addresses. There can be multiple pools of outside addresses. ICMP host unreachable messages are used when addresses run out.
Port multiplexing
With NAT, multiple internal hosts can also share a single outside IP address, which conserves address space. This is done by port multiplexing: changing the source port on the outbound packet so that replies can be directed back to the appropriate machine.
Load distribution
You can also do load distribution via NAT: have one external address (perhaps your Web server’s name, www.cisco1900router.com, maps to this address). Then round-robin between different inside machines, so that incoming new connections are distributed across several machines. (Since each connection may involve state information, a given connection has to remain on one machine.)
Readdressing
Organizations that change service providers are now typically not allowed to take their address with them (because exceptions to CIDR addressing blocks have become a problem). NAT solves this by allowing re-addressing to occur at the gateway, allowing time to convert internal hosts to the new network number.
Additionally, NAT also enhances security—internal network topology and addresses are hidden from the outside world. The only thing NAT really can’t do much about is sloppily-written applications, with hard-coded raw IP addresses.

Disadvantages of NAT
Address translation is not practical for large numbers of internal hosts all talking at the same time to the outside world. NAT just won’t work well at a large scale.
Besides, performance may be a consideration. Currently, NAT only runs on Cisco 7500 routers with the RSP. Even there, NAT causes process switching on its configured interfaces. You can think of this as if the CPU has to look at every packet, deciding whether or not to translate it, and whether to alter the IP header, or possibly the TCP header. One doubts that this will be easily cache-able.
For more Reference :

Thursday, 9 June 2016

What is SSO(Single Sign On) in easy wording ?

What is SSO (Single Sign On)?

SSO (Single Sign On) means that when a user logs in to one application he will be "automatically" signed in to every other application, regardless of the platform, technology and domain.
For example, Google implements SSO for their products: Gmail, YouTube, Analytics, etc. When you turn on your computer and access Gmail, you login for the first time. Then, if you go to YouTube you won't be prompted for credentials again.
The way this works is by means of a "central service" (in the case of Google this is https://accounts.google.com). When you login for the first time a cookie gets created on this central service. Then, when you try to access the second application, you get redirected to the central service, but since you already have a cookie, you get redirected to the app directly with a token, which means you're already logged in.
Single-sign-on (SSO) is now required more than ever. In this two-piece post we will study how SSO is implemented for the web and provide a working example using OpenID Connect (in part 2). Read on!

Federated identity glossary

The concept of a centralized or linked electronic identity is known as federated identity. Federated identity systems handle several concerns:
  • Authentication
  • Authorization
  • User attributes exchange
  • User management
The authentication aspect deals with validating user credentials and establishing the identity of the user. Authorization is related to access restrictions (e.g., is the user allowed to access X resource?). The attributes exchange aspect deals with data sharing across different user management systems. For instance, fields such as "real name" may be present in multiple systems. A federated identity system prevents data duplication by linking the related attributes. Lastly, user management is related to the administration (creation, deletion, update) of user accounts. A federated identity system usually provides the means for administrators (or users) to handle accounts across domains or subsystems.
SSO is strictly related to the authentication part of a federated identity system. Its only concern is establishing the identity of the user and then sharing that information with each subsystem that requires the data. Below, we focus on this crucial aspect of a federated identity system.

Single sign on (SSO)

Sooner or later web development teams face one problem: you have developed an application at domain X and now you want your new deployment at domain Y to use the same login information as the other domain. In fact, you want more: you want users who are already logged-in at domain X to be already logged-in at domain Y. This is what SSO is all about.
Single sign on question
The obvious solution to this problem is to share session information across different domains. However, for security reasons, browsers enforce a policy known as the same origin policy. This policy dictates that cookies (and other locally stored data) can only be accessed by its creator (i.e. the domain that originally requested the data to be stored). In other words, domain X cannot access cookies from domain Y or vice versa. This is what SSO solutions solve in one way or the other: sharing session information across different domains.
No cookie sharing
Different SSO protocols share session information in different ways, but the essential concept is the same: there is a central domain, through which authentication is performed, and then the session is shared with other domains in some way. For instance, the central domain may generate a signed JSON Web Token (which may be encrypted using JWE). This token may then be passed to the client and used by the authentication domain as well as any other domains. The token can be passed to the original domain by a redirect and contains all the information needed to identify the user for the domain requiring authentication. As the token is signed, it cannot be modified in any way by the client.
Central authentication domain
Whenever the user goes to a domain that requires authentication, he or she isredirected to the authentication domain. As the user is already logged-in at that domain, he or she can be immeditely redirected to the original domain with the necessary authentication token.
Single sign on

Different protocols

If you have been reading about SSO online, you have probably found that there are many different implementations: OpenID Connect, Facebook Connect, SAML, Microsoft Account (formerly known as Passport), etc. Our advice is to choose whatever is simplest for your development efforts. For instance, SAML is deeply entrenched in enterprise developments, so in some cases it will make sense to pick that. If you think you will need to integrate your development with more than one alternative, don't despair: there are frameworks that allow interoperability between different SSO solutions. In fact, that's one of the things we do at Auth0.

Aside: SSO with Auth0

If you are already using Auth0 in your developments, you know how easy it is to do SSO. If not, please see the docs on single sign on and check out the examples. Our SSO solution works as a bridge between different SSO frameworks. So whatever your existing apps are using, it has never been easier to integrate SSO into them. We do the hard work for you.
SSO with Auth0

Conclusion

SSO is here to stay. Decentralized systems are becoming more and more common and authentication is an essential aspect of all of them. SSO solves a big problem: how to manage the increasing number of users across a whole ecosystem of applications and services. Frameworks such as OpenID Connect and services such as the one we provide at Auth0 make integrating Single Sign On into your new or existing applications much easier. If you are implementing authentication for a new application or service, consider integrating SSO from the get-go.
Reference Link:

How to install google-chrome in redhat without redhat subscription

Install google-chrome in redhat  Download the .rpm file of chrome https://www.google.com/chrome/thank-you.html?installdataindex=empty&st...