Skip to content

Instantly share code, notes, and snippets.

View masudur-rahman-niloy's full-sized avatar
🏠
Working from home

Md Masudur Rahman Niloy masudur-rahman-niloy

🏠
Working from home
  • ShadhinLab
  • Dhaka
View GitHub Profile
@masudur-rahman-niloy
masudur-rahman-niloy / mysql_backup.sh
Last active August 10, 2024 07:56
bash script to backup mysql database
#!/bin/bash
# Database credentials
DB_USER="your_username" # change this
DB_PASSWORD="your_password" # change this
DB_NAME="your_database_name" # change this
# Backup directory
BACKUP_DIR="/path/to/backup/directory" # change this
from elasticsearch import Elasticsearch
import sys
ELASTIC_PASSWORD = sys.argv[1]
client = Elasticsearch(
"https://localhost:9200",
ca_certs="/etc/elasticsearch/certs/http_ca.crt",
basic_auth=("elastic", ELASTIC_PASSWORD)
)
from elasticsearch import Elasticsearch
from datetime import datetime
import sys
ELASTIC_PASSWORD = sys.argv[1]
client = Elasticsearch(
"https://localhost:9200",
ca_certs="/etc/elasticsearch/certs/http_ca.crt",
@masudur-rahman-niloy
masudur-rahman-niloy / get-vars.py
Last active July 26, 2023 03:41 — forked from singledigit/get-vars.py
Get all env variables for all AWS Lamda functions in a CloudFormation/SAM stack
#! /usr/bin/env python
# Use at your own risk and reward.
# requires boto3 to be installed
# example `./get-vars.py MyStack > vars.json`
import sys, json
import boto3
import argparse