Skip to content

Instantly share code, notes, and snippets.

View diginfo's full-sized avatar

Pure Manufacturing diginfo

View GitHub Profile
#!/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;
@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
@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 / esxi-cloneall.sh
Last active February 7, 2020 08:59
ESXI Clone All VMs
OVFTOOL="/scratch/vmware-ovftool/ovftool"
DOW=$(date +%a)
SRCVOL="SSG250G"
DESTVOL="DROBO/daily/$DOW/ovf"
clone() {
VMID=$(vim-cmd vmsvc/getallvms | grep $SRCVM | awk '{print $1}')
echo "CLONING $SRCVM ($VMID)"
#!/usr/bin/python
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
import SimpleHTTPServer
import SocketServer
from os import curdir, sep
import urllib
import subprocess
PORT = 8000
const cl = console.log;
const noble = require('@abandonware/noble');
function buf2arr(bufdata){
var buffer = Buffer.from(bufdata)
return Array.prototype.slice.call(buffer, 0)
}
// use manufacturer data, no connect.
function readMfgData(peripheral) {
const cl = console.log;
const noble = require('@abandonware/noble');
const childProcess = require('child_process');
//exec('sudo systemctl restart bluetooth');
process.on('SIGINT', function() {
cl("Quitting Noble.");
noble.stopScanning();
process.exit();
@diginfo
diginfo / zarafa-71-72.sh
Created August 19, 2019 02:42
Zarafa Upgrade 7.1 to 7.2 Final
##
cd ~
apt install libtcmalloc-minimal4
cp -rp /etc/zarafa /etc/zarafa.71
tar -xvf zcp-7.2.6.10-ubuntu-14.04-x86_64-supported.tar.gz
cd zcp-7.2.6.10-ubuntu-14.04-x86_64-supported
## Check for
@diginfo
diginfo / mariadb.sh
Last active May 18, 2019 23:20
Install Maria 10.X.XX on Ubuntu 18
#!/bin/sh
## Install Maria 10.X.XX on Ubuntu 18
## bash <(curl -Ls https://gist.github.com/diginfo/27602ad9439660039a1d93280406368b/raw/)
##
MYVER="10.2.24"
read -p "Enter MYSQL Version ($MYVER): " MYVER
echo "Installing Maria DB Server & Client $MYVER...";
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
rm -rf /etc/apt/sources.list.d/mariadb.list
@diginfo
diginfo / jemalloc.sh
Last active August 2, 2024 02:34
Install latest jemalloc & configure mysql - Ubuntu
#!/bin/sh
## Install latest jemalloc & configure mysql - Ubuntu
## bash <(curl -Ls https://gist.github.com/diginfo/be7347e6e6c4f05375c51bca90f220e8/raw/)
##
apt-get -y install autoconf libxslt-dev xsltproc docbook-xsl
git clone https://github.com/jemalloc/jemalloc.git
cd jemalloc
autoconf
./configure
make dist