Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
HOSTS=host_a host_b | |
INVENTORY=../data/inventory.inv | |
PLAYBOOK=../playbooks/test.yml | |
TIMEOUT=600 | |
deploy: all_hosts | |
all_hosts: $(HOSTS) | |
$(HOSTS): |
import boto3 | |
import base64 | |
if __name__ == '__main__': | |
session = boto3.session.Session() | |
kms = session.client('kms') | |
encrypted_password = 'AQECAHjgTiiE7TYRGp5Irf8jQ3HzlaQaHGYgsUJDaavnHcFm0gAAAGswaQYJKoZIhvcNAQcGoFwwWgIBADBVBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDDwxVQuG0oVwpkU7nQIBEIAoVGk1/wpserb+GVUOzE7PiL/Nr9fTDFKZfpKpF0ip2ct4B2q0Wn6ZZw==' | |
binary_data = base64.b64decode(encrypted_password) |
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.
However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on
Copy, with line wrapping!
If you've been trying to copy/paste text from a multi-pane tmux
session with the mouse, you've probably been pretty pissed at the blissful ignorance a terminal application has of the rodent in your hand.
The alternative, which is quote-unqoute native copy/pasting using copy-mode takes a bit to get used to. So this is one solution for copying and pasting lines from a session with correct line wrapping behaviour, albeit keyboard only.
Disclaimer
Since copy-mode has similar concepts of marks, regions, and temp buffers to Emacs .. you'll probably find it straight forward if you're familar with Emacsen. For people using vi-mode in tmux
, the same still applies but obviously the default key bindings will differ alot from what I show below.
#!/usr/bin/env python | |
import boto | |
from boto.route53.record import ResourceRecordSets | |
import logging | |
conn = boto.connect_ec2() | |
DNS_EXCLUSION_TAG = 'ExcludeFromDNS' # If this tag exists on an instance, no DNS values will be populated | |
DNS_TAGS = ['ShortName', 'Name'] # This is the list of instance tags we want to populate DNS entries from | |
DNS_SUFFIX = 'YOUR_SUBDOMAIN_HERE' # Suffix under which to create DNS records | |
ROUTE53_ZONE_ID = 'YOUR_ZONE_ID_HERE' # The zone id from route53 of the zone we will be adding these entries under |
#in controller test | |
# response.body.should be_valid_json | |
RSpec::Matchers.define :be_valid_json do | |
match do |actual| | |
JSON.parse(actual) | |
end | |
end |
{ | |
"id":"dbauser", | |
"uid":506, | |
"comment":"DBA User", | |
"shell":"/bin/bash", | |
"groups": [ | |
"sysadm", | |
"dba" | |
], | |
"ssh_key": "XXXXXXXXXX" |
DEBDIR=deb-build | |
create-package-deb: pre-create-package VERSION xdo_version.h | |
[ -d $(DEBDIR) ] && rm -r $(DEBDIR) | |
$(MAKE) install DESTDIR=$(DEBDIR) PREFIX=/usr INSTALLMAN=/usr/share/man | |
$(MAKE) create-package-deb-xdotool | |
# Package 'xdotool*.deb' | |
create-package-deb-xdotool: $(DEBDIR)/usr $(DEBDIR)/xdotool | |
$(MAKE) $(DEBDIR)/xdotool/data.tar.gz $(DEBDIR)/xdotool/control.tar.gz \ | |
$(DEBDIR)/xdotool/debian-binary |