This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Send an alert via Slack if a UPS event happens. It is usable with nut/upsmon. | |
# licence: CC0 | |
# Slack notifier sctipz to use with nut | |
# configure upsmon.conf like this: | |
# NOTIFYMSG ONLINE "1 UPS %s on line power :electric_plug:" | |
# NOTIFYMSG ONBATT "0 UPS %s on battery :battery:" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SHELL_PREFERENCE=("bash zsh sh") | |
if [ -z "$1" ]; then | |
echo "No conatiner name supplied" | |
exit 255 | |
fi | |
FOUND_CONTAINERS=$(docker container ls --format 'table {{.Names}}\t{{.ID}}' | grep -v "CONTAINER ID" | grep -w ${1}) | |
EXIT_CODE=$? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ppmt_sum(rate, number_of_periods, present_value, number_of_sum_period) | |
{ | |
var sum = 0; | |
var remain_rounds = number_of_sum_period; | |
while (remain_rounds > 0) | |
{ | |
sum += this._my_ppmt(rate, remain_rounds, number_of_periods, present_value) ; | |
remain_rounds--; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lshw -short -c disk | awk '/disk/ {print $2}' | xargs hddtemp | awk -F\: '/°C/ {print $1 ":"$3}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
awk '$9 == "404" {print $7}' access.log |sort|uniq -c|sort -rn| head -n 50 |