Skip to content

Instantly share code, notes, and snippets.

View 100daysofdevops's full-sized avatar
🎯
Focusing

100daysofdevops

🎯
Focusing
View GitHub Profile
{
"source": [
"aws.guardduty"
],
"detail": {
"type": [
"UnauthorizedAccess:EC2/MaliciousIPCaller.Custom"
]
}
}
[ec2-user@ip-10-0-1-81 ~]$ sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport fs-0b988ba3.efs.us-west-2.amazonaws.com:/ /mnt
[ec2-user@ip-10-0-1-81 ~]$ df -TH
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 507M 66k 506M 1% /dev
tmpfs tmpfs 517M 0 517M 0% /dev/shm
/dev/xvda1 ext4 8.4G 1.5G 6.8G 18% /
fs-0b988ba3.efs.us-west-2.amazonaws.com:/ nfs4 9.3E 0 9.3E 0% /mnt
resource "aws_s3_bucket" "bucket" {
bucket = "terraform-20190327040316452900000001"
acl = "private"
lifecycle_rule {
enabled = true
transition {
days = 30
storage_class = "STANDARD_IA"
resource "aws_vpc_endpoint" "s3" {
vpc_id = "${var.vpc_id}"
service_name = "com.amazonaws.us-west-2.s3"
policy = <<POLICY
{
"Statement": [
{
"Action": "*",
"Effect": "Allow",
resource "aws_instance" "my-test-instance" {
ami = "${var.test_ami}"
instance_type = "${var.instance_type}"
iam_instance_profile = "${aws_iam_instance_profile.my-test-profile.name}"
key_name = "vpcflowlogs"
disable_api_termination = false
tags {
Name = "my-test-instance"
}
provider "aws" {
region = "us-west-2"
}
provider "aws" {
alias = "east"
region = "us-east-1"
}
resource "aws_iam_role" "my-replication-role" {
#!/usr/bin/env bash
function servicecheck()
{
ps aux | grep -v grep |grep $1 >/dev/null
if [ $? != 0 ]
then
echo $1 "is not running";
systemctl start $1
else
echo $1 "is up and running";
#!/usr/bin/env bash
servicename="httpd"
if (( $(ps -ef | grep -v grep | grep $servicename | wc -l) > 0 ))
then
echo "$servicename is running!!!"
else
systemctl start $servicename
fi
#!/usr/bin/env bash
SERVICENAME="httpd"
netstat -antulp|grep "$SERVICENAME"
SERVICESTATUS=`echo $?`
if [ "$SERVICESTATUS" != 0 ]
then
systemctl start $SERVICENAME
echo "$SERVICENAME started"
else
echo "$SERVICENAME is already running"
$ docker build -t mynodejsapp:1.0 .
Sending build context to Docker daemon 67.58 kB
Step 1/7 : FROM node:7
Trying to pull repository docker.io/library/node ...
7: Pulling from docker.io/library/node
ad74af05f5a2: Pull complete
2b032b8bbe8b: Pull complete
a9a5b35f6ead: Pull complete
3245b5a1c52c: Pull complete
afa075743392: Pull complete