Skip to content

Instantly share code, notes, and snippets.

Working from home

Varun Chandak varunchandak

Working from home
View GitHub Profile
varunchandak / GCP App Engine Static
Last active March 9, 2023 09:27
GCP App Engine Static Website app.yaml
View GCP App Engine Static


  1. create a directory website
  2. copy the app.yaml in the website directory
  3. create a directory static inside website directory
  4. copy the contents of website inside static directory
  5. from the website directory level, deploy the website using gcloud app deploy
varunchandak / create permanently delete user in
Last active January 3, 2023 09:39
create permanently delete user in powershell
View create permanently delete user in

New-MsolUser -DisplayName "User Name" -FirstName User -LastName Name -UserPrincipalName

get-msoluser -UserPrincipalName | select *immutableid*

set-MsolUser –UserPrincipalName -ImmutableId "username@domain.tld"

get-msoluser -UserPrincipalName | select *immutableid*
varunchandak /
Created November 21, 2022 17:08
Phrases for Work

Thanks to

  • Were you BORN this stupid? Or did it just take years of practice?
  • I don't know what your problem is, but I'll bet it's hard to pronounce.
  • The beatings will continue until morale improves
  • How about never? Is never good for you?
  • I see you've set aside this special time to humiliate yourself in public.
  • Busy, you thought busy was a policeman. "In England for some reason, they call the policeman busy
  • I'm really easy to get along with once you people learn to worship.
  • I'll try being nicer if you'll try being smarter.
varunchandak / linkedin-connection-remover.js
Created October 24, 2022 07:42
LinkedIn Connection Bulk Remover
View linkedin-connection-remover.js
function stepOne(){
setTimeout(function () {
varunchandak / single-iam-user-with-password.yml
Created July 28, 2022 12:57
CloudFormation template provisions a single IAM User with password
View single-iam-user-with-password.yml
AWSTemplateFormatVersion: '2010-09-09'
Description: This template provisions a single IAM User with password
Description: Will Nave (
Description: "This template is used to create a stack that implements a single IAM User. The user can
be associated with an IAM Group and/or one of several Managed Policies offered by AWS. Each managed policy maps
to a traditional user job function/role. The stack exports both the user name and ARN on successful
varunchandak /
Created June 23, 2022 15:15
Script to delete unused disks from GCP project
gcloud compute disks list \
--format json \
--project "$GCP_PROJECT" | \
jq -r '.[]|select(.users == null)|.name, .zone' | \
paste -d, - - | \
sed "s,$GCP_PROJECT/zones/,,g" | \
while read DISK_NAME ZONE_ID; do
varunchandak /
Last active June 10, 2022 12:11
Automated Jenkins Upgrade Script
# This script will auto upgrade jenkins to latest stable version if found.
export EPOCH_DATE="$(date +%s)"
export JENKINS_DIR="/usr/share/java"
export TEMP_DIR="/tmp/jenkins-upgrade-"$EPOCH_DATE"/"
export WEBHOOK=""
# Create temp directory
varunchandak /
Created June 7, 2022 09:49

One liner Bhagawad Geeta

Chapter 1 - Wrong thinking is the only problem in life.

Chapter 2 - Right knowledge is the ultimate solution to all our problems.

Chapter 3 - Selflessness is the only way to progress and prosperity.

Chapter 4 - Every act can be an act of prayer.

varunchandak /
Created May 4, 2022 07:17
Funny Technical Quips
  • Design is the process of changing your mind until you get it right.
  • Everyone makes mistakes. The trick is to make them when nobody is looking.
  • Confidence is the feeling you have before you really understand the problem.
  • A train station is where the train stops. A bus station is where the bus stops. A work station...
  • A picture is worth a thousand words, 1000 words takes about 5K, therefore no picture should be larger than 5K.
  • I wish I were what I was when I wished I were what I am.
  • Artificial intelligence usually beats real stupidity.
  • CAPS LOCK – Preventing Login Since 1980.
  • The truth is out there. Anybody got the URL?
  • The Internet: where men are men, women are men, and children are FBI agents.
varunchandak /
Last active April 20, 2022 08:05
delete unused aws iam roles using aws cli
aws iam list-roles --max-items 1000 | jq -r '.Roles[]|[.RoleName, .Arn, .CreateDate]|@csv' | grep -v -e '/aws-service-role/' -e '"AWSServiceRoleFor' -e '/aws-reserved/' | tr -d '"' | cut -d, -f1 | while read ROLE_NAME; do
echo "$ROLE_NAME"
aws iam get-role --role-name "$ROLE_NAME" | jq -r '.Role|.CreateDate, .RoleLastUsed.LastUsedDate // "UNUSED"'
done | paste -d, - - - | grep ",UNUSED$" | cut -d, -f1 | while read UNUSED_ROLE_NAME; do
echo "$UNUSED_ROLE_NAME is unused"
aws iam list-attached-role-policies --role-name "$UNUSED_ROLE_NAME" | jq -r '.AttachedPolicies[].PolicyArn' | while read ATTACHED_POLICY; do
aws iam detach-role-policy --role-name "$UNUSED_ROLE_NAME" --policy-arn "$ATTACHED_POLICY"