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 bisect | |
import itertools | |
import operator | |
class _BNode(object): | |
__slots__ = ["tree", "contents", "children"] | |
def __init__(self, tree, contents=None, children=None): | |
self.tree = tree |
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/python | |
''' Not my script, found on the Internet, and rediscovered on my hard drive | |
''' | |
import sys | |
def cidr_to_regex(cidr): | |
ip, prefix = cidr.split('/') | |
base = 0 | |
for val in map(int, ip.split('.')): |
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
--- | |
# This has been tested with ansible 1.3 with these commands: | |
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=false" | |
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=true" | |
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts" | |
# NB: The type of the variable is crucial! | |
- name: Ansible Conditionals Examples | |
hosts: $hosts | |
vars_files: |
- S3の'Static Website Hosting'を有効にする
- 'Edit Redirection Rules'を編集する
- 'bucket policy'を編集する
- CLoudFrontのOriginにS3の'Static Website Hosting'のEndpointを指定する
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
sudo git clone https://github.com/tokuhirom/plenv.git /usr/local/plenv | |
sudo mkdir /usr/local/plenv/plugins | |
sudo git clone https://github.com/tokuhirom/Perl-Build.git /usr/local/plenv/plugins/perl-build | |
sudo sh -c 'PLENV_ROOT=/usr/local/plenv PATH="$PLENV_ROOT/bin/:$PLENV_ROOT/shims:$PATH" plenv install 5.18.2' | |
sudo sh -c 'PLENV_ROOT=/usr/local/plenv PATH="$PLENV_ROOT/bin/:$PLENV_ROOT/shims:$PATH" plenv install 5.20.1' | |
sudo sh -c 'PLENV_ROOT=/usr/local/plenv PATH="$PLENV_ROOT/bin/:$PLENV_ROOT/shims:$PATH" plenv install-cpanm' |