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
| { | |
| "Version": "2012-10-17", | |
| "Id": "Policy1504640911349", | |
| "Statement": [ | |
| { | |
| "Sid": "Stmt1504640908907", | |
| "Effect": "Deny", | |
| "Principal": "*", | |
| "Action": "s3:GetObject", | |
| "Resource": "arn:aws:s3:::/*", |
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
| { | |
| "Version": "2012-10-17", | |
| "Id": "Policy1415115909153", | |
| "Statement": [ | |
| { | |
| "Sid": "Access-to-specific-VPC-only", | |
| "Principal": "*", | |
| "Action": "s3:*", | |
| "Effect": "Deny", | |
| "Resource": ["arn:aws:s3:::examplebucket", |
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
| { | |
| "Version": "2012-10-17", | |
| "Id": "Policy1415115909152", | |
| "Statement": [ | |
| { | |
| "Sid": "Access-to-specific-VPCE-only", | |
| "Principal": "*", | |
| "Action": "s3:*", | |
| "Effect": "Deny", | |
| "Resource": ["arn:aws:s3:::examplebucket", |
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
| { | |
| "Version":"2008-10-17", | |
| "Id":"", | |
| "Statement":[ | |
| { | |
| "Sid":"Stmt123", | |
| "Effect":"Allow", | |
| "Principal":{ | |
| "AWS":"arn:aws:iam::source-bucket-owner-AWS-acct-ID:root" | |
| }, |
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
| { | |
| "Version": "2012-10-17", | |
| "Id": "PutObjPolicy", | |
| "Statement": [ | |
| { | |
| "Sid": "DenyIncorrectEncryptionHeader", | |
| "Effect": "Deny", | |
| "Principal": "*", | |
| "Action": "s3:PutObject", | |
| "Resource": "arn:aws:s3:::<bucket_name>/*", |
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
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Action": ["s3:ListBucket"], | |
| "Effect": "Allow", | |
| "Resource": ["arn:aws:s3:::my-testiamuser-home-folder-bucket"], | |
| "Condition": {"StringLike": {"s3:prefix": ["${aws:username}/*"]}} | |
| }, | |
| { |
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
| #!/usr/bin/env python | |
| """ | |
| USAGE: | |
| logparsing_apache.py apache_log_file | |
| This script takes apache log file as an argument and then generates a report, with hostname, | |
| bytes transferred and status | |
| """ | |
| import sys | |
| def apache_output(line): | |
| split_line = line.split() |
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
| # kubeadm join 172.31.16.235:6443 --token XXXXXXXXX \ | |
| > --discovery-token-ca-cert-hash sha256:d21bd6cf64da2eda73bf4c1039f55038e144eea2cca9f3f2f0615d85ed9aae77 | |
| [preflight] Running pre-flight checks | |
| [preflight] Reading configuration from the cluster... | |
| [preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml' | |
| [kubelet-start] Downloading configuration for the kubelet from the "kubelet-config-1.14" ConfigMap in the kube-system namespace | |
| [kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml" | |
| [kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env" | |
| [kubelet-start] Activating the kubelet service | |
| [kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap... |
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
| # kubeadm init --pod-network-cidr=10.244.0.0/16 | |
| [init] Using Kubernetes version: v1.14.1 | |
| [preflight] Running pre-flight checks | |
| [preflight] Pulling images required for setting up a Kubernetes cluster | |
| [preflight] This might take a minute or two, depending on the speed of your internet connection | |
| [preflight] You can also perform this action in beforehand using 'kubeadm config images pull' | |
| [kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env" | |
| [kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml" | |
| [kubelet-start] Activating the kubelet service | |
| [certs] Using certificateDir folder "/etc/kubernetes/pki" |
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
| #!/usr/bin/env bash | |
| servicename="httpd" | |
| if (( $(ps -ef | grep -v grep | grep $servicename | wc -l) > 0 )) | |
| then | |
| echo "$servicename is running!!!" | |
| else | |
| echo "$servicename is not running" | mail -s "$servicename is down" laprashant@gmail.com | |
| systemctl start $servicename | |
| fi |