• Jul 16, 2023 •LeifMessinger
0 likes • 6 views
#!/bin/bash sudo apt install build-essential vulkan-tools libvulkan-dev vulkan-validationlayers-dev spirv-tools libglfw3-dev libglm-dev libtinyobjloader-dev #The rest of this downloads the Vulkan Tutorial project and its dependencies. #Comment this out to keep going exit sudo apt install git cmake cmake-gui sudo mkdir /usr/lib/stb pushd /usr/lib/stb sudo wget https://raw.githubusercontent.com/nothings/stb/master/stb_image.h popd cd ~/Documents git clone https://github.com/Overv/VulkanTutorial.git cd VulkanTutorial/code cmake -S . -B build -DCMAKE_INSTALL_PREFIX:PATH="/usr/local" -DSTB_INCLUDEDIR:PATH="/usr/lib/stb" cd build make
• 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
• Feb 5, 2024 •LeifMessinger
0 likes • 11 views
#!/bin/bash # Recursively find all .svelte files in the current directory and its subdirectories find . -type f -name "*.svelte" -o -name "*.html" -o -name "*.htm" | while read file; do # Replace all h1 tags with the specified format sed -i 's/<h1>\(.*\)<\/h1>/<h1 id="\1">\1<\/h1>/g' "$file" # Replace all h2 tags with the specified format sed -i 's/<h2>\(.*\)<\/h2>/<h2 id="\1">\1<\/h2>/g' "$file" # Remove whitespace from the id attribute value for i in {0..10} ; do sed -i 's/\(id="[^"]*\)\W\([^"]*"\)/\1\2/g' "$file" done done
• 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
• 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
• Nov 18, 2022 •AustinLeath
# # Austin Leath # checks for /Desktop symlink. Creates the symlink if it doesnt already exist # #Fetch the target user if desired, otherwise use the currently logged in user. if [ "$4" != "" ]; then TARGET_USER=$4 else TARGET_USER=$3 fi if [ "$5" != "" ]; then DIRECTORY_NAME=$5 else TARGET_USER="$3 Desktop" fi # Functions CHECK_SYMLINK() { if test -f "/Desktop"; then echo "/Desktop exists" else echo "/Desktop does not exist" fi } CHECK_SYNTHETIC_CONF() { if test -f "/etc/synthetic.conf"; then echo "/etc/synthetic.conf exists" else echo "/etc/synthetic.conf does not exist" fi } CREATE_SYMLINK() { if [[ $(CHECK_SYNTHETIC_CONF) != "/etc/synthetic.conf exists" ]]; then echo "/etc/synthetic.conf does not exist. creating.." touch /etc/synthetic.conf chown -R root:wheel /etc/synthetic.conf fi if grep -q "$DIRECTORY_NAME" /etc/synthetic.conf; then echo "$DIRECTORY_NAME already exists" exit 1 else echo "$DIRECTORY_NAME\t/Users/$TARGET_USER/Desktop" >> /etc/synthetic.conf fi echo "/Desktop symbolic link created" } if [[ $(CHECK_SYMLINK) != "/Desktop exists" ]]; then CREATE_SYMLINK fi exit 0