Skip to content

Instantly share code, notes, and snippets.

View epreston's full-sized avatar

Ed Preston epreston

View GitHub Profile
@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-lvemanager-install-cmds.txt
Created June 28, 2021 01:49
cloudlinux lvemanager install
yum install lvemanager
@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-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 / 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 / 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
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 )