Posts

Showing posts from October, 2018

Security Token Service

Image
AssumeRole Q. What is AWS STS? AWS Security Token Service(STS) is a web service that enables you to request temporary, limited-privilege credentials for following users AWS Identity and Access Management (IAM) users Federated users Q. Is AWS STS global service? YES, default it is a global service with a single endpoint at https://sts.amazonaws.com , However , we can also choose to make STS API calls to endpoints in any other supported regions ( refer ) to reduce latency(server lag) by sending the request to servers in a region that geographically closer to us. Q. What are the types of access can AWS Users have? Two types of access possible. Programmatic access - Enables an access Key ID and secret access key for the AWS API, CLI, SDK and other development tools AWS Management Console access - Enables a password that allows users to sign-in to the AWS Management console. Q. What are the common scenarios to go for

Puzzles with iPython

Puzzles with iPython Puzzles with iPython Tip Ctrl+Q and then Ctrl+J is shortcut to go to next line with iPython Smallest Missing Positive Integer Q. Find the smallest missing number from the given list From the given list of integers find the smallest positive integer number that is missing. If the given list is `[1, 2, 4, 5, 0, -1]` and function should return `3` which is smallest positive missing number. smallest_missing_number.python In [ 2 ]: def smallest_missing_number (lst): ...: n = 1 # Smallest positive number is 1 ...: given_set = set (lst) # make a unique elements set ...: # Verify number starting with 1 in given_set ...: # Return first missing number from the given_set ...: # Which is our desire result ...: while n in given_set: ...: n += 1 ...: return n ...: In [ 3 ]: smallest_missing_number([ 1 , 0 , 3 , 5 , - 8 , - 9 ]) Out[ 3 ]: 2 Staircas