Skip to content

Instantly share code, notes, and snippets.

View aliartiza75's full-sized avatar
☠️
Developing

Irtiza Ali aliartiza75

☠️
Developing
View GitHub Profile
@aliartiza75
aliartiza75 / flux-cd-manifests.md
Created September 13, 2022 21:01
Flux CD medium article.
flux-cd/
├── flux-googlechat-alert
│   ├── alert.yaml          # Alert Definition, i.e type of events to filter and information about alert
│   ├── provider.yaml       # Provider Definition, i.e, where alerts will be forwarded.
│   └── secret.yaml         # it holds the url to the google chat space.
├── git-repo
│   ├── git-repo.yaml       # Git repository definition. i.e, url of repository, and branch name etc
│   ├── kustomzation.yaml   # It has info about which Git repository to use, like the one that was created by git-repo.yaml, and Folder to monitor. It detects changes and      
│   │                       # deploy them on cluster. 
@aliartiza75
aliartiza75 / add-branch-name-in-commit.sh
Last active October 16, 2021 16:27
It adds the branch name in git commit
#!/bin/bash
#
# Automatically adds branch name and branch description to every commit message.
# Modified from the gist here https://gist.github.com/bartoszmajsak/1396344
#
# This way you can customize which branches should be skipped when
# prepending commit message.
RED="\033[1;31m"
GREEN="\033[1;32m"
@aliartiza75
aliartiza75 / state-machine-definition.json
Created June 18, 2021 07:51
It contains state machine definition for RDS snapshot creation and migration lambda.
{
"Comment": "Migrate RDS snapshots for disaster recovery",
"StartAt": "MigrateRDSSnapshots",
"States": {
"MigrateRDSSnapshots": {
"Type": "Task",
"Resource": "arn:aws:lambda:XX-XXXX-2:XXXXXX:function:migrate-rds-snapshots",
"Retry": [
{
"ErrorEquals": [
@aliartiza75
aliartiza75 / LambdaStepFunction.py
Last active June 18, 2021 12:24
It contains skeleton code for AWS RDS snapshot creation and migration lambda
import boto3
def create_snapshots(context):
"""
It will be used to create RDS snaphots.
Input args:
context: [obj] Use it to check remaining lambda execution time.
@aliartiza75
aliartiza75 / mapping.json
Last active November 8, 2020 17:56
Kinesis Shard's hash key mapping
{ "Shards": [
{
"ShardId": "shardId-000000000000",
"HashKeyRange": {
"StartingHashKey": "0",
"EndingHashKey": "170141183460469231371588410571"
},
"SequenceNumberRange": {
"StartingSequenceNumber": "496103516369698317099491240188243335841720557371394"
}
@aliartiza75
aliartiza75 / logstash.conf
Created July 26, 2020 18:10
logstash configuration to dump csv data in elasticsearch
input {
file {
path => "/home/irtiza/data.csv"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
csv {
@aliartiza75
aliartiza75 / logstash-error.conf
Created July 26, 2020 18:08
Logstash Config file to dump csv data in elasticsearch
input {
file {
path => "/home/irtiza/data.csv"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
@aliartiza75
aliartiza75 / centos7-playbook.yml
Created March 9, 2020 09:18
It is an ansible inventory file to configure packages on an CentOS 7 VM.
---
- hosts: nodes
become: true
tasks:
- name: Create a linux user devops
command: useradd devops
ignore_errors: yes # ignore is true because i was testing the system and if the user already exists it was causing errors
register: command_result
failed_when:
- command_result.rc == 9
@aliartiza75
aliartiza75 / mysql-manifest-ibm-cloud.yaml
Last active August 22, 2019 18:42
It is the final manifest for mysql
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mysql
namespace: test-namesapce
spec:
serviceName: "mysql"
selector:
matchLabels:
app: mysql
@aliartiza75
aliartiza75 / mysql-init-container-manifest-ibm-cloud.yaml
Last active August 22, 2019 18:40
MySQL init container manifest for removing the lost+found folder, it is an issue related to IBM Cloud.
initContainers:
- image: busybox
name: mysql-volume-cleaner
args: [/bin/sh, -c, 'rm -rf /var/lib/mysql/lost+found || true']
volumeMounts:
- mountPath: /var/lib/mysql
name: mysql-pvc