Skip to content

Instantly share code, notes, and snippets.

@puneetbharti
puneetbharti / subnetter.sh
Last active March 2, 2023 15:56
subnet calculator
if [ $# -ne 2 ]; then
echo "Please provide CIDR and number of subnets"
exit
fi
rx='^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$';
if ! [[ $1 =~ $rx ]];then
echo "Invalid CIDR";
exit
@puneetbharti
puneetbharti / s3-to-es-lamba.py
Created September 19, 2017 12:09 — forked from s-fujimoto/s3-to-es-lamba.py
Import Elasticsearch from ELB access log for AWS Lambda Function
##################################################
### Elasticsearch host name
ES_HOST = "search-******************.ap-northeast-1.es.amazonaws.com"
### Elasticsearch prefix for index name
INDEX_PREFIX = "awslogs"
#################################################
### ELB access log format keys
ELB_KEYS = ["timestamp", "elb", "client_ip", "client_port", "backend_ip", "backend_port", "request_processing_time", "backend_processing_time", "response_processing_time", "elb_status_code", "backend_status_code", "received_bytes", "sent_bytes", "request_method", "request_url", "request_version", "user_agent"]
Changes in Amazon Linux AMI Beta2 (v 2010.11):
Security Updates:
=================
* glibc package update
CVE-2010-3856: glibc: ld.so arbitrary DSO loading via LD_AUDIT in setuid/setgid programs
CVE-2010-3847: glibc: ld.so insecure handling of $ORIGIN in LD_AUDIT for setuid/setgid programs
* kernel package updates for
CVE-2010-3081: kernel: 64-bit Compatibility Mode Stack Pointer Underflow
CVE-2010-3301: kernel: IA32 System Call Entry Point Vulnerability