Skip to content

Instantly share code, notes, and snippets.

View briglx's full-sized avatar

Brig Lamoreaux briglx

View GitHub Profile
@briglx
briglx / parse_azure_deployment.py
Created August 24, 2017 22:58
Parse the output from a call to the azure deployment api. Usage: azure group deployment operation list --name deploymentname --resource-group rgname | python parse_azure_deployment.py
#!/usr/bin/python
import json
import sys
from pprint import pprint
import fileinput
data = json.load(sys.stdin)
for d in data:
@briglx
briglx / ListAzureVms.ps1
Created October 18, 2016 15:52
List all VM on Azure
try {
$null = Get-AzureRmSubscription
}
catch {
Login-AzureRmAccount
}
$subscriptions = Get-AzureSubscription
find -name "*.jpg" | gawk 'BEGIN{ a=1}{printf "mv %s %5d.jpg\n", $0, rand()*100000000}' | bash
# First download an Azure Publish File
# Get-AzurePublishSettingsFile
# save the file somewhere special
#Import file
Import-AzurePublishSettingsFile \path\to\pushlish-settings-file.publishsettings
Login-AzureRmAccount
@briglx
briglx / mountNetworkShare.sh
Last active May 19, 2016 17:22
Bash script to mount Azure Storage File as network share
#!/bin/bash
# See for details https://azure.microsoft.com/en-us/documentation/articles/storage-how-to-use-files-linux/
sudo apt-get install cifs-utils
mkdir ~/myFolderName
sudo mount -t cifs //myAzureStorageAccountName.file.core.windows.net/myFileShareName ~/myFolderName -o vers=3.0,username=myAzureStorageAccountName,password=myAzureStorageAccountAccessKeyEndingIn==,dir_mode=0755,file_mode=0664
@briglx
briglx / mountNetworkShare.ps1
Last active May 19, 2016 17:22
Powershell script to mount Azure Storage File as network share
# For Details see https://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-files/
# Connect to share file
# Import required modules
Import-Module myAzureStorageAccountName.file.core.windows.net
# Add key to system so network share can reconnect when system restarts
cmdkey /add:myAzureStorageAccountName.file.core.windows.net /user:myAzureStorageAccountName /pass:myAzureStorageAccountAccessKeyEndingIn==
# Create the network share
@briglx
briglx / extract.py
Last active November 25, 2025 22:19
Extract Email from Outlook with Python
#!/usr/bin/python
"""Script to fetch email from outlook."""
import win32com.client
def extract(count):
"""Get emails from outlook."""
items = []
outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
inbox = outlook.GetDefaultFolder(6) # "6" refers to the inbox