Skip to main content

0 likes • Apr 21, 2021 • 0 views

More Shell Posts

abuseipdb config

0 likes • Nov 18, 2022 • 0 views
#for ssh abuse attempts
action = %(action_)s
%(action_abuseipdb)s[abuseipdb_apikey="", abuseipdb_category="18,22"]
actionban = curl --fail --ciphers ecdhe_ecdsa_aes_256_sha --data 'key=<abuseipdb_apikey>' --data-urlencode 'comment=<matches>' --data 'ip=<ip>' --data 'category=<abuseipdb_category>' ""

0 likes • Sep 29, 2021 • 20 views
#!/bin/bash [file1 [file2...]]
#Prints out the commands needed to copy the file to your local machine
#This will work on any server that also has the same hostname as in your hosts file.
#I should update this to detect if a file is a directory, and enable recursion for those commands. If you do it now, it will probably just warn you.
if [ -n "$1" ]; then
while [ -n "$1" ]; do
printf "scp \"$(whoami)@$(hostname):"
printf `readlink -f $1`
printf "\" .\n"
echo "scp \"$(whoami)@$(hostname):$PWD/*\" ."
#On the UNT cell machines, you have to do this script instead
#if [ -n "$1" ]; then
# while [ -n "$1" ]; do
# printf "scp $(whoami)@$(hostname)"
# printf `readlink -f $1`
# printf " .\n"
# shift
# done
# echo "scp $(whoami)@$(hostname)$PWD/* ."

Nginx Serve Storybook

0 likes • Oct 17, 2023 • 10 views
# ---------------- FIREWALL STEPS ----------------
# Check if firewalld is installed and running
sudo systemctl status firewalld
# If it's not running, you can start and enable it
sudo systemctl start firewalld
sudo systemctl enable firewalld
# Add a rule to allow traffic on port 6006. Port 6006 is the default port that storybook runs on.
sudo firewall-cmd --permanent --add-port=6006/tcp
# Reload the firewall for the changes to take effect
sudo firewall-cmd --reload
# Check the list of allowed ports
sudo firewall-cmd --list-ports
# ---------------- NGINX STEPS ----------------
# Install Nginx (if not already installed)
sudo yum install nginx
# Start and enable Nginx
sudo systemctl start nginx
sudo systemctl enable nginx
# Copy your storybook-static directory to a location that Nginx can serve from.
# The default web root directory for Nginx is /usr/share/nginx/html.
sudo cp -r /path/to/storybook-static /usr/share/nginx/html/
# Adjust file permissions if needed to ensure that Nginx can read the files
sudo chown -R nginx:nginx /usr/share/nginx/html/storybook-static
# Put the following server block in /etc/nginx/conf.d/storybook.conf
server {
listen 6006;
location / {
root /usr/share/nginx/html/storybook-static;
index index.html;
# Test the Nginx configuration for syntax errors
sudo nginx -t
# If there are no errors, reload Nginx to apply the changes
sudo systemctl reload nginx

Update Prefixed Dependencies

0 likes • Oct 9, 2023 • 52 views
# Update all npm packages under the scope defined by the PREFIX variable ("foo").
PREFIX="foo"; npm ls | grep "$PREFIX" | awk -F/ '{print $NF}' | sed 's/@.*//' | xargs -I package npm update @"$PREFIX"/package

0 likes • Nov 14, 2021 • 0 views
#Takes all the c and h files in the current directory and prints them
#Yup, it's that easy
for file in *.h *.hpp *.c *.cpp; do
#If it exists
if [ -f "$file" ]; then
echo "//===============$file==============="
cat $file

0 likes • Nov 17, 2021 • 1 view
#Takes command line arguments and pulls the header files.
#Good for checking if the function you want is in the header or not. "time.h"
while [ "$1" != "" ]; do
echo "#include<$1>" | g++ -x c++ -E -