Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@RajatNair
RajatNair / index.html
Last active May 4, 2020 18:46
Request Queuing using Vanilla JavaScript and Typescript - https://stackblitz.com/edit/typescript-cdyebd
<h3>Request Queueing using Vanilla Javascript and Typescript</h3>
<div id="app"></div>
<div>
<h4>Console</h4>
<ol id="console">
</ol>
</div>
@RajatNair
RajatNair / network-detection-script.sh
Last active March 25, 2020 10:27
Odroid C2/N2, Raspberry Pi Zero - Network detection script
#!/bin/bash
# Author: Rajat Nair (aunlead.com)
# Description: This script will periodically check -
# - if device is on LAN
# - if remote share is online
# - Automount remote shares
# - Verify if DNS resolution is working
# - Verify if internet connectivity is working
# - Verify if server can be pinged
# 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
#
#
#!/bin/bash
#
# This script will periodically check NFS mounts are up or not. If its not up
# it will mount them for you.
# Example - My Pi Zero will not mount my NFS drives at boot. This script
# will make sure that the drive is mounted.
#
#
@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 / Secure.your.Server.md
Last active December 9, 2018 17:43
Security tips to locking down your box

Security tips to locking down your box

1. SSH to your VPS (virtual private server)
2. Change root password from default
passwd root
3. Update VPS
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
@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