Tumgik
dinakar · 25 days
Text
Tumblr media
It’s getting chilly.
0 notes
dinakar · 2 years
Photo
Tumblr media
Street Side Temple, Chennai, India
0 notes
dinakar · 4 years
Text
Manning and Mahomes
Tony Romo was sure of one thing at the onset of 2020 Super Bowl broadcast - it was a going to be a close game. His reasoning - both QB's are good enough to drag their teams back if they fall behind. Data backed him up and it sounded reasonable and logical with Brady and Mahomes. Tom Brady is Tom Brady. And Chief's last year championship glory came after Mahomes effortlessly switched gears after trailing by 10 or more in all the post-season games.
But, as Romo was going on, all I could think of was super bowl 48 where Peyton Manning came in hot with 55 TD's in regular season, but was found out by Seattle's legion of boom defense. If it could happen to Manning in that game, it can happen to any quarterback. Unfortunately for Chiefs, it was Mahomes' turn.
Here are box scores for Manning and Mahomes
Manning super bowl 48 - 34/49, 284 yards, 1 TD and 2 INT Mahomes super bowl 55 - 26/49, 270 yards, 0 TD and 2 INT
Pretty similar, but Mahomes was unlucky not to have a TD due to drop in the end-zone. Two start quarterbacks, 2 stinky games that will follow them for long.
P.S: As a Broncos fan, I kept having scary flashbacks to super bowl 48 where after every Seattle score, it kept telling my self, we still in it - which made me realize what Romo was alluding to.
0 notes
dinakar · 4 years
Photo
Tumblr media
Pandemic on hard mode. Please go away.
1 note · View note
dinakar · 4 years
Text
Late Stage Capitalism
Tumblr media
I’m all for paying tips for hard working delivery drivers who help society reduce the spread of COVID-19, but golly, nothing screams late stage capitalism like a company valued close to $2 trillion dollars and headed by richest man on the planet, decides to levy a default tip of 15% because they refuse to pay good enough wages to their employees. 
0 notes
dinakar · 4 years
Text
Dhoni
Few lines from Brent Amaker's Man in Charge could easily be mistaken for penned specifically for Dhoni. Take a look
"I'm a man in charge I got the plan And I'm a freight train coming Coming 'round the bend"
"I'm your worst fear I'm your best friend I'm banging on the door, so you better let me in"
"Well I'm giving no advice, but I'll tell you what to do"
"There's a fire inside, even in you We all got the fire, we all know what to do"
"The ace high on the side, I take it down to the wire"
Anyway, this is my Dhoni retirement post. What a career - unparalled.
He came across as someone who had a plan and who knew what the heck he was doing - when he was acing a chase or setting 8 -1 fields against Australia to slow them down or having an midoff and long off to Pollard in IPL finals or even when team was getting swept in England and Austrlia. He was always in charge and had a plan!
Great song. Go listen
0 notes
dinakar · 4 years
Text
Azure function to Pause/ Resume Synapse Compute
If you have ever provisioned an Azure Synapse data warehouse, it wouldn't take long for you to notice that it doesn't come cheap. Sure thing, it makes creating and managing data warehouses way better than previous Microsoft offerings, but you'd be wise to keep an eye on the costs.
Synapse's architecture decouples compute and storage, which means you can pause compute when not in use and stop incurring costs. Ideally you'd first determine time slot(s) where compute can be paused and then have an time triggered program pause and resume the compute as needed.
Here is the time triggered Azure function written in Python to pause/ resume synapse. For the sake of brevity, I have included very basic schedule - pause between 6pm to 10pm on weekdays and 7am to 10pm on weekends. Run this function every hour. It looks at the schedule and pauses and resumes as needed. Follow along with comments.
You'd need service principal details - appid, password and tentantid - to call the API's.
Store above in Azure Keyvault.
Access Keyvault using DefaultAzureCredentials and System Assigned Identity for the function.
Authentication + Authorization for API's using access token as bearer. Details here
Link to github gist
import datetime import logging import os import requests from pytz import timezone import azure.functions as func from azure.identity import DefaultAzureCredential from azure.keyvault.secrets import SecretClient def main(mytimer: func.TimerRequest) -> None: utc_timestamp = datetime.datetime.utcnow().replace( tzinfo=datetime.timezone.utc).isoformat() if mytimer.past_due: logging.info('The timer is past due!') try: #obtain the credential object and use function's system assigned identity to access service principal details from keyvault #enable System Assigned Identity for the function. #make sure function has access to list the secrets. credential = DefaultAzureCredential() #get service principal id, password and tenant id. Used to call Azure API's tenant_id,client_id,client_password = get_credential_entities(credential) if not tenant_id and client_id and client_password: raise Exception("missing credentials") else: access_token = get_access_token(tenant_id,client_id,client_password) if not access_token: raise Exception("missing access token") else: what_to_do = detemine_what_to_do() synapse_status = get_current_status(access_token) if synapse_status: #use the access toke to pause synapse if((what_to_do == "pause" and synapse_status != "Paused") or (what_to_do == "resume" and synapse_status != "Online")): control_synapse(what_to_do,access_token) else: logging.info("***** nothing to do in this run") else: raise Exception("could not detemine current status") except Exception as ex: logging.exception(f"exception in main module {ex}") logging.info('Python timer trigger function ran at %s', utc_timestamp) def get_credential_entities(credential): try: #get keyvault url from application setting. vault_url = os.environ["custom_keyvault_url"] #define secret_client_object secret_client = SecretClient(vault_url=vault_url, credential=credential) #get the secret value. both authentication and authorization happen here using DefaultAzureCredentials #enable System Assigned Identity for the function. #make sure function has access to list the secrets. retireved_client_password = secret_client.get_secret(os.environ['custom_keyvault_secret_client_password']) retireved_client_id = secret_client.get_secret(os.environ['custom_keyvault_secret_clientid']) retireved_tenantd_id = secret_client.get_secret(os.environ['custom_keyvault_secret_tenantid']) return retireved_tenantd_id.value,retireved_client_id.value,retireved_client_password.value except Exception as ex: logging.exception(f"exception in get_credential_entities module {ex}") return "","","" def get_access_token(tenant_id,client_id,client_password): try: #build the access token api url using tenantid token_url = f"https://login.microsoftonline.com/{tenant_id}/oauth2/token" #build payload using clientid and client password payload = f"grant_type=client_credentials&client_id={client_id}&client_secret={client_password}&resource=https%3A//management.azure.com/" #define headers headers = {"Content-Type": "application/x-www-form-urlencoded"} #use requests to get token token_response = requests.request("POST", token_url, headers=headers, data = payload).json() return token_response["access_token"] except Exception as ex: logging.exception(f"exception in get_access_token module: {ex}") return "" def control_synapse(operation,access_token): try: #build the pause/ resume api call url with access token control_url = f"https://management.azure.com/subscriptions/{os.environ['custom_setting_subscriptionid']}/resourceGroups/{os.environ['custom_setting_resource_group']}/providers/Microsoft.Sql/servers/{os.environ['custom_setting_db_server']}/databases/{os.environ['custom_setting_db_name']}/{operation}?api-version=2017-10-01-preview" payload = {} headers = {"Authorization": f"Bearer {access_token}"} response = requests.request("POST", control_url, headers=headers, data = payload) except Exception as ex: logging.exception(f"exception in pause_synapse module: {ex}") def get_current_status(access_token): try: #build the status api call url with access token status_url = f"https://management.azure.com/subscriptions/{os.environ['custom_setting_subscriptionid']}/resourceGroups/{os.environ['custom_setting_resource_group']}/providers/Microsoft.Sql/servers/{os.environ['custom_setting_db_server']}/databases/{os.environ['custom_setting_db_name']}?api-version=2014-04-01" payload = {} headers = {"Authorization": f"Bearer {access_token}"} response = requests.request("GET", status_url, headers=headers, data = payload) converted_response = response.text synapse_staus = converted_response[converted_response.index("") + len(""):converted_response.index("")] return synapse_staus except Exception as ex: logging.exception(f"exception in pause_synapse module: {ex}") return "" def detemine_what_to_do(): try: #get time in est. est = timezone('US/Eastern') runtime = datetime.datetime.now(est) runtime_hour,runtime_weekday = runtime.hour,runtime.strftime("%A") return { (runtime_weekday not in ["Saturday","Sunday"] and (runtime_hour >= 18 and runtime_hour < 22)) :"pause", (runtime_weekday in ["Saturday","Sunday"] and (runtime_hour >= 7 and runtime_hour < 22)) :"pause" }.get(True,"resume") except Exception as ex: logging.exception("exception in detemine_what_to_do module: {ex}")
0 notes
dinakar · 4 years
Text
Buffet Barometer
Airlines stocks are expectedly down following Mr.Buffet's announcement over the weekend that he dumped them as COVID-19 continues to decimate travel demand. Good on him - that's what great money managers do - move on without being too sentimental and make money elsewhere.
Compare and constrast with same Mr.Buffet who holds on to Wells Fargo stock despite being mired in multiple scandals. I hate to draw paralles, but this one hangs in the air so right in our faces that it would be stupid not to acknowledge - more than ever, we are a society of success, damned be the values.
Disclaimer - I work for an airline, so take my views with a bag of salt
0 notes
dinakar · 5 years
Text
Tumblr media
A intense stare down from Bob Odenkirk always adds such an intrigue to the scene. Every one knows this right?
0 notes
dinakar · 5 years
Text
Tumblr media
Dinner.
0 notes
dinakar · 5 years
Text
Tumblr media
0 notes
dinakar · 6 years
Text
Arrivals
I had to pickup family at ORD recently and long immigration lines meant a 90 minute wait time at the international arrivals.
It’s a fascinating experience to watch this continuous stream of people coming out of those gates after a long tiring journey, who yet manage to show gleeful anticipation in their eyes searching for their friends and family from the onlookers on the other side of the gate. Some smile, some hug, some kiss and some cry. The whole gamut is on the display! Diversity of the people coming out is hard not to notice, in fact that might have been the first thing that struck me - so many races and colors. I'm not sure any other country draws people like good'old America does. 
And once you drive out of ORD, there is simple sign which reads "We are glad you are here". In these politically turbulent times, this simple message says a lot and refreshingly reassuring. 
0 notes
dinakar · 6 years
Text
Apple One
Apple has a subscription service for iPhones - iPhone upgrade program.
Apple has a subscription service for music - Apple Music
Apple has a subscription service for iCloud storage - pricing
Apple is working on creating and distributing original video content - supposedly through a subscription service.
Apple has recently acquired Texture to get into magazine subscription service.
Apple has - for years now - has been trying to get into TV subscription service.
You get the gist. It's all about consistent and recurring subscription revenue. Individual subscriptions are great, but I can't help but think of one glorified subscription service which gets you the latest and greatest iPhone, cloud storage, music, video, magazines and TV. Pay once and all your digital needs are taken care of. If Apple can get this right, they will strike gold - consistent, recurrent revenue + lock down.
0 notes
dinakar · 6 years
Photo
Tumblr media
0 notes
dinakar · 6 years
Link
Good, I have lost the count of number of times I bought a latte just to use their restroom.
And how about the gentlemen, Rashon Nelson and Donte Robinson, who struck a symbolic $1 deal with the city of Philapdelphia and promise from the city to set up a $200,000 program for young entrepreneurs. Great unselfish act.
0 notes
dinakar · 6 years
Photo
Tumblr media
Quintessential LA.
0 notes
dinakar · 6 years
Text
I’d rather be in mountains with my family.
0 notes