Skip to content

Instantly share code, notes, and snippets.

View amgdy's full-sized avatar
πŸ‘¨β€πŸ’»

Ahmed Magdy πŸ‡ͺπŸ‡¬ amgdy

πŸ‘¨β€πŸ’»
View GitHub Profile
@amgdy
amgdy / create_github_runners_hostedcompute_nsg.sh
Created October 22, 2024 20:31
Create the Azure Network Security Group to run GitHub-hosted runners inside Azure VNET. This enables you to use GitHub-managed infrastructure for CI/CD while providing you with full control over the networking policies of your runners.
#!/bin/bash
# Exit immediately if a command exits with a non-zero status
set -e
# Variables
# Prompt the user for input
read -rp "Enter the resource group name: " resourceGroup
read -rp "Enter the location: " location
read -rp "Enter the NSG name: " nsgName
@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)