Skip to content

Instantly share code, notes, and snippets.

View rav94's full-sized avatar
🎯
Focusing

Ravindu Fernando rav94

🎯
Focusing
View GitHub Profile
variable "AWS_ACCESS_KEY" {
}
variable "AWS_SECRET_KEY" {
}
variable "ATLAS_PUBLIC_KEY" {
}
variable "ATLAS_PRIVATE_KEY" {
provider "aws" {
region = var.AWS_REGION
access_key = var.AWS_ACCESS_KEY
secret_key = var.AWS_SECRET_KEY
}
provider "mongodbatlas" {
public_key = var.ATLAS_PUBLIC_KEY
private_key = var.ATLAS_PRIVATE_KEY
}
AWS_ACCESS_KEY = ""
AWS_SECRET_KEY = ""
ATLAS_PUBLIC_KEY = ""
ATLAS_PRIVATE_KEY = ""
@rav94
rav94 / logstash.conf
Created April 10, 2019 05:45
Logstash configuration for basic filebeat log collection
input {
beats {
port => 5044
}
}
## Add your filters / logstash plugins configuration here
filter {
@rav94
rav94 / filebeat.service
Created April 10, 2019 05:30
Filebeat Systemd Unit File
[Unit]
Description=Filebeat Docker Service
After=docker.service
Requires=docker.service
[Service]
Type=simple
User=root
TimeoutStartSec=0
Restart=on-failure
@rav94
rav94 / filebeat.yml
Last active April 10, 2019 05:51
Filebeat Configuration File
filebeat.inputs:
- type: docker
containers:
path: "/usr/share/dockerlogs/data"
stream: "stdout"
ids:
- "*"
cri.parse_flags: true
combine_partial: true
exclude_files: ['\.gz$']
@rav94
rav94 / Dockerfile
Created April 9, 2019 06:10
Filebeat Custom Dockerfile
FROM docker.elastic.co/beats/filebeat:6.5.2
# Copy custom configuration file
COPY filebeat.yml /usr/share/filebeat/filebeat.yml
USER root
# Create a directory to map volume with all docker log files
RUN mkdir /usr/share/filebeat/dockerlogs
RUN chown -R root /usr/share/filebeat/
RUN chmod -R go-w /usr/share/filebeat/
@rav94
rav94 / release.sh
Last active November 3, 2020 18:31
Release a branch from master + updating maven POM file version to new version for multi module project.
#!/bin/bash
# current Git branch
branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
# current project name
projectName=$(git config --local remote.origin.url|sed -n 's#.*/\([^.]*\)\.git#\1#p')
# establish master branch name variables
masterBranch=$branch
fab set_hosts:Name,${awsInstanceName},${regionName} restart_systemctl:servicefile=${serviceFileName}
@rav94
rav94 / fabfile.py
Last active December 18, 2017 08:55
Manage Systemd Units on AWS CoreOS Tagged Instances with Fabric and boto
import boto, urllib2
from boto.ec2 import connect_to_region
from fabric.api import env, run, cd, settings, sudo
from fabric.api import parallel
import os
import sys
REGION = os.environ.get("AWS_EC2_REGION")
# Server user
env.user = "core"
# List of AWS private key Files