Skip to content

Instantly share code, notes, and snippets.

View ganapathichidambaram's full-sized avatar
🎯
Focusing

Ganapathi Chidambaram ganapathichidambaram

🎯
Focusing
View GitHub Profile
@ganapathichidambaram
ganapathichidambaram / Get MySQL Table Size
Created February 13, 2021 13:21
Get the Table Size along with Table Engine for particular SCHEMA/Database
SELECT
TABLE_NAME AS `Table`, ENGINE,
ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS `Size (MB)`
FROM
information_schema.TABLES
WHERE
TABLE_SCHEMA = "DATABASENAME"
ORDER BY
(DATA_LENGTH + INDEX_LENGTH)
DESC;
@ganapathichidambaram
ganapathichidambaram / disable-ipv6-centos8.md
Created June 17, 2020 15:43
Disable IPv6 on CentOS 8 Server

To Disable IPv6 on CentOS

Disable IPv6 Using sysctl

First create a new sysctl configuration file /etc/sysctl.d/90-ipv6.conf using the following command.

vi /etc/sysctl.d/90-ipv6.conf
@ganapathichidambaram
ganapathichidambaram / some-find-commands.md
Last active February 10, 2021 12:41
Some action with Find Utility in Linux

Some Commands using Find utility - Linux

  • To Find the alphanumeric File with special extension
find . -type f -regex ".*[0-9].*\.\(xls\|csv\|php\)"
  • To Find alplahnumeric file under entire folder by excluding some folder
@ganapathichidambaram
ganapathichidambaram / mysqldumpsplitter.sh
Last active May 3, 2020 20:00
MySQL Dump Splitter Shell Script
#!/bin/sh
#
#
#
###################################################################################################################################################
########################################################### USAGE #################################################################################
#
#
#
# --source - Specify the source SQL Dump file which we want to process.
@ganapathichidambaram
ganapathichidambaram / listdir.c
Created May 3, 2020 13:21
Listing filenames of huge number of file available in the Directory using C language
#define _GNU_SOURCE
#include <dirent.h> /* Defines DT_* constants */
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/syscall.h>
[Unit]
Description=Airflow scheduler daemon
After=network.target postgresql.service mysql.service redis.service rabbitmq-server.service
Wants=postgresql.service mysql.service redis.service rabbitmq-server.service
[Service]
EnvironmentFile=/etc/sysconfig/airflow
#User=airflow
#Group=airflow
Type=simple
@ganapathichidambaram
ganapathichidambaram / mysql-changes-for-airflow
Created May 3, 2020 10:56
Changes required for Airflow on MySQL
explicit_defaults_for_timestamp =1
group_concat_max_len= 100000

MySQL High Availability with Keepalived and HAProxy

Keepalived along with HAProxy would able to do the load-balanced High Availability Cluster. With these we can do the cluster for any application service whether MySQL or any other application service as per needs.

  1. Keepalived - LVS and VRRP High Availability Monitor
  2. HAProxy - High Availability Load Balancer

Let's Assume below mentioned Configuration details

@ganapathichidambaram
ganapathichidambaram / Configure MySQL Cluster.md
Created March 19, 2020 13:11
Configure MYSQL Master-Master Cluster

Configure MySQL Cluster

First We need to make MySQL Cluster with Master-Master synchronization

Let's Assume mentioned below Server's Details.

MySQL Server1:

Server IP : 192.168.0.1
@ganapathichidambaram
ganapathichidambaram / originate_call_and_connect_users_on_freeswitch
Created February 12, 2020 05:41
Originate the call to customer number and connect to local user on Freeswitch
fs_cli -x 'originate {origination_caller_id_number=1002}freetdm/2/a/000000000 &bridge(user/1002)'