• Aug 16, 2023 •C S
0 likes • 6 views
# Run "test" script on all packages npm run test --workspaces # Tip - this also works: npm run test -ws ---------------------------------------------------- # Runs "test" only on package-a npm run test --workspace package-a # Tip - this also works: npm run test -w package-a ---------------------------------------------------- # Install `lodash` on `package-a` npm install lodash --workspace package-a # Install `tap` on `package-b` as a dev dependency npm install tap --workspace package-b --save-dev # Install `package-a` on `package-b` npm install package-a --workspace package-b # Install `eslint` in all packages npm install eslint --workspaces
• 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 }
• 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
• 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
• 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
• 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