Skip to content

Instantly share code, notes, and snippets.

View RickyVaughn2's full-sized avatar
👾
KATN

Ricky Vaughn RickyVaughn2

👾
KATN
View GitHub Profile
"Generate a Js script that creates a button with the text ‘Submit File’ and inserts it into the DOM before an element with the class ‘.flex.flex-col.w-full.py-2.flex-grow.md\:py-3.md\:pl-4’. The button should have a green background color, white text color, 5px padding, no border, 5px border radius and 5px margin. The script should also create a progress element and insert it into the DOM before the same element. The progress element should have a width of 99%, height of 5px and a grey background color. Inside the progress element, there should be another div element representing the progress bar with a width of 0%, height of 100% and blue background color. When the button is clicked, it should create an input element of type ‘file’ that accepts ‘.txt’, ‘.js’, ‘.py’, ‘.html’, ‘.css’, ‘.json’ and ‘.csv’ files. Once a file is selected, using an async it should be read as text and split into chunks of size 15000. using async Each chunk should be submitted into a conversation by doing the following:
async funct
sudo apt update
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - &&\
sudo apt-get install -y nodejs
sudo apt install build-essential git curl
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
@RickyVaughn2
RickyVaughn2 / node_on_80.txt
Created May 17, 2022 18:24
Run node on port 80
sudo setcap 'cap_net_bind_service=+ep' $(eval readlink -f `which node`)
sudo apt update
sudo apt install python3 python3-pip apache2 -y
pip3 install flask
sudo snap install --classic certbot
sudo certbot --apache
sudo certbot renew
openvpn --config client.ovpn
@RickyVaughn2
RickyVaughn2 / aws-sns-example.js
Created June 5, 2019 18:03 — forked from tmarshall/aws-sns-example.js
aws-sdk sns example, in Node.js
var AWS = require('aws-sdk');
AWS.config.update({
accessKeyId: '{AWS_KEY}',
secretAccessKey: '{AWS_SECRET}',
region: '{SNS_REGION}'
});
var sns = new AWS.SNS();
@RickyVaughn2
RickyVaughn2 / install.sh
Last active July 18, 2019 19:54
DP/Sense3 Installer
#run the following command:
#sudo visudo
#add the following to the bottom of the file
#alerttech ALL=(ALL) NOPASSWD:ALL
sudo apt install curl -y
sudo apt install git -y
sudo apt install mosquitto mosquitto-clients -y
sudo apt-get install build-essential -y
@RickyVaughn2
RickyVaughn2 / setupComet.sh
Last active May 1, 2019 15:35
This is a simple bash file to setup a system to run comet.
#you must have comet131 in /home/alerttech/Downloads
#run the following command:
#sudo visudo
#add the following to the bottom of the file
#alerttech ALL=(ALL) NOPASSWD:ALL
sudo apt install curl -y
sudo apt install git -y
@RickyVaughn2
RickyVaughn2 / setup.sh
Created February 19, 2019 23:20
basic nr
sudo apt install curl
curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install -g --unsafe-perm node-red
sudo npm install -g node-red-admin
sudo npm install -g pm2
pm2 start /usr/bin/node-red -- -v
pm2 save
@RickyVaughn2
RickyVaughn2 / installMySQL80.sh
Last active May 3, 2018 19:43
Install MySQL 5.7 in non-interactive mode. Default root password will be "root".
# update
apt-get update && apt-get upgrade -y
# set timezone to cst
echo "America/Chicago" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
# uncomment to enable the firewall and poke holes for ssh and mysql
#ufw enable
#ufw allow 22