This file contains hidden or 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
| import aiohttp | |
| import asyncio | |
| import json | |
| async def get_vcenter_token(session, vcenter_url, username, password): | |
| url = f"{vcenter_url}/rest/com/vmware/cis/session" | |
| async with session.post(url, auth=aiohttp.BasicAuth(username, password)) as response: | |
| if response.status == 200: | |
| data = await response.json() | |
| return data['value'] |
This file contains hidden or 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
| #define _GNU_SOURCE | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> | |
| #include <sys/types.h> | |
| #include <sys/stat.h> | |
| #include <fcntl.h> | |
| #include <linux/capability.h> | |
| #include <sys/capability.h> |
This file contains hidden or 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 | |
| import tarfile | |
| #import requests | |
| # This class won't be needed if we create TarInfo objects manually as described below. | |
| class DummyFile(object): | |
| def __init(self): |
This file contains hidden or 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 | |
| import json | |
| import shutil | |
| from collections import namedtuple | |
| from ansible.parsing.dataloader import DataLoader | |
| from ansible.vars.manager import VariableManager | |
| from ansible.inventory.manager import InventoryManager | |
| from ansible.playbook.play import Play | |
| from ansible.executor.task_queue_manager import TaskQueueManager |
This file contains hidden or 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
| # Based on local.py (c) 2012, Michael DeHaan <[email protected]> | |
| # Based on chroot.py (c) 2013, Maykel Moya <[email protected]> | |
| # Based on func.py | |
| # (c) 2014, Michael Scherer <[email protected]> | |
| # (c) 2017 Ansible Project | |
| # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) | |
| from __future__ import (absolute_import, division, print_function) | |
| __metaclass__ = type |
This file contains hidden or 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
| frontend http | |
| mode http | |
| bind :::80 v4v6 | |
| http-request lua.auth-request auth_request /is-allowed | |
| http-request deny if ! { var(txn.auth_response_successful) -m bool } | |
| backend auth_request | |
| mode http | |
| server auth_request 127.0.0.1:8080 |
This file contains hidden or 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/python2.7 | |
| # -*- coding: utf-8 -*- | |
| import zmq | |
| import msgpack | |
| root_file = '/var/cache/salt/master/.root_key' | |
| with open(root_file) as f: | |
| root_key = f.read() | |
| msg = {'load': {'tgt_type': 'list', 'jid': '', 'cmd': 'publish', 'tgt': ['salt-minion-01'], 'key': root_key, 'arg': [], 'fun': 'test.ping', 'kwargs': {'delimiter': ':', 'show_timeout': True, 'show_jid': False}, 'ret': '', 'user': 'root'}, 'enc': u'clear'} |
This file contains hidden or 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 | |
| # | |
| # Building a tar file chunk-by-chunk. | |
| # | |
| # taken from https://gist.github.com/chipx86/9598b1e4a9a1a7831054 | |
| # This is a quick bit of sample code for streaming data to a tar file, | |
| # building it piece-by-piece. The tarfile is built on-the-fly and streamed | |
| # back out. This is useful for web applications that need to dynamically | |
| # build a tar file without swamping the server. | |
| import os |
This file contains hidden or 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
| import xmlrpclib | |
| s = xmlrpclib.ServerProxy('http://localhost:3040') | |
| print s.pow(2,3) | |
| print s.sum([2,3]) | |
| print s.system.listMethods() |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <zabbix_export> | |
| <version>2.0</version> | |
| <date>2014-06-18T02:56:36Z</date> | |
| <groups> | |
| <group> | |
| <name>Templates</name> | |
| </group> | |
| </groups> | |
| <templates> |
NewerOlder