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
varunchandak / join-multiple-vids-for-youtube.md
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.

Requirements

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

Steps

@varunchandak
varunchandak / inactive-users-N-days.md
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.

Functionality

  • 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
varunchandak / car-pdi-checklist.md
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
varunchandak / aws-org-reinvite-accounts-to-org.md
Last active March 15, 2024 05:08
aws-org-reinvite-accounts-to-org

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.

Features

  • 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
varunchandak / azure-ad-user-update-script.md
Created January 15, 2024 07:03
Azure AD User Update Script

Azure AD User Update Script

Overview

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.

Prerequisites

  • PowerShell 5.1 or higher
  • Azure Active Directory Module for Windows PowerShell
@varunchandak
varunchandak / gcp-org-folders-listing-script.md
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.

Installation

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
varunchandak / make_square.md
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.

Usage

./make_square.sh [input_image] [output_image]

Requirements

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

Steps

  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
varunchandak / funny-technical-quips.md
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
varunchandak / create permanently delete user in powershell.md
Last active January 3, 2023 09:39
create permanently delete user in powershell
Connect-MsolService

New-MsolUser -DisplayName "User Name" -FirstName User -LastName Name -UserPrincipalName username@yourdirectory.onmicrosoft.com

get-msoluser -UserPrincipalName username@yourdirectory.onmicrosoft.com | select *immutableid*

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

get-msoluser -UserPrincipalName username@yourdirectory.onmicrosoft.com | select *immutableid*