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
#!/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 | |
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
# 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" |
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
#!/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 |
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
#!/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): |
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
#!/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,), {}) | |
NewerOlder