Skip to content

Instantly share code, notes, and snippets.

View shitalmule04's full-sized avatar

Shital Mule shitalmule04

View GitHub Profile
@shitalmule04
shitalmule04 / memory_usage.sh
Last active April 11, 2022 12:55
Shell Script to check memory usage. If memory usage beyond 70%, should send mail.
# !/bin/bash
# To find memory usage in MB
used=$(free -mt | grep Total | awk '{print $3}')
total=$(free -mt | grep Total | awk '{print $2}')
echo $used "MB used out of " $total "MB"
# TO calculate memory usage percentage
usage_percent= expr " $used * 100 / $total" | bc
@shitalmule04
shitalmule04 / MySQL_Export.py
Last active April 20, 2024 11:32
Python Script to export SQLite database tables into CSV file.
import sqlite3 as sql
import os
import csv
from sqlite3 import Error
try:
# Connect to database
conn=sql.connect('mydb.db')