Skip to main content

Recent Posts

Untitled

Jul 24, 2024AustinLeath

0 likes • 0 views

from statistics import median, mean, mode
def print_stats(array):
print(array)
print("median =", median(array))
print("mean =", mean(array))
print("mode =", mode(array))
print()
print_stats([1, 2, 3, 3, 4])
print_stats([1, 2, 3, 3])

Untitled

May 20, 2024AustinLeath

0 likes • 10 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
}

typescript hello

Nov 21, 2023AustinLeath

0 likes • 23 views

// Print Hello, World!
console.log("Hello, World!");

ruby hello

Nov 21, 2023AustinLeath

0 likes • 12 views

# Print Hello, World!
puts "Hello, World!"

Post Statistics

Posts

No Posts Found

It looks like AustinLeath has no public posts

Likes

Please Log In

You must be authenticated to view a user's likes

Shared

Please Log In

You must be authenticated to view a user's shared posts

Profile Privacy

Multi-Factor Authentication

Multi-Factor Authentication (MFA) is an authentication method that requires you to provide two or more verification factors to gain access to your account. In addition to username and password, MFA requires you to verify your email on every login, which decreases the likelihood of someone stealing your account.

Change Password

Forgot Password?

Identity Color

Changes the color of your profile icon and cursor highlight in the live code editor. You and other users will be able to view this change.

Delete Account

Deleting your account is permanent. All data associated with your account will be lost.