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 / 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);
#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 / 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)
@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 / 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`