by Pranav Kulkarni | Nov 24, 2023 | Uncategorized
Intro Prefixes a/ and b/ represents source and destination file paths. git diff man page: https://git-scm.com/docs/git-diff It is typical to copy the file name with double-click select and paste or ctrl/cmd+click open directly in your favorite editor. But, prefixes a/...
by Pranav Kulkarni | Nov 24, 2023 | Uncategorized
Considering cat file.json be any JSON input from a file or API response, etc. Read the whole file with JSON aware viewer jq ‘.’ file.json # OR cat file.json | jq ‘.’ The rest of the write-up assumes the file being read with cat format before...
by Pranav Kulkarni | Nov 24, 2023 | Uncategorized
Trailing slash is a forward slash at the end of the web page URL. The convention is URL ending with a slash denotes the URL pointing to a directory otherwise, it points to a file. Not having a trailing tear is preferable mainly due to ease of use. Web standards has...
by Pranav Kulkarni | Nov 24, 2023 | Uncategorized
Clones It is a form of horizontal scaling. Public servers are hidden behind a load balancer, evenly distributing load (requests from your users) onto your group/cluster of application servers. Every server contains the same codebase and does not store user-related...
by Pranav Kulkarni | Nov 24, 2023 | Uncategorized
Example dict flat_hash = { ‘key1’: ‘value1’, ‘key2’: ‘value2’ } nested_hash = { ‘rootkey’: { ‘subkey1’: ‘value1’ } } Print dictionary print(flat_hash) print(nested_hash)...
by Pranav Kulkarni | Nov 24, 2023 | Uncategorized
Exception handling try: # Do something except Exception as e: # Handle it Print array of strings print “”\n””.join(arr) Iterating by index for i in range(len(arr)): print arr[i] Passing CLI arguments import sys print(sys.argv[0]) Using...
by Pranav Kulkarni | Nov 24, 2023 | Uncategorized
Prerequisites AWS CLI https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html Active AWS access keys – access key ID and secret access key Configure AWS CLI Use command aws configure aws configure # AWS Access Key ID [****************MPLE]:...
by Pranav Kulkarni | Nov 24, 2023 | Uncategorized
Problem For a given list of dicts, find the first dict that matches the given criteria. Consider the following list as an example and find the first dict with capital Mumbai. [ { ‘id’: ‘one’, ‘state’: ‘Madhya...
by Pranav Kulkarni | Nov 24, 2023 | Uncategorized
Branch on new git repo locally The default branch for git is set to master. You can change that behavior by changing a global setting for the default branch. This will help keep the main branch as the default for newly created repositories. git config –global...
by Pranav Kulkarni | Nov 24, 2023 | Uncategorized
tl;dr GitHub repo with latest dotfiles: https://github.com/pranavcode/dotfiles.git Clone the dotfiles locally Ideally, clone it into the user’s home directory. git clone [https://github.com/pranavcode/dotfiles.git](https://github.com/pranavcode/dotfiles.git) Install...