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
- hosts: localhost | |
gather_facts: false | |
vars: | |
targets: | |
- instance_id: 1 | |
instance_type: r4.large | |
- instance_id: 2 | |
instance_type: r5.large |
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
- hosts: targets | |
become: yes | |
tasks: | |
- name: Get UTC date | |
command: date -u '+%Y-%m-%d' | |
check_mode: no | |
changed_when: no | |
register: utc_date | |
- debug: |
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
{ | |
"id": "...", | |
"version": "1.0", | |
"type": "", | |
"type.version": "1.05", | |
"data": { | |
} | |
} |
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 math | |
N = 10 | |
arr = [1] * 22 | |
parts = [arr[(i*N):((i+1)*N)] for i in range(0, int(math.ceil(len(arr)/float(N))))] | |
for part in parts: | |
print(part) |
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 boto3 | |
from botocore.exceptions import ClientError | |
client = boto3.client('s3') | |
try: | |
client.get_bucket_cors(Bucket='unknown-bucket') | |
except ClientError as e: | |
print e |
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
jenkins.model.Jenkins.instance.items.each { | |
println "\nJob: ${it.name}" | |
it.disabled = true | |
} |
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
# encoding: utf-8 | |
class CyclicBarrier | |
def initialize(n) | |
@n = n | |
@await_count = 0 | |
@mutex = Mutex.new | |
@var = ConditionVariable.new | |
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 os | |
from tempfile import gettempdir | |
from ansible.module_utils.basic import AnsibleModule | |
class BasicFile(object): | |
def __init__(self, path): | |
self.path = path | |
def exists(self): | |
return os.path.exists(self.path) |
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 os | |
from tempfile import gettempdir | |
from ansible.module_utils.basic import AnsibleModule | |
def read(path): | |
with open(path, 'r') as f: | |
return f.read() | |
def write(path, text): |
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
Show hidden characters
{ | |
"env": { | |
"es6": true, | |
"node": true | |
}, | |
"extends": "eslint:recommended", | |
"parserOptions": { | |
"ecmaVersion": 2017 | |
}, | |
"rules": { |