• 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
• 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
• 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"
• Nov 8, 2021 •LeifMessinger
0 likes • 1 view
#!/bin/bash #Installs the Vulkan library and other goodies. Works on Arch and Arch based distros. Needs pacman and makepkg installVulkan(){ #Tries installing every linux package in existence packages=( vulkan-tools libvulkan-dev vulkan-loader-devel vulkan-validation-layers spirv-tools mesa-vulkan-devel vulkan-validation-layers-devel ) for package in ${packages[*]}; do sudo pacman --noconfirm -S $package done } installLibraries(){ #All of these packages don't exist, so we have to download and install the AUR packages #packages=( libglfw3-dev glfw-devel libglm glm-devel ) #for package in ${packages[*]}; do # sudo pacman --noconfirm -S $package #done sudo git clone https://aur.archlinux.org/glfw-git.git /tmp/glfw-git sudo chmod 777 /tmp/glfw-git cd /tmp/glfw-git makepkg -si sudo git clone https://aur.archlinux.org/glm-git.git /tmp/glm-git sudo chmod 777 /tmp/glm-git cd /tmp/glm-git makepkg -si } installShaderCompiler(){ #Basically installs glslc sudo pacman -S shaderc } while true; do select bruh in installVulkan installLibraries installShaderCompiler "exit"; do $bruh done done
• Nov 17, 2021 •LeifMessinger
#!/bin/bash #Takes command line arguments and pulls the header files. #Good for checking if the function you want is in the header or not. #cppToStdout.sh "time.h" while [ "$1" != "" ]; do echo "#include<$1>" | g++ -x c++ -E - shift done
• Nov 4, 2023 •LeifMessinger
0 likes • 7 views
#!/bin/bash git status echo "Do you want to add all changed files?" select yn in "Yes" "No"; do case $yn in Yes ) break;; No ) exit 1;; esac done git add -u git status echo "Does this look right?" select yn in "Yes" "No"; do case $yn in Yes ) break;; No ) exit 2;; esac done git commit echo "Do you want to push?" select yn in "Yes" "No"; do case $yn in Yes ) break;; No ) exit 2;; esac done git push