Skip to content

Instantly share code, notes, and snippets.

View diginfo's full-sized avatar

Pure Manufacturing diginfo

View GitHub Profile
#bash <(curl -s ufw-whitelist.sh)
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
@diginfo
diginfo / mymem.sh
Last active January 25, 2021 15:53
#!/bin/sh
## MYSQL Memory Usage Calculator
## bash <(curl -Ls https://gist.github.com/diginfo/b1536d6d61e73bfd6eca4ed99d42b422/raw/)
##
mysql -u root -p$1 -e "show variables; show status" | awk '
{
VAR[$1]=$2
}
END {
MAX_CONN = VAR["max_connections"]
@diginfo
diginfo / jemalloc.sh
Last active August 14, 2023 17:51
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
@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 / 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
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();
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) {
#!/usr/bin/python
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
import SimpleHTTPServer
import SocketServer
from os import curdir, sep
import urllib
import subprocess
PORT = 8000
@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)"