Skip to content

Instantly share code, notes, and snippets.

View devsekhar's full-sized avatar

Kumar Sekhar devsekhar

View GitHub Profile
@devsekhar
devsekhar / git-deployment.md
Created July 20, 2018 06:37 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your lokal GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like my Deepl.io to act upon a Web-Hook that's triggered that service.

@devsekhar
devsekhar / what-changed.sh
Created July 20, 2018 07:23 — forked from thomasfr/what-changed.sh
Recursively compare two directories and print which files have changed. Ignore binary files and do not show non existing files in `dir2`
#!/bin/bash
dir1="/tmp/dir1"
dir2="/tmp/dir2"
IFS=$'\n'
for file in $(grep -Ilsr -m 1 '.' "$dir1"); do diff -q --exclude="cache" "$file" "${file/${dir1}/${dir2}}" 2> /dev/null; done
@devsekhar
devsekhar / multi-exec.sh
Created July 20, 2018 07:56 — forked from thomasfr/multi-exec.sh
Execute a SQL Statement in many Databases of one mysql server
#!/bin/bash
user="${1}"
host="${2}"
like="${3}"
all_dbs="$(mysql -u $user -p -h "$host" -Bse 'SELECT SCHEMA_NAME from information_schema.SCHEMATA WHERE SCHEMA_NAME like "${like}"' 2> /dev/null)"
for db in $all_dbs
do
mysql -u $user -p -h "$host" $db -sN -e "SELECT * FROM centerdaten;" 2> /dev/null
@devsekhar
devsekhar / backup.sh
Created July 20, 2018 08:59 — forked from thomasfr/backup.sh
duplicity.backup Bash Script with Rollbar Notification
#!/bin/bash
export FTP_PASSWORD="123456"
FTP_USER="user"
FTP_HOST="user.your-backup.de"
BACKUP_TARGET="ftp://${FTP_USER}@${FTP_HOST}/$(hostname)"
DUPLICITY_LOGFILE="/var/log/duplicity.log"
DUPLICITY_TEMPDIR="/tmp/duplicity"
# Rollbar access token
ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxx
@devsekhar
devsekhar / introrx.md
Created November 19, 2020 08:22
The introduction to Reactive Programming you've been missing