Skip to content

Instantly share code, notes, and snippets.

View donaldsteele's full-sized avatar

Don Steele donaldsteele

  • GTR Event Technology
  • Charlotte , NC
View GitHub Profile
@donaldsteele
donaldsteele / run-xtrabackup.sh
Created January 4, 2024 21:54 — forked from jmfederico/run-xtrabackup.sh
Script to create full/incremental backups with xtrabackup.
#!/bin/sh
TMPFILE="/tmp/xtrabackup-runner.$$.tmp"
USEROPTIONS="--user=${MYSQL_USER} --password=${MYSQL_PASSWORD} --host=${MYSQL_HOST}"
BACKDIR=/srv/mysql-bak
BASEBACKDIR=$BACKDIR/base
INCRBACKDIR=$BACKDIR/incr
FULLBACKUPCYCLE=604800 # Create a new full backup every X seconds
KEEP=1 # Number of additional backups cycles a backup should kept for.
START=`date +%s`
@donaldsteele
donaldsteele / install_php8.sh
Last active September 20, 2022 21:18
install php8
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/sury-php.list
wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add -
apt update
apt install -y php8.0 php8.0-fpm
apt install -y php8.0 php8.0-fpm php8.0-cli php8.0-common php8.0-fpm php8.0-bcmath php8.0-mbstring php8.0-xml php8.0-curl php8.0-zip php8.0-gd php8.0-redis php8.0-mysql php8.0-imagick php8.0-tidy php8.0-xmlrpc php8.0-intl
@donaldsteele
donaldsteele / encrypt.php
Created January 19, 2022 02:33
php aes 256 encryption example
<?php
define('FILE_ENCRYPTION_BLOCKS', 10000);
/**
* @param $source Path of the unencrypted file
* @param $dest Path of the encrypted file to created
* @param $key Encryption key
*/
function encryptFile($source, $dest, $key)
#define _GNU_SOURCE
#include <errno.h>
#include <sched.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
@donaldsteele
donaldsteele / cyber_partriot_score_to_csv.php
Last active October 30, 2019 02:16
Extract the scores from the live cyber patriot scoreboard into csv format
<?php
$url = "http://scoreboard.uscyberpatriot.org/";
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$html = curl_exec($ch);
curl_close($ch);
@donaldsteele
donaldsteele / glass.css
Last active August 10, 2019 20:56 — forked from gjhilton/glass.css
Glass CSS
.glass{
background: -moz-linear-gradient(top, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,1)), color-stop(100%,rgba(255,255,255,0)));
background: -webkit-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%);
background: -o-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%);
background: -ms-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%);
background: linear-gradient(top, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%);
border: 2px solid #DDDBD7;
-webkit-box-shadow: 3px 3px 10px rgba(0,0,0,0.4), inset 0 0 10px rgba(255,255,255, 0.8);
-moz-box-shadow: 3px 3px 10px rgba(0,0,0,0.4), inset 0 0 10px rgba(255,255,255, 0.8);
@donaldsteele
donaldsteele / encode.php
Last active December 17, 2019 20:25
can a directory and encode the media using scene 2016 standards
<?php
/**
* Created by PhpStorm.
* User: don
* Date: 2/22/2019
* Time: 10:11 AM
* Scan a directory and encode the media using scene 2016 standards
* this will ouput a bash script (could be modified at line 27 to exec instead of echo to execute
*
* Usage::
@donaldsteele
donaldsteele / convert_svg_to_ico.sh
Last active November 12, 2018 17:15
Convert folder of svg files to standard windows icon sized .ico files using imagemagik
#!/bin/bash
#requires imagemagik, inkscape and pngquant
#sizes you wish to create
size=(16 32 24 48 72 96 144 152 192 196 256)
for file in *.svg; do
base=${file%.*}
for i in ${size[@]}; do
inkscape $file --export-png="${base}_${i}.png" -w$i -h$i --without-gui
@donaldsteele
donaldsteele / vbox-backup.sh
Created October 8, 2018 12:09 — forked from dv336699/vbox-backup.sh
Backup Running VirtualBox VMs
#!/bin/sh
BASEFOLDER=/home/vbox/backups
for VMNAME in $(VBoxManage list runningvms | cut -d ' ' -f1 | sed 's/"//g;')
do
echo ""
VBoxManage controlvm "$VMNAME" acpipowerbutton
echo "Waiting for VM "$VMNAME" to poweroff..."
until $(VBoxManage showvminfo --machinereadable "$VMNAME" | grep -q ^VMState=.poweroff.)