Skip to content

Instantly share code, notes, and snippets.

View amgdy's full-sized avatar

Ahmed Magdy amgdy

View GitHub Profile
@amgdy
amgdy / create_apim_internal_nsg.sh
Last active August 10, 2024 18:52
Shell script to create an Azure Network Security Group (NSG) for Azure API Management with the internal VNet injection mode
#!/bin/bash
# Description:
# This script creates an Azure Network Security Group (NSG) specifically for Azure API Management
# configured with the "internal" VNet injection mode. This mode allows access only from internal
# sources. The script includes rules for load balancing, storage access, SQL database access,
# Key Vault access, and monitoring services.
#
# Usage:
# The script will prompt for the Azure resource group name, location, and NSG name.
@amgdy
amgdy / create_apim_external_nsg.sh
Last active August 10, 2024 18:53
Shell script to create an Azure Network Security Group (NSG) for Azure API Management with the *external* VNet injection mode.
#!/bin/bash
# Description:
# This script creates an Azure Network Security Group (NSG) specifically for Azure API Management
# configured with the "external" VNet injection mode. This mode allows access from both external
# and internal sources. The script includes rules for API management, load balancing, storage access,
# SQL database access, Key Vault access, and monitoring services.
#
# Usage:
# The script will prompt for the Azure resource group name, location, and NSG name.
@amgdy
amgdy / Publish-NpmPackages.ps1
Last active June 11, 2023 18:11
Publish NPM packages to local registry and modify the tarball if it has a custom registry like wombat-dressing-room.appspot.com
# Set the path to the folder containing tarball files
$folderPath = "path/to/folder"
# Get the list of tarball files with .tgz extension in the folder
$tarballFiles = Get-ChildItem -Path $folderPath -File -Recurse -Filter "*.tgz" | Where-Object { !$_.PSIsContainer }
foreach ($tarballFile in $tarballFiles) {
# Get the directory and base name of the tarball file
$tarballDirectory = Split-Path -Parent $tarballFile.FullName
$tarballBaseName = [System.IO.Path]::GetFileNameWithoutExtension($tarballFile.FullName)