Skip to content

Instantly share code, notes, and snippets.

View epreston's full-sized avatar

Ed Preston epreston

View GitHub Profile
View fix-your-timestep.m
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,
View audit-public-ssh-keys.sh
# 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
View create-local-mysql-db-user.sh
#!/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
View cloudlinux-centos-deployment-cmds.txt
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
View plesk-linux-deployment-cmds.txt
wget http://autoinstall.plesk.com/plesk-installer
chmod +x plesk-installer
./plesk-installer
@epreston
epreston / cloudlinux-cagefs-deployment-cmds.txt
Created June 28, 2021 01:51
cloudlinux cagefs deployment
View cloudlinux-cagefs-deployment-cmds.txt
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
View cloudlinux-php-selector-deployment-cmds.txt
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
View basic.gitignore
# 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
View basic.gitattributes
# 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