Skip to content

Instantly share code, notes, and snippets.

@ellieayla
ellieayla / eventhub-send-deadlock.py
Created March 7, 2020 17:53
eventhub-send-deadlock-issue
import logging
import time
import json
from azure.eventhub import EventHubProducerClient, EventData
CONNECTION_STRING='Endpoint=sb://example.servicebus.windows.net/;SharedAccessKeyName=someone;SharedAccessKey=secret'
EVENTHUB_NAME='example'
@ellieayla
ellieayla / namespace-permission-test.yaml
Created May 13, 2019 17:03
A ServiceAccount in a namespace can be given permissions to act in another namespace.
### Can a ServiceAccount in a namespace be given permissions to act in another namespace?
# Answer: Yes. A RoleBinding in one namespace can cite a ServiceAccount in *any* namespace.
### Test
# $ kubectl apply -f namespace-permission-test.yaml
### Manifests
@ellieayla
ellieayla / k-k-issue-73541.md
Last active April 15, 2022 00:58
kubernetes/kubernetes issue 73541
@ellieayla
ellieayla / pycharm_community_url.py
Created January 28, 2018 06:34
Direct download url for the latest PyCharm Community Edition.
#!/usr/bin/env python
"""
The JetBrains Toolbox app fetches (xz-compressed) json feeds inside ASN.1 signedData.
Retrieve the feed and locate the direct download url for the latest PyCharm Community Edition.
"""
from __future__ import print_function
import json
#!/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"