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
| bash -c ' | |
| <%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%> | |
| if [ ! -f /usr/bin/chef-client ]; then | |
| apt-get update | |
| apt-get install -y libreadline5 libruby1.9.1 ruby1.9.1 ruby1.9.1-dev build-essential wget rubygems1.9.1 | |
| fi | |
| LC_CTYPE=en_US.UTF-8 LANG=en_US.UTF-8 export LC_CTYPE LANG |
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
| #! /bin/sh | |
| PATH=/usr/sbin:/sbin:/usr/bin:/bin | |
| cat <<EOF > /etc/apt/apt.conf.noninteractive | |
| APT::Get::Assume-Yes "true"; | |
| APT::Get::Show-Upgraded "true"; | |
| APT::Quiet "true"; | |
| DPkg::Options {"--force-confmiss";"--force-confold"}; | |
| DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";}; |
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
| class Chef | |
| class Recipe | |
| def has_remote_file_modified(uri, filepath) | |
| require 'net/http' | |
| http = Net::HTTP.new(uri.host, uri.port) | |
| req = Net::HTTP::Head.new(uri.path) | |
| if uri.user | |
| req.basic_auth uri.user, uri.password | |
| end |
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 argparse | |
| parser = argparse.ArgumentParser(description='Spawn an army of test-robot ' | |
| 'agents for the purpose of automated testing') | |
| parser.add_argument('-c', '--create-test', action='store_true', | |
| help='Create a new test...') | |
| parser.add_argument('-t', '--test-case', dest='testcase', | |
| default="robot_script.json" help='Test case file name (i.e. robot_script.json)') | |
| # the default action here is to store False in opts.dumptest, and is not |
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
| def json_diff(obj, other, order_matters=True): | |
| """ This method assumes json types: dict, list, strings, numbers, booleans and null """ | |
| if isinstance(obj, dict) and isinstance(other, dict): | |
| if set(obj.keys()) != set(other.keys()): | |
| return True | |
| for key in sorted(obj.keys()): | |
| if json_diff(obj[key], other[key], order_matters): | |
| return True | |
| elif isinstance(obj, list) and isinstance(other, list): |
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
| class Observable: | |
| '''Mixin for objects that need to be observed.''' | |
| _observers = None | |
| def observe(self, observer): | |
| if not self._observers: | |
| self._observers = [] | |
| self._observers.append(observer) |
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
| client | |
| dev tap | |
| proto tcp | |
| remote 50.112.165.49 443 | |
| resolv-retry infinite | |
| nobind | |
| persist-key | |
| persist-tun | |
| ca ca.crt | |
| cert vagrant-eric_plaster.crt |
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 suds | |
| WSDL_URL = "http://mycompany.qmetry.com/myid/WEB-INF/ws/service.php?wsdl" | |
| class QMetry(object): | |
| def __init__(self, timeout=90): | |
| client = suds.client.Client(WSDL_URL) | |
| self.service = client.service |
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
| from IPython.core.completer import IPCompleter | |
| from IPython.config.loader import Config | |
| import rl | |
| def setup_ipython(): | |
| try: | |
| get_ipython() | |
| except NameError: |
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
| tell application "iPhone Simulator" | |
| activate | |
| end tell | |
| tell application "System Events" | |
| tell process "iPhone Simulator" | |
| tell menu bar 1 | |
| tell menu 2 | |
| click menu item 5 | |
| end tell | |
| end tell |
OlderNewer