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 / mysql-manifest.yaml
Last active August 13, 2019 19:08
Statefulset and Service manifest for MySQL
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mysql
namespace: test-namesapce
spec:
serviceName: "mysql-svc"
selector:
matchLabels:
app: mysql
Environment Variable Description Default value
S3_BUCKET_NAME AWS S3 bucket name ""
AWS_ACCESS_KEY_ID AWS account access id ""
AWS_SECRET_ACCESS_KEY AWS account access id secret ""
AWS_DEFAULT_REGION AWS default region ""
LAST_BACKUP Name of the last backup. Last backup name in extracted from S3 bucket name using the script written in run.sh file. None
RESTORE_FOLDER Name of the folder. /home/restore
VOLUME Volume that is shared between elasticsearch and elasticsearch-restore-backup container /usr/share/elasticsearch/data
RESTORE Variable for check to restore data from S3 bucket. If true data will be restored from S3 bucket and store in location given in RESTORE_FOLDER env variable otherwise only data backup script will execute in the container. true
Environment Variable Description Default value
CRON_TIME Data backup interval Default backup interval is "00 */1 * * *", which means take backup after each hour.
S3_BUCKET_NAME AWS S3 bucket name ""
AWS_ACCESS_KEY_ID AWS account access id ""
AWS_SECRET_ACCESS_KEY AWS account access id secret ""
AWS_DEFAULT_REGION AWS default region ""
BACKUP_FOLDER Name of backup folder /home/backup
VOLUME Volume that is shared between elasticsearch and elasticsearch-restore-backup container /usr/share/elasticsearch/data
@aliartiza75
aliartiza75 / revert.sh
Created July 8, 2019 11:15
revert commits and sync remote repo with local
# to check the log history
git log
# to revert back number of commits
git reset --hard HEAD~<number-of-commit>
# to sync remote branch with local
git push --force origin <branch-name>
@aliartiza75
aliartiza75 / gitlab-pipeline-config-for-k8s-integration.yaml
Last active June 18, 2019 19:49
This file contains basic config that make sure that kubernetes and gitlab integration is successful.
image:
name: aliartiza75/kubectl:0.0.2
before_script:
- mkdir ~/.kube/
- echo $KUBE_CONFIG_AWS | base64 -d > config
- mv config ~/.kube/
stages:
- deploy
@aliartiza75
aliartiza75 / base64-encoded-string-formatter.py
Created June 18, 2019 19:30
It will remove the \n from the end of each line and combine all the lines in a single string
f = open("config.txt", "r")
config = ""
for line in f:
config += line.split("\n")[0]
print(config)
@aliartiza75
aliartiza75 / postgres-docker-image-issues-fix.md
Last active April 8, 2019 21:03
This file contains fixes related to postgres database

This file contains fixes for the issues related to postgres database.

ISSUE #1: role "root" doesn't exits

While I run the postgres docker image with this command:

sudo docker run --name=tasksiner-postgres1 -e POSTGRES_USER=tasksiner -e POSTGRES_PASSWORD=tasksiner -p 5431:5432 -d postgres

without specifying the POSTGRES_USER environment variable, I got this issue

KEYBINDINGS
byobu keybindings can be user defined in /usr/share/byobu/keybindings/ (or within .screenrc if byobu-export was used). The common key bindings
are:
F2 - Create a new window
F3 - Move to previous window
F4 - Move to next window
@aliartiza75
aliartiza75 / minikube.sh
Last active March 21, 2019 07:15
This gist contains the guideline to install minikube locally
# Install Minikube on Linux by downloading a static binary:
$ curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \
&& chmod +x minikube
# To add the Minikube executable to your path:
$ sudo cp minikube /usr/local/bin && rm minikube
# To start minikube on local machine. The vm-driver's none value only need linux env and docker engine, while other params need
# the hypervisor to be enabled, it is time consuming.
$ minikube start --vm-driver=none
@aliartiza75
aliartiza75 / minio_mc.sh
Last active August 11, 2023 16:53
Command to use mini/mc with minio server
# Step 1 : Start minio server with non-persistent data storage policy
#
# Description: -p 9000:9000: Minio server runs on port 9000 inside the docker container, -e 9000:9000 command is exposing the internal port on
# on external port.
#
# -e "MINIO_ACCESS_KEY=access_key": It sets an envrionment variable inside container named as MINIO_ACCESS_KEY
# with the value provided by user. It will be used when a user wants to access
# minio server
#
# -e "MINIO_SECRET_KEY=access_key_secret": It sets an envrionment variable inside container named as MINIO_SECRET_KEY