Skip to content

Instantly share code, notes, and snippets.

View pekeq's full-sized avatar

Hideo Matsumoto pekeq

  • Amazon Web Services Japan
  • Tokyo, Japan
  • X @pekeq
View GitHub Profile
@ianblenke
ianblenke / .ebextensions_00_tune_ec2.config_.yaml
Created July 23, 2015 19:12
Tuning EC2 with an ElasticBeanstalk ebextension
packages:
yum:
wget: []
curl: []
commands:
00_remove_99_swap.conf.bak:
command: rm -f /etc/sysctl.d/99_swap.conf.bak
test: test -f /etc/sysctl.d/99_swap.conf.bak
ignoreErrors: true
00_remove_99_filesystem.conf.bak:
#!/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('.')):