Skip to content

Instantly share code, notes, and snippets.

View varunchandak's full-sized avatar
Working from home

Varun Chandak varunchandak

Working from home
View GitHub Profile
varunchandak /
Created April 20, 2024 18:49
Join Multiple Videos for YouTube (with chapters)

Video Concatenation Guide with FFmpeg

This guide provides instructions on how to concatenate multiple video files using FFmpeg, add a black screen between each video, and address common timestamp issues during the concatenation process.


  • FFmpeg installed on your system.
  • Videos to be concatenated should be in the same codec, resolution, and frame rate.


varunchandak /
Created April 16, 2024 07:59
Fetch Inactive users in Azure Entra ID Tenant for last N days

Azure Inactive User Audit Tool

This tool helps identify inactive users in an Azure AD environment by utilizing Azure CLI to fetch sign-in logs and a Python script to analyze these logs.


  • Azure CLI Command: Fetches sign-in activity logs.
    az monitor activity-log list --offset 180d --query "[?contains(operationName.value, 'SignIn')]"
  • Python Script: Analyzes sign-in logs to determine which users have not been active within a specified number of days.
varunchandak /
Last active March 15, 2024 05:08

AWS Organization Handshake Management Script

This script is designed to manage AWS Organization handshakes by filtering for open invitations and then canceling and re-inviting the accounts. It automates the process of handling account invitations within an AWS Organization, ensuring that only current and relevant invitations are active.


  • Filter Open Invitations: The script filters for handshakes that are in an 'OPEN' state and of the 'INVITE' action type, indicating pending invitations.
  • Cancel and Re-invite: For each open invitation, the script cancels the existing handshake and immediately sends a new invitation to the account.

How It Works

varunchandak /
Last active March 15, 2024 06:25
4-wheeler PDI Checklist

Thanks to Team-BHP and other internet resources

  • From Outside Perspective (Body):
    • Check for scratches, dents, or paint defects.
    • Tires:
      • Pressure
      • Manufacturing date: Locate the DOT (Department of Transportation) code on the sidewall of each tire. The last four digits of this code represent the week and year of manufacture. For instance, "5219" would indicate the tire was made in the 52nd week of 2019.
      • Inspect the tires for any signs of aging or deterioration, even if they are new. Tires degrade over time, not just with usage.
    • Verify that all lights (headlights, tail lights, turn signals) are functioning.
  • Ensure the windshield and windows are free from cracks or chips.
varunchandak /
Created January 15, 2024 07:03
Azure AD User Update Script

Azure AD User Update Script


This PowerShell script is designed to connect to Azure Active Directory (Azure AD) and update user profiles by removing the company name from each user's profile. It reads email addresses from a specified CSV file and processes each user found in Azure AD.


  • PowerShell 5.1 or higher
  • Azure Active Directory Module for Windows PowerShell
varunchandak /
Created January 14, 2024 10:56
Google Cloud Organization Folders Listing Script

Google Cloud Organization Folders Listing Script

This script is designed to recursively list all folders within a specified Google Cloud Organization. It utilizes the gcloud command-line tool to fetch and display the folder hierarchy.


Before running this script, ensure that you have the following prerequisites installed:

  1. Google Cloud SDK
  2. Bash shell (usually pre-installed on Linux and macOS)
varunchandak /
Created October 20, 2023 04:45
A Bash script to convert an image to a square by adding equal padding to its shorter dimension using ImageMagick.

Image Square Padding Script

This script takes an image as input and converts it into a square by adding equal padding to its shorter dimension. It utilizes ImageMagick for image processing.


./ [input_image] [output_image]


  • ImageMagick
varunchandak / GCP App Engine Static
Last active March 9, 2023 09:27
GCP App Engine Static Website app.yaml


  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

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
  • 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.