• Sep 23, 2024 •AustinLeath
0 likes • 6 views
CLIENT_VPN_ID="cvpn-endpoint-xxxxxxxxxxxx" for region in $(aws ec2 describe-regions --query "Regions[].RegionName" --output text); do echo "Searching in region: $region" aws ec2 describe-client-vpn-endpoints --region $region --query "ClientVpnEndpoints[?ClientVpnEndpointId=='$CLIENT_VPN_ID']" --output table done
• Mar 21, 2021 •LeifMessinger
0 likes • 0 views
#pinger.sh by Leif Messinger #./pinger.sh [ADDRESS] to search #./pinger.sh [ADDRESS] & to search in the background #https://serverfault.com/a/42382 ping_cancelled=false # Keep track of whether the loop was cancelled, or succeeded until ping -c1 "$1" >/dev/null 2>&1; do :; done & # The "&" backgrounds it trap "kill $!; ping_cancelled=true" SIGINT wait $! # Wait for the loop to exit, one way or another trap - SIGINT # Remove the trap, now we're done with it if [ "$ping_cancelled" == true ] #https://stackoverflow.com/a/21210966/10141528 then printf "The pinger for $1 just closed bro.\n" else printf "$1 IS UP BROOO\a\n" fi
• Nov 14, 2021 •LeifMessinger
#!/bin/bash #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 fi done
• Jul 16, 2023 •LeifMessinger
#!/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
• Apr 21, 2021 •LeifMessinger
#diskRipper.sh by Leif Messinger #For use on debian, where your cds aren't immediately mounted wall "CD inserted boss" set -x #echo on cdDrivePath=$(ls -l /dev/cdrom | awk '{print $NF}') #CD could have no label, so that's why I need awk cdLabel=$(lsblk -n "/dev/$cdDrivePath" -o label) if [[ ! -z "$cdLabel" ]]; then #CD has label folderName=$cdLabel echo "The cd label is ${folderName}" if mkdir ./cds/"${folderName}"; then #Folder didn't exist before sudo mount /dev/cdrom ./.cdmountpoint sudo cp -r ./.cdmountpoint/* "./cds/${folderName}" sudo chmod -R 777 "./cds/${folderName}" sudo umount ./.cdmountpoint eject wall "CD done and ejecting" else wall "Already read that cd, skipped" fi else wall "CD had no label, skipped" fi
• 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