mybin

my ~/bin
git clone https://a3nm.net/git/mybin/
Log | Files | Refs | README

commit 51cce3fb0b5aa313501d251dc0361bedbecd6db3
parent 9d2918e4144e065b87d65609bbb434c0e8908233
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Wed,  9 Nov 2016 00:18:46 +0100

Merge branch 'master' of a3nm.net:git/mybin

Diffstat:
df-alert | 5+++--
flip-yoga | 8++++----
ssleft | 4++++
3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/df-alert b/df-alert @@ -1,12 +1,13 @@ #!/bin/bash -THRESHOLD=95 +EMAIL=${1:-a3nm@localhost} +THRESHOLD=${2:-95} function do_check() { CURRENT=$(df "$1" | grep / | awk '{ print $5}' | sed 's/%//g') if [ "$CURRENT" -gt "$THRESHOLD" ] ; then - mail -s "[df-alert] `hostname`:$1 using $CURRENT%" a3nm@localhost << EOF + mail -s "[df-alert] `hostname`:$1 using $CURRENT%" "$EMAIL" << EOF df-alert notification: `hostname`:$1 uses $CURRENT% EOF fi diff --git a/flip-yoga b/flip-yoga @@ -2,19 +2,19 @@ case $1 in normal ) -xrandr --output LVDS1 --rotate normal +xrandr --output LVDS-1 --rotate normal xinput set-prop 'ELAN Touchscreen' 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1 ;; inverted ) -xrandr --output LVDS1 --rotate inverted +xrandr --output LVDS-1 --rotate inverted xinput set-prop 'ELAN Touchscreen' 'Coordinate Transformation Matrix' -1 0 1 0 -1 1 0 0 1 ;; left ) -xrandr --output LVDS1 --rotate left +xrandr --output LVDS-1 --rotate left xinput set-prop 'ELAN Touchscreen' 'Coordinate Transformation Matrix' 0 -1 1 1 0 0 0 0 1 ;; right ) -xrandr --output LVDS1 --rotate right +xrandr --output LVDS-1 --rotate right xinput set-prop 'ELAN Touchscreen' 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1 ;; esac diff --git a/ssleft b/ssleft @@ -10,9 +10,12 @@ MARGIN=${3:-0} MARGIN_S=$((24*60*60 * $MARGIN)) CERT=$(echo | openssl s_client -connect $HOST:$PORT -servername $HOST 2>/dev/null) + +DATES=$(echo "$CERT" | openssl x509 -noout -dates) if [[ $MARGIN -eq 0 ]] then + echo "$DATES" echo "$CERT" exit 0 fi @@ -21,6 +24,7 @@ if ! (echo "$CERT" | openssl x509 -noout -checkend $MARGIN_S) then echo "== cert for $HOST:$PORT will expire in <= $MARGIN days ==" echo "details of cert are:" + echo "$DATES" echo "$CERT" exit 3 fi