• Oct 17, 2023 •C S
2 likes • 17 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; server_name your_domain.com; 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
• Apr 3, 2025 •LeifMessinger
0 likes • 4 views
#!/usr/bin/env bash #Splits a command across a number of CELL machines user=$(whoami) if [[ -z $user ]]; then echo "whoami failed. Exiting..." exit 1 fi command="$1" if [[ -z $command ]]; then echo "Need to put in a command." exit 1 fi shift array=("$@") let start=8 let stop=18 for ((i = $start; i <= $stop; i++)); do extraZero=$(if [[ "$i" -lt 10 ]]; then echo "0"; fi) domain="CELL${extraZero}${i}-CSE.ENG.UNT.EDU" let "index = i - start" echo ${#array[@]} if [[ ${#array[@]} != 0 ]] && [[ $index -ge ${#array[@]} ]]; then echo "$index > ${#array[@]}" break fi ssh -o StrictHostKeyChecking=accept-new "${user}@${domain}" -t "$command ${array[$index]}" & done
• Oct 9, 2023 •C S
0 likes • 156 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
• Nov 18, 2022 •AustinLeath
0 likes • 9 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>' "https://www.abuseipdb.com/report/json"
• Feb 22, 2022 •LeifMessinger
0 likes • 1 view
#Leif Messinger #For when you want to search a lot of words in a file fast #Arg 1 is the argument the list of words you want to search #Arg 2 is the file you want to search #-z means that it looks at the file as a whole, just treating newlines a characters. #-r is regex. Needed for $, even tho the documentation says you don't need it. They are liars. #First command replaces all . with \. and all - with \- #Second command takes all newlines and replaces them with )|( #Third command takes the trailing |( and deletes it #Forth command puts a /( at the start #Fith command puts /!d at the end. This tells it to not delete any lines that match the pattern. #The second sed takes the output of the first sed as a command that searches any of the combined words #-f - takes a command from the input sed -z -r -e 's/\./\\\./g ; s/\-/\\\-/g' -e 's/\n/\)\|\(/g' -e 's/\|\($//' -e 'i/\(' -e 'a/!d' $1 | sed -r -f - $2
• Jul 29, 2024 •AustinLeath
0 likes • 7 views
for region in `aws ec2 describe-regions --output text | cut -f4` do echo -e "\nListing Instances in region:'$region'..." aws ec2 describe-instances --query 'Reservations[*].Instances[*].{Instance:InstanceId,Subnet:SubnetId}' --region $region done #This script is to be used with any AWS CLI configured environment, it will list any EC2 instances and their associated subnet network ID's in JSON format