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 / 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:
#!/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 / delete-git-recursively.sh
Last active July 8, 2024 19:20 — forked from facelordgists/delete-git-recursively.sh
Recursively remove .git folders
find . \( -name ".git" -o -name ".gitignore" -o -name ".gitmodules" -o -name ".gitattributes" \) -exec rm -rf -- {} +
@yashwanth-l
yashwanth-l / restricted-psp.yaml
Created April 16, 2024 07:46 — forked from tallclair/restricted-psp.yaml
Restricted PodSecurityPolicy
apiVersion: extensions/v1beta1
kind: PodSecurityPolicy
metadata:
name: restricted
annotations:
seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default'
apparmor.security.beta.kubernetes.io/allowedProfileNames: 'runtime/default'
seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default'
apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default'
spec:
@yashwanth-l
yashwanth-l / poetry-convert.py
Created October 1, 2023 15:56 — forked from tigerhawkvok/poetry-convert.py
Convert a requirements.txt file to a Poetry project
#!python3
"""
Convert a requirements.txt file to a Poetry project.
Just place in the root of your working directory and run!
"""
sourceFile = "./requirements.txt"
import re
import os