Skip to content

Instantly share code, notes, and snippets.

View briglx's full-sized avatar

Brig Lamoreaux briglx

View GitHub Profile
@briglx
briglx / List of Preposistions
Created January 17, 2022 00:30
List of Preposisions
aboard
about
above
according to
across
after
against
ahead of
along
amid
@briglx
briglx / main.html
Created June 3, 2021 23:18
Mono select Card Game
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.row{
display:flex;
@briglx
briglx / ffmpeg_tools.sh
Created September 20, 2020 14:30
Various ffmpeg commands to convert video and images
# Rotate movie 90 degress
ffmpeg.exe -i input.MOV -vf "transpose=1" output.mp4
# Convert to differnt type
ffmpeg.exe -i input.MOV -q:v 0 output.mp4
# Resize and add black bars
ffmpeg.exe -i input.MOV -vf "scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1" output.mp4
# Convert heic to tiff
@briglx
briglx / buggy_copy_blob_example.py
Created November 20, 2019 21:00
Buggy Example of Copying Blob files
connection_string = "connection string to my dest blob storage account"
container_name = "myContainerName"
dest_file_name = "myDestFile.csv"
remote_blob_url = "http://path/to/remote/blobfile.csv"
client = BlobServiceClient.from_connection_string(connection_string)
dest_blob = client.get_blob_client(container_name, dest_file_name)
resp = requests.get(blob_url, stream=True)
total_size = int(resp.headers.get("content-length", 0))
@briglx
briglx / AuditAzurePolicies.ps1
Created November 20, 2019 17:21
Audit Azure Policies
Get-AzPolicyAssignment | Select-Object -Property Name, ResourceName, Location, @{Name="Scope";Expression={(Select-Object -InputObject $_.Properties.Scope)}}, @{Name="Description";Expression={(Select-Object -InputObject $_.Properties.Description)}}
@briglx
briglx / getcpu.ps
Last active October 2, 2019 16:49
Get VM CPU for the past week
Connect-AzAccount
$vms = Get-AzVm
$Report = @()
foreach ($vm in $vms) {
$rid = $vm.id
$cpu = Get-AzMetric -ResourceId $rid -TimeGrain 00:15:00 -StartTime 2019-09-22T12:00:00Z -EndTime 2019-09-28T23:59:59Z -WarningAction silentlyContinue
try {
$null = Get-AzureRmSubscription
}
catch {
Login-AzureRmAccount
}
try {
$null = Get-AzureSubscription
}
@briglx
briglx / removedup.py
Created October 26, 2018 22:24
Remove duplicate files
import sys
import os
import hashlib
def chunk_reader(fobj, chunk_size=1024):
"""Generator that reads a file in chunks of bytes"""
while True:
chunk = fobj.read(chunk_size)
if not chunk:
return
@briglx
briglx / slurpBlogger.py
Last active January 29, 2019 21:54
Script to slurp blog posts from blogger
#!/usr/bin/env python3
"""Slurp all Images and text from the blog into a folder."""
from urllib.request import urlopen, urlretrieve
from bs4 import BeautifulSoup
from datetime import datetime
import os
import re
import os.path
@briglx
briglx / fetch_azure_billing_detail.ps
Created October 16, 2017 20:12
Fetch Azure Monthly Report
#!/bin/bash
# Replace the placeholders with your access token and ea number
# Replace the date with the month you are interested in YYYY-MM
wget -d --header="authorization: bearer REPLACE_WITH_ACCESS_TOKEN" --header="api-version: 1.0" -O usagereport.csv "https://ea.azure.com/rest/REPLACE_WITH_EA_NUMBER/usage-report?month=2017-10&type=detail&fmt=Csv"