Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# I had a pile of http://fav.me/... urls in a text file, and wanted to retrieve the original files via OEMBED.
from urllib.parse import quote
from urllib.request import urlopen, urlretrieve
import json
import sys
@ellieayla
ellieayla / create-user-resource-pools.ps1
Created November 13, 2017 02:38
Create a vSphere Resource Pool for every user in an Active Directory group
# For every user with membership in an Active Directory group,
# ... create a vSphere Resource Pool named after the user
# ... give that user permissions to the resource pool and its childen.
Connect-VIServer vcsa-01a.corp.local
$poweruser = Get-VIRole "VirtualMachinePowerUser"
$adusers = Get-ADGroupMember "VMPowerUsers"
$newuserpool = Get-ResourcePool "NewUsers"
#!/usr/bin/env python
# https://www.reddit.com/r/Python/comments/6sx3xk/variable_being_treated_locally_when_should_be/
from __future__ import print_function
def Ocean(fake_argument_to_keep_the_signature_the_same):
from os import path # line 2
global path # line 6
#!/usr/bin/env python
from __future__ import print_function
import sys
from configparser import RawConfigParser, NoOptionError
from itertools import chain
import argparse
def strip_quotes(s):
@ellieayla
ellieayla / 5duj7z.py
Created November 20, 2016 00:37
Abstract Base Classes compatible with Python 2 and 3
#!/usr/bin/env python
# Abstract Base Classes compatible with Python 2 and 3.
# https://www.reddit.com/r/learnpython/comments/5duj7z/started_my_first_python_project_ever_need_help/
import abc
ABC = abc.ABCMeta('ABC', (object,), {})