Skip to content

Instantly share code, notes, and snippets.

View epreston's full-sized avatar

Ed Preston epreston

View GitHub Profile
double t = 0.0;
const double dt = 0.01;
double currentTime = hires_time_in_seconds();
double accumulator = 0.0;
State previous;
State current;
while ( !quit )
@epreston
epreston / audit-public-ssh-keys.sh
Last active June 30, 2021 10:40
create a quick audit of ssh public keys - name, strength, sha, type,
# Audit SSH Keys
OUTPUT_FILE="audit-$(date +"%FT%H%M%z").txt"
for file in *.pub
do
echo $file
echo -n "$file " >> $OUTPUT_FILE
ssh-keygen -l -f "$file" >> $OUTPUT_FILE
done
@epreston
epreston / create-local-mysql-db-user.sh
Created June 27, 2021 11:08
create a quick mysql-user pair with strong password
#!/bin/bash
PASS=`pwgen -s 40 1`
mysql -uroot -p <<MYSQL_SCRIPT
CREATE DATABASE $1;
CREATE USER '$1'@'localhost' IDENTIFIED BY '$PASS';
GRANT ALL PRIVILEGES ON $1.* TO '$1'@'localhost';
FLUSH PRIVILEGES;
MYSQL_SCRIPT
@epreston
epreston / cloudlinux-centos-deployment-cmds.txt
Last active June 28, 2021 01:49
cloudlinux deployment on centos - requires wget
wget http://repo.cloudlinux.com/cloudlinux/sources/cln/cldeploy
sh cldeploy -k <key here>
yum update && yum upgrade
reboot
@epreston
epreston / plesk-linux-deployment-cmds.txt
Created June 28, 2021 01:47
plesk deployment on linux
wget http://autoinstall.plesk.com/plesk-installer
chmod +x plesk-installer
./plesk-installer
@epreston
epreston / cloudlinux-lvemanager-install-cmds.txt
Created June 28, 2021 01:49
cloudlinux lvemanager install
yum install lvemanager
@epreston
epreston / cloudlinux-cagefs-deployment-cmds.txt
Created June 28, 2021 01:51
cloudlinux cagefs deployment
yum install cagefs
/usr/sbin/cagefsctl --init
@epreston
epreston / cloudlinux-php-selector-deployment-cmds.txt
Created June 28, 2021 01:52
cloudlinux php selector deployment
yum groupinstall alt-php
yum update cagefs lvemanager
@epreston
epreston / basic.gitignore
Created June 28, 2021 04:02
basic git ignore - exclude os specific system files
# Add any directories, files, or patterns you don't want to be tracked by version control
# Windows and OSX Specific System Files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
*.swp
ehthumbs.db
@epreston
epreston / basic.gitattributes
Last active June 28, 2021 04:09
basic gitattributes - uncomment to enable certain language stats
# Auto detect text files and perform LF normalization
* text=auto
# Files to remove from language stats for this project
# *.css linguist-vendored
# *.scss linguist-vendored
# *.html linguist-vendored
# *.js linguist-vendored
# *.php linguist-vendored
# *.py linguist-vendored