Skip to content

Instantly share code, notes, and snippets.

# to run: docker-compose run
#
# Create a .evn file in the same folder as this file and change the variables.
# MOUNT_POINT=/tmp/
# VPN_PROVIDER=changeme
# VPN_CONFIG=changeme
# VPN_USERNAME=changeme
# VPN_PASSWORD=changeme
#
#
@RajatNair
RajatNair / backup_to_nas.sh
Created January 2, 2019 12:29 — forked from rollcabbage/backup_to_nas.sh
files or log files backup script; backup object and destination be defined by associative array
#!/bin/bash
#
# created by RiHaku on June 2015
#
# mount -t nfs -o rw,rsize=8192,wsize=8192,hard,intr,noatime,bg,nfsvers=3 10.51.0.91:/DMZ /mnt/data
# mount -t nfs -o rw,rsize=8192,wsize=8192,hard,intr,noatime,bg,nfsvers=3 10.51.0.91:/TRUST /mnt/data
#
# mount check; if not mounted, exit with status code
df -h | awk 'NR == 5 {print $1}' | grep 10.51.0.91 >/dev/null 2>&1
@RajatNair
RajatNair / backup_strategy.md
Created January 2, 2019 12:27 — forked from gryte/backup_strategy.md
install_pms_centos_7

on plexserver, create directories

create scripts directory

sudo mkdir /scripts

create backup directory

@RajatNair
RajatNair / Get external IP, write to file
Last active October 20, 2018 20:41 — forked from scottlee/Get external IP, write to file
Get external IP address and write to file if it has changed
#!/bin/bash
# Where should this file be stored?
ipfile=~/Desktop/external-ip.txt
# Go ahead now, go ahead and get that IP
IP=$(curl -s https://icanhazip.com)
# Has the address changed? If it has go ahead and write that bad boy down. If not, no worries.
OLDIP=""
# Script for enabling access log based on Undertow on WildFly.
# Run with: $WILDFLY_HOME/bin/jboss-cli.sh --connect --file=enable-access-log.cli
batch
/subsystem=undertow/server=default-server/host=default-host/setting=access-log:add(pattern="%h %t \"%r\" %s \"%{i,User-Agent}\"",use-server-log=true)
run-batch
@RajatNair
RajatNair / post-receive
Created May 30, 2018 12:15 — forked from lemiorhan/post-receive
Post-receive hook to deploy the code being pushed to production branch to a specific folder
#!/bin/bash
target_branch="production"
working_tree="PATH_TO_DEPLOY"
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ -n "$branch" ] && [ "$target_branch" == "$branch" ]; then
@RajatNair
RajatNair / p4merge-git-tool.md
Last active May 30, 2018 12:08 — forked from dgoguerra/p4merge-git-tool.md
Setup p4merge as difftool and mergetool on Windows

Setting up p4merge as diff and merge tool on Windows. Tried for Git version 1.8.4.msysgit.0.

Two alternatives are explained: using the command line, and directly editing the config file.

Setting up from the command line

Being the installation path "C:Program Files\Perforce\p4merge.exe", just run:

$ git config --global diff.tool p4merge