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
""" | |
Credits to @brool for the original class: https://github.com/brool/util/blob/master/php.py | |
I've only made alterations in the __submit method to use subprocess.Popen instead of popen2. I am also using json instead of simplejson | |
""" | |
import json | |
import subprocess | |
class PHP: | |
"""This class provides a stupid simple interface to PHP code.""" |
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/python | |
# Usage: kubectl get node [optional: name of node] -o json | python k8s_node_images.py | |
import sys | |
import json | |
data = json.load(sys.stdin) | |
try: | |
nodes = data['items'] | |
except KeyError: | |
nodes = [data] | |
for node in nodes: |