Skip to content

Instantly share code, notes, and snippets.

View ArmaanMcleod's full-sized avatar
🚀
Azure

Armaan Mcleod ArmaanMcleod

🚀
Azure
View GitHub Profile
@ArmaanMcleod
ArmaanMcleod / download-youtube-video.py
Last active December 17, 2023 13:16
Download 720/1080p YouTube Video Script
import pytube
import ssl
import sys
import ffmpeg
import argparse
import os
ssl._create_default_https_context = ssl._create_stdlib_context
parser = argparse.ArgumentParser(description = 'Youtube Video Downloader')
@ArmaanMcleod
ArmaanMcleod / subnet-overlap.ps1
Last active May 6, 2023 11:51
PowerShell Subnet Overlap
function ConvertTo-IPv4MaskString {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[ValidateRange(0, 32)]
[int]
$MaskBits
)
$mask = ([System.Math]::Pow(2, $MaskBits) - 1) * [System.Math]::Pow(2, (32 - $MaskBits))
$bytes = [System.BitConverter]::GetBytes([UInt32] $mask)
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
@ArmaanMcleod
ArmaanMcleod / Microsoft.PowerShell_profile.ps1
Last active February 19, 2022 07:31
Oh my posh PowerShell Profile Windows
#Requires -Modules Terminal-Icons
#Requires -Modules posh-git
#Requires -Modules PSReadline
#Requires -Modules DockerCompletion
# Init Oh My Posh with config
oh-my-posh --init --shell pwsh --config "${env:USERPROFILE}\ohmyposhv3-2.json" | Invoke-Expression
# Import icons, Posh GIT, Docker completion and PSReadLine
Import-Module Terminal-Icons
#!/bin/bash
if [ "$#" -ne 2 ] || [ $EUID -ne 0 ]; then
echo "usage: sudo ./azure-disk-setup.sh [device name] [mount point]"
exit 1
fi
DEVICE_NAME=$1
MOUNT_POINT=$2
@ArmaanMcleod
ArmaanMcleod / download.py
Created April 17, 2020 05:53
Basic function for downloading file over HTTP
from pathlib import Path
from requests import get
from requests.exceptions import HTTPError
def download_file(url, chunk_size=1024):
filename = Path(url).name
if not Path(filename).exists():
try:
with get(url, stream=True) as req: