Skip to content

Instantly share code, notes, and snippets.

View MuruganChandrasekar's full-sized avatar

Murugan Chandrasekar MuruganChandrasekar

View GitHub Profile
@MuruganChandrasekar
MuruganChandrasekar / grafana-backup.sh
Created February 13, 2018 10:01 — forked from piotr1212/grafana-backup.sh
Grafana sqlite backup script
cat /usr/share/grafana/grafana-backup.sh
#!/bin/bash
DB="/var/lib/grafana/grafana.db"
BACKUP="/data/backup/grafana/grafana.db-$(date +%Y%m%d).bck"
SQLITE=/usr/bin/sqlite3
ZIP=/bin/gzip
${SQLITE} ${DB} ".backup ${BACKUP}"
${ZIP} ${BACKUP}
@MuruganChandrasekar
MuruganChandrasekar / ubuntu_unattended_upgrades_gmail.markdown
Created March 7, 2018 17:11 — forked from roydq/ubuntu_unattended_upgrades_gmail.markdown
Unattended upgrades on Ubuntu 14.04 with email notifications

Getting Started

Do yourself a favor and login as root to save yourself some time and headaches:

$ sudo su -

Install unattended-upgrades:

#Add the Ubuntu 12.04(precise) repositories
cat <<EOF >> /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu precise main restricted universe
deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe
deb http://security.ubuntu.com/ubuntu precise-security main restricted universe multiverse
EOF
# Update the repos
apt-get update

Creating PGP Key Pairs Using “gpg4win” Tool

  1. Please click on the below link for downloading “gpg4win-3.1.13.exe” tool for generating PGP key pairs.

  2. Double click on the downloaded tool and then install it just by make sure the below components were selected.

@MuruganChandrasekar
MuruganChandrasekar / bash-cheat-sheet
Created November 24, 2020 13:04 — forked from ssledz/bash-cheat-sheet
BASH Cheat Sheet
B A S H C H E A T S H E E T
to page output forward (only): command filename | more
to page output forward & back: command filename | less
to print a dataset: lp datasetname (-d printerid) (-o landscape)
USE OF QUOTATION MARKS
echo "$varname" = echo The value of \$varname is \"$varname\"
= echo "The value of \$varname is \"$varname\"."
$fred='Four spaces between these words.'

Git Cheat Sheets and Examples


RegEx Cheat Sheet #1

regex-cheatsheet-2

RegEx Cheat Sheet #2

regex-cheatsheet

tcpdump examples

See the list of interfaces on which tcpdump can listen:

tcpdump -D

Listen on interface eth0:

tcpdump -i eth0

Listen on any available interface (cannot be done in promiscuous mode. Requires Linux kernel 2.2 or greater):

VIM Cheatsheet

Cursor movement

h - move cursor left
j - move cursor down
k - move cursor up
l - move cursor right

w - jump forwards to the start of a word

@MuruganChandrasekar
MuruganChandrasekar / .gitconfig
Created December 9, 2020 13:27 — forked from dylanninin/.gitconfig
Sample of git config file (Example .gitconfig)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com