Skip to content

Instantly share code, notes, and snippets.

View swamirara's full-sized avatar
😃
Focusing

swamirara

😃
Focusing
View GitHub Profile
@swamirara
swamirara / installation.txt
Created July 14, 2022 17:10 — forked from yogin/installation.txt
Script to mute or unmute and resolve a Datadog monitor
vagrant@kratos:~$ chmod +x manage_monitor.sh
vagrant@kratos:~$ sudo cp manage_monitor.sh /etc/init.d/manage_monitor
vagrant@kratos:~$ sudo update-rc.d manage_monitor defaults
@swamirara
swamirara / create-aws-lambda-layers-using-docker.cmd
Last active April 21, 2022 17:37
Create aws lambda layer - python using docker
linux
========
docker run -v "$PWD":/var/task "lambci/lambda:build-python3.8" /bin/sh -c "pip install -r requirements.txt -t python/lib/python3.8/site-packages/; exit"
windows
========
docker run -v "%cd%":/var/task "lambci/lambda:build-python3.8" /bin/sh -c "pip install -r requirements.txt -t python/lib/python3.8/site-packages/; exit"
AWS docker image:
@swamirara
swamirara / README.md
Created March 10, 2022 14:02 — forked from mhausenblas/README.md
Fluent Bit log forwarding to CloudWatch

Set Up Fluent Bit as a DaemonSet to Send Logs to CloudWatch

Create a new 1.13 or 1.14 EKS cluster called container-insights.

Enable IRSA:

eksctl utils associate-iam-oidc-provider \
               --name container-insights \
               --approve
#Install IIS Feature
Install-WindowsFeature -Name Web-Server -IncludeManagementTools
#Install FTP feature
Install-WindowsFeature -Name Web-Ftp-Server -IncludeAllSubFeature -IncludeManagementTools -Verbose
#Creating new FTP site
$SiteName = "Demo FTP Site"
$RootFolderpath = "C:\DemoFTPRoot"
$PortNumber = 21
---
#ansible-playbook -u azureuser first_playbook.yml
- name: Docker playbook
gather_facts: false
hosts: all
tasks:
- name: Display the config
debug:
msg: "The hostname is {{ ansible_net_hostname }} and the OS is {{ ansible_net_version }}"
@swamirara
swamirara / AWSDevOpsStudyNotes
Created March 1, 2020 00:29
AWS DevOps Engineer Professional Study Notes
CI & CD:
========
2 core software development processes
CI process of automating regular code commits followed by an automated build and test process designed to highlight intergration issues early.
Additional tooling and functionality provided by Bamboo, CruiseControl, Jenkins, Go and TeamCity etc.
workflow based
CD takes the form of a workflow based process which accepts a tested software build payload from a CI server. Automates the deployment into a working QA, Pre-prod or Prod environment.
AWS CodeDeploy and CodePipeline provide CI/CD services
Elasticbeanstalk and CFN provide functionality which can be utilized by CI/CD servers.
import csv
from datetime import date, datetime
def json_serial(obj):
if isinstance(obj, (datetime, date)):
return obj.isoformat()
raise TypeError ("Type %s not serializable" % type(obj))
Runs = json.loads(json.dumps(data, default=json_serial))
Jenkins
=======
-> Install OpenJDK 11 JDK
sudo yum install java-1.8.0-openjdk-devel
-> Verify the installation, by running the following command which will print the Java version:
java -version
-> Install & Startn Jenkins
curl --silent --location http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo | sudo tee /etc/yum.repos.d/jenkins.repo
Terraform is a tool that is used for building, changing and versioning infrastructure safely and effectively.
Written in Go by Hashicorp, Inital release on July 28, 2014; 5 years ago
will cover
Setting up Docker Installing Terraform
Deploying Infrastructure with Terraform
Terraform Basics
Terraform Commands
@swamirara
swamirara / auto-sqlalchemy.py
Created August 8, 2019 05:31 — forked from kennethreitz/auto-sqlalchemy.py
Some code for using schemas as your declarative base with SQL-Alchemy, along with support for Celery's forking.
from sqlalchemy import create_engine, MetaData, Table
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from multiprocessing.util import register_after_fork
Base = declarative_base()