Skip to content

Instantly share code, notes, and snippets.

View diginfo's full-sized avatar

Pure Manufacturing diginfo

View GitHub Profile
@diginfo
diginfo / post-stats
Last active May 7, 2020 00:11
Postfix Stats Install & Execute
if [ ! -f "/usr/local/bin/pflogsumm" ]; then
cd /tmp
wget https://jimsun.linxnet.com/downloads/pflogsumm-1.1.3.tar.gz
tar xvf pflogsumm-1.1.3.tar.gz
cd pflogsumm-1.1.3/
cp pflogsumm.pl /usr/local/bin/pflogsumm
fi
cat /var/log/mail.log | pflogsumm "$@"
@diginfo
diginfo / site-backups
Last active May 14, 2020 10:03
Pure Site Backups
#!/bin/bash
## STAMPS - @@ VALUES SET LATER
NOW=$(date +%y%m%d%H%M)
DOW=$(date +"%a")
S3="/usr/bin/s3cmd";
SRC="/usr/share/nodejs/sites/"
S3DIR="s3://sg-180222/pure/sites/"
# /usr/bin/s3cmd sync $SRC $S3DIR
#!/bin/bash
## bash <(curl -Ls https://gist.github.com/diginfo/6e8b19e3cd4d88798296a33768d632ee/raw/)
###
apt -y update;
apt -y install git;
mkdir /usr/share/dis;
cd /usr/share/dis;
git clone https://github.com/diginfo/pure3-bin.git;
cd pure3-bin;
#!/bin/bash
## bash <(curl -Ls https://gist.github.com/diginfo/68261e9709eb05046d473f9fc646389f/raw/)
###
if [ "$#" -lt 2 ]; then
echo "keyadd repo path/to/rsa/file"
exit 1;
fi
REPO=$1;
module.exports = {}
const mex = module.exports;
const cl = console.log;
mex.cl = cl;
mex._rl = require('readline');
mex._os = require('os');
mex._path = require('path');
mex._fs = require('fs');
#!/bin/bash
#
# bash <(curl -Ls https://gist.github.com/diginfo/73f6eff45a714c856582855c6be4aba0/raw/)
#
## /etc/fstab
## NFS MOUNTS
# 192.168.42.35:/mnt/DroboFS/Shares/Public /nfs/drobo/Public nfs auto,_netdev,noatime,nolock,bg,intr,tcp,actimeo=1800 0 0
# 192.168.42.35:/mnt/DroboFS/Shares/FTPusers /nfs/drobo/FTPusers nfs auto,_netdev,noatime,nolock,bg,intr,tcp,actimeo=1800 0 0
# 192.168.42.35:/mnt/DroboFS/Shares/Backups /nfs/drobo/Backups nfs auto,_netdev,noatime,nolock,bg,intr,tcp,actimeo=1800 0 0
#!/bin/bash
## bash <(curl -Ls https://gist.github.com/diginfo/62fa8ccc4277d80d9bbb4aee89d9e900/raw/)
##
## Requires private key with repo-name.key:i.e. pure3-bin.key, pure3.key
_ROOT="/usr/share/dis";
echo "This will clone the repository into your current folder.";
echo "You require a deploy key file in order to proceed.";
echo "If you are a DIS ADMIN you can use pure-keygen to generate the keys";
@diginfo
diginfo / install-docker
Last active March 2, 2021 00:17
Install Docker on Debian
#!/bin/bash
## bash <(curl -Ls https://gist.github.com/diginfo/f8ff1025d256613913ea20835f921c88/raw/)
##
apt install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
#!/bin/bash
#
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
if [[ $# -lt 2 ]];
echo "Usage:"
#!/bin/bash
HOSTNAME="$1"
LOGDIR="$HOME/.ufw";
LOGFILE=$LOGDIR/$HOSTNAME
if [ ! -d "$LOGDIR" ];then
mkdir $LOGDIR
fi
function _alert {