Skip to content

Instantly share code, notes, and snippets.

View zakthan's full-sized avatar

Thanassis Zakopoulos zakthan

  • Pan-net
  • Athens
View GitHub Profile
@zakthan
zakthan / check-certs.sh
Last active February 5, 2021 10:09 — forked from cgmartin/check-certs.sh
Bash SSL Certificate Expiration Check
#!/bin/bash
TARGETS="www.google.com www.cnn.com";
RECIPIENT="aaa@gmail.com";
DAYS=7;
for TARGET in $TARGETS
do
echo "checking if $TARGET expires in less than $DAYS days";
expirationdate=$(date -d "$(: | openssl s_client -connect $TARGET:443 -servername $TARGET -4 2>/dev/null \
@zakthan
zakthan / tomcatctl
Created May 3, 2018 12:29 — forked from chaifeng/tomcatctl
Tomcat control script, init.d autostart
#!/bin/sh
# Tomcat Control Script
#
# Usage:
# ln -s /path/to/tomcatctl $HOME/apache-tomcat-6.0.37/
# sudo ln -s $HOME/apache-tom-6.0.37/tomcatctl /etc/init.d/tomcatctl
# sudo /etc/init.d/tomcatctl status
#
# In crontab
# */1 * * * * $HOME/apache-tomcat-6.0.37/tomcatctl monitor http://localhost:8080/ > /dev/null || $HOME/apache-tomcat-6.0.37/tomcatctl condrestart > /dev/null