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 / 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 / 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 / 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);
Freeswitch Changes for Internet Communication
=================================================
vars.xml
-----------------------------------
Gather Public IP and assign to external and bind ip using stun-set method. Where external_rtp_ip and external_sip_ip already
trying to get using freeswitch stun server where it's failing mostly, so use different stun server with high stability server or use
own stun server to get the external ip.
=========================================
Sphinx Installation & Configuration
=========================================
-------------------------------
Sphinx Installation
-------------------------------
In redhat distribution to install sphinx package should be available in the name of python-sphinx.
Use below command to install sphinx package.
@ganapathichidambaram
ganapathichidambaram / Linux VM Image Creation
Created February 13, 2021 13:23
Create VM Image command line
dd if=/dev/zero of=/data/ganapathi/xen/vm/kmaster/swap.img bs=1024k count=0 seek=1024
mkswap /data/ganapathi/xen/vm/kmaster/swap.img
dd if=/dev/zero of=/data/ganapathi/xen/vm/kmaster/disk.img bs=10096k count=0 seek=1024
mkfs.ext4 -F /data/ganapathi/xen/vm/kmaster/disk.img