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 / git_formatted_patch_generation_and_apply.md
Last active May 22, 2023 13:15
To Generate formatted patch file and apply using git command

Generate Patch

Generate Last one Patch based on Commit ID:

To generate the formatted patch of last one commit.

@ganapathichidambaram
ganapathichidambaram / rclone-flexydial.service
Created April 17, 2022 11:42
Rclone Systemd Service for sync to google Drive
[Unit]
Description=FlexyDial Drive Sync
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
User=ganapathi
Group=ganapathi
ExecStart=rclone sync --update -v --drive-import-formats docx,xlsx,txt,zip --drive-skip-shortcuts --exclude *Thumbs.db* --exclude *.~* /home/ganapathi/Flexydial Flexydial:
@ganapathichidambaram
ganapathichidambaram / centos-8_custom_iso_creation.md
Created January 13, 2020 09:50
Creation of CentOS-8 Custom ISO

ISO Creation from Scratch

In this tutorial we are going to look into creation of CentOS ISO based on CentOS 8. There are few slight difference between the folder structure from CentOS 7. In CentOS 7 isolinux contains directly Packages without any parent folder and every rpm will be under single folder. But in CentOS 8 it would segreagated into two separate folder such as BaseOS and AppStream. And those configuration defined on media.repo file present in the iso file.

  • To Create ISO we need to create necessary folder struture like mentioned below.
mkdir -p ~/kickstart_build/isolinux/{BaseOS,AppStream}/Packages
@ganapathichidambaram
ganapathichidambaram / datasourcetocsv_operator.py
Created November 11, 2019 07:10
Airflow - Postgresql DataSource to CSV export
from airflow.hooks.postgres_hook import PostgresHook
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
from datetime import datetime, timedelta
from os import environ
import csv
class DataSourceToCsvOperator(BaseOperator):
"""
@ganapathichidambaram
ganapathichidambaram / ffmpeg-trim.sh
Created April 17, 2022 13:12
ffmpeg trim video - Last -N -Secs from Video
#!/bin/bash
### Execution of script
### ./ffmpeg-trim.sh input.mp4 last-n-sec-to-trim
# Arguments
FILE_RAW=$1
TRIM_EOF_DURATION=${2:-1.0} # Default is 1.0 second trimmed from EOF
# Prepare variables
@ganapathichidambaram
ganapathichidambaram / freeswitch_debian_own_repo
Created January 26, 2022 17:16
OpenSuse Repository for Freeswitch Installation
echo 'deb http://download.opensuse.org/repositories/home:/ganapathi/xUbuntu_20.04/ /' | sudo tee /etc/apt/sources.list.d/home:ganapathi.list
curl -fsSL https://download.opensuse.org/repositories/home:ganapathi/xUbuntu_20.04/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/home_ganapathi.gpg > /dev/null
sudo apt update
sudo apt install freeswitch
@ganapathichidambaram
ganapathichidambaram / vimrc.local
Created November 18, 2021 21:04
Some Important VIMRC configuration
" Turn syntax highlighting on.
syntax on
" Set tab width to 4 columns.
set tabstop=4
" Set shift width to 4 spaces.
set shiftwidth=4
set autoindent
@ganapathichidambaram
ganapathichidambaram / enable-sql-queries-django.txt
Created November 3, 2021 17:57
Enable SQL Queries on Console for Django App
LOGGING = {
'version': 1,
'filters': {
'require_debug_true': {
'()': 'django.utils.log.RequireDebugTrue',
}
},
'handlers': {
'console': {
'level': 'DEBUG',

Keybase proof

I hereby claim:

  • I am ganapathichidambaram on github.
  • I am ganapathi (https://keybase.io/ganapathi) on keybase.
  • I have a public key ASAX0omfun_VOPTWosdRWRt7ZNKHn4YO_iOzluNOu5KFIgo

To claim this, I am signing this object:

@ganapathichidambaram
ganapathichidambaram / pagination.blade.php
Created July 25, 2021 14:29
Laravel Pagination Pretty URL
@php
$links = $articles->links();
$patterns = '#\?page=#';
$replacements = '/page/';
$one = preg_replace($patterns, $replacements, $links);
$pattern2 = '#page/([1-9]+[0-9]*)/page/([1-9]+[0-9]*)#';
$replacements2 = 'page/$2';
$paginate_links = preg_replace($pattern2, $replacements2, $one);