Skip to content

Instantly share code, notes, and snippets.

View yashwanth-l's full-sized avatar
🎯
Focusing

Yashwanth Lakkaraju yashwanth-l

🎯
Focusing
View GitHub Profile
@yashwanth-l
yashwanth-l / login-via-pim.sh
Created February 27, 2025 22:25 — forked from paolosalvatori/login-via-pim.sh
This Bash script allows to login to a given Azure Subscription using Microsoft Entra Privileged Identity Management (PIM)
#!/bin/bash
# Variables
SUBSCRIPTION_ID=$(az account show --query id --output tsv) # Subscription ID
ROLE_NAME="8e3af657-a8ff-443c-a75c-2fe8c4bcb635" # Owner role
ROLE_DEFINITION_ID="/subscriptions/${SUBSCRIPTION_ID}/providers/Microsoft.Authorization/roleDefinitions/${ROLE_NAME}" # Role definition resource ID
PRINCIPAL_ID=$(az ad user show --id $(az account show --query user.name -o tsv) --query id -o tsv) # Your account object ID
ROLE_ASSIGNMENT_ID=$(uuidgen) # Generate a unique GUID for the role assignment
JUSTIFICATION="I need access to [$(az account show --query name --output tsv)] Azure subscription" # Justification for the role assignment
API_VERSION="2020-10-01" # API version

If .DS_Store was never added to your git repository, simply add it to your .gitignore file.

If you don't have one, create a file called

.gitignore

In your the root directory of your app and simply write

@yashwanth-l
yashwanth-l / bash-colors.md
Created November 20, 2024 23:54 — forked from JBlond/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@yashwanth-l
yashwanth-l / bash_strict_mode.md
Created November 20, 2024 23:54 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation
@yashwanth-l
yashwanth-l / step-cli-jwt-inspect.yaml
Last active September 25, 2024 08:17
step-cli-jwt-inspect.yaml
---
apiVersion: v1
kind: Pod
metadata:
name: step-cli-jwt-inspect
namespace: ${NAMESPACE}
spec:
serviceAccountName: ${SERVICE_ACCOUNT_NAME}
volumes:
- name: jwt-token
@yashwanth-l
yashwanth-l / gist:a8a425bfc580e63ea50fa72dc721a59d
Created September 16, 2024 12:26 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@yashwanth-l
yashwanth-l / git-cherry-pick.another-repo
Created July 10, 2024 19:26
git-cherry-pick.another-repo
# Add new-origin as a new remote origin:
git remote add new-origin https://github.com/example.git
# Fetch all of the remote branches and tags:
git fetch new-origin
# List the commits of a specific branch and cherry-pick a commit.
git log new-origin/<branch-from-new-repo>
git cherry-pick <commit>
#!/bin/bash
# Whenever you clone a repo, you do not clone all of its branches by default.
# git clone --mirror REPO_URL could also clone all branches
# If you wish to do so, use the following script:
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master `; do
git branch --track ${branch#remotes/origin/} $branch
done
@yashwanth-l
yashwanth-l / git.migrate
Last active July 10, 2024 14:29 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
## Refer https://www.atlassian.com/git/tutorials/git-move-repository
@yashwanth-l
yashwanth-l / update-git-recursively.sh
Created July 8, 2024 20:01
update-git-recursively
find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} fetch origin main:main \;
find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} merge main \;
find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} add -A \;
find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} commit -m "commit message example" \;
find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} push origin some-branch \;