• Oct 30, 2020 •LeifMessinger
0 likes • 2 views
#!/bin/bash #getDependencies.sh by Leif Messinger grep -Po '#include\s*"\K.+(?=")' | while read -r line ; do echo -n " $line" ./getDependencies.sh < $line done
• May 20, 2024 •AustinLeath
0 likes • 13 views
#!/bin/sh BAT_LOW=15 BAT_CRITICAL=5 if [ "$1" = "--help" ] then printf " Usage: \tbattery_check.sh warning%% hibernate%% Description: \tA script for notifying the user via dunst and logging when \tthe battery is low and the system is going to hibernate. \tCan be supplied arguments for the battery low warning and \thibernation percentage thresholds as the first and second arguments. \t Default behavior is to warn at 15% and hibernate at 5%." exit fi if [[ -n "$1" && -n "$2" && $1 -gt $2 ]] then BAT_LOW=$1 BAT_CRITICAL=$2 fi acpi -b | awk -F'[,:%]' '{print $2, $3}' | { read -r status capacity echo Low threshold: $BAT_LOW, Hibernate threshold: $BAT_CRITICAL echo Status: $status, Capacity: $capacity if [ "$status" = Discharging -a "$capacity" -le $BAT_CRITICAL ]; then echo Battery critical threshold. dunstify -u critical "Critical battery threshold, hibernating..." logger "Critical battery threshold, hibernating..." sleep .5 systemctl hibernate exit fi if [ "$status" = Discharging -a "$capacity" -le $BAT_LOW ]; then echo Battery low threshold. dunstify -u critical 'Battery low! System will hibernate at 5%.' logger 'Battery low! System will hibernate at 5%.' sleep .5 light -S 15 exit fi }
• Jul 16, 2023 •LeifMessinger
0 likes • 5 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
• 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
• Nov 14, 2021 •LeifMessinger
0 likes • 0 views
#!/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
• Nov 18, 2022 •AustinLeath
0 likes • 1 view
# # 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