This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"final_space": true, | |
"console_title": true, | |
"console_title_style": "folder", | |
"blocks": [ | |
{ | |
"type": "prompt", | |
"alignment": "left", | |
"horizontal_offset": 0, | |
"vertical_offset": 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |