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
$the_cow = <<"EOC"; | |
$thoughts ^__^ | |
$thoughts ($eyes)\\_______ | |
(__)\\ (A) )\\/\\ | |
$tongue ||----w.| | |
|| || | |
EOC |
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
# Sample hosts file in INI format. | |
[webservers] | |
web1.example.com ansible_ssh_host=w1.example.net | |
web2.example.com ansible_ssh_port=1022 | |
[webservers:vars] # Comment on a section | |
webvar=blah # Comment on an option | |
[dbservers] |
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
iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1')) |
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
{ | |
"log": { | |
"id": "http://192.168.43.81:8080/api/collections/nodes/node1/log", | |
"name": "log" | |
}, | |
"tags": [], | |
"facts": { | |
"hardwareisa": "x86_64", | |
"macaddress": "08:00:27:e7:06:4d", | |
"architecture": "x86_64", |
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
--- | |
- hosts: windows | |
gather_facts: false | |
vars: | |
ansible_python_interpreter: python | |
tasks: | |
- win_chocolatey: | |
name: python2 | |
state: present |
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
# Custom Python social auth pipeline functions to fetch a GitHub user's orgs | |
# and teams. | |
def fetch_github_user_orgs(backend, details, user=None, *args, **kwargs): | |
if not user or not hasattr(backend, 'get_json'): | |
return | |
response = kwargs.get('response') or {} | |
if 'organizations_url' not in response or 'access_token' not in response: | |
return | |
orgs = backend.get_json(response['organizations_url'], |
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 | |
import os | |
import sys | |
def find_commands(management_dir): | |
# Modified version of function from django/core/management/__init__.py. | |
command_dir = os.path.join(management_dir, 'commands') | |
commands = [] | |
try: | |
for f in os.listdir(command_dir): |
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
--- | |
- hosts: all | |
connection: local | |
tasks: | |
- name: ping | |
action: ping |
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
import django.db.models.sql.aggregates | |
import django.db.models.aggregates | |
class AvgWithZeroForNull(django.db.models.sql.aggregates.Avg): | |
sql_template = 'COALESCE(%(function)s(%(field)s), 0)' | |
django.db.models.sql.aggregates.AvgWithZeroForNull = AvgWithZeroForNull | |
class AvgWithZeroForNull(django.db.models.aggregates.Avg): | |
name = 'AvgWithZeroForNull' | |
django.db.models.aggregates.AvgWithZeroForNull = AvgWithZeroForNull |
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
import threading | |
xmlsec_init_lock = threading.Lock() | |
xmlsec_initialized = False | |
import dm.xmlsec.binding | |
original_xmlsec_initialize = dm.xmlsec.binding.initialize | |
def xmlsec_initialize(*args, **kwargs): | |
global xmlsec_init_lock, xmlsec_initialized, original_xmlsec_initialize | |
with xmlsec_init_lock: |
OlderNewer