Skip to content

Instantly share code, notes, and snippets.

View gajoseph's full-sized avatar

George @ Joseph gajoseph

View GitHub Profile
@gajoseph
gajoseph / Db2auditsetup
Last active January 24, 2020 09:09
Db2 audit setup
###########################################################################################
### make a directory to store audit and archievd audcit file
###########################################################################################
export BASE_PATH=/home ###### THIS HAS TO BE SET where the auidt data and archived audit stuff goes
###### THIS HAS TO BE SET
export DB2_HOME=/home/db2inst1
###### THIS HAS TO BE SET :: SCHEMA onto which data will be loaded
export DB2_SCHEMA=AUDIT
###### THIS HAS TO BE SET:: Set the Extract location
echo -e "\n\nDB2_HOME: $DB2_HOME\nDB2_SCHEMA: $DB2_SCHEMA\nEXTRACT_LOC_PATH: $EXTRACT_LOC_PATH\n\n"
/*
to copy/ archive changed files on git commit to local repository this might help
in my case need was to copy to /r/edt/Data\ and\ Analytics/deploy/
git hooks are located under .git\hooks under local respository
tosetup::
$git lfs update
$ git lfs update --force
then update .git/hooks/post-comit
*/
@gajoseph
gajoseph / gitDeleteaFile_tracking.txt
Last active May 30, 2018 18:25
safely delete a file from git repository,
### GIt prem delete a file
git filter-branch -f --index-filter "git rm -rf --cached --ignore-unmatch FOLDERNAME" -- --all
rm -rf .git/refs/original/
### prune entries older than the specified time
git reflog expire --expire=now --all
### Cleanup unnecessary files and optimize the local repository; prune object older than now
git gc --prune=now
@gajoseph
gajoseph / taillogs2slack.sh
Last active June 7, 2018 20:28
Slack :: Stream any log file to Slack using curl
#!/bin/bash
echo "$1, 2 =$2, 3=$3"
tail -n0 -F "$1"| while read LINE; do
(echo "$LINE" | grep -e "$3") && curl -X POST --silent --data-urlencode \
"payload={ \"channel\": \"#tstpglogs\", \"text\": \"$( sed "s/\"/'/g" <<< $LINE )\"}" "$2";
done