Check when an SSL certificate expires:
echo | openssl s_client -connect site:port 2>/dev/null | openssl x509 -noout -dates
We'll check this and the next example using google.com :
#! /bin/bash | |
REQUIRED_CONNECTION_NAME="NAME" | |
VPN_CONNECTION_NAME="VPN_NAME" | |
activ_con=$(nmcli con status | grep "${REQUIRED_CONNECTION_NAME}") | |
activ_vpn=$(nmcli con status | grep "${VPN_CONNECTION_NAME}") | |
if [ "${activ_con}" -a ! "${activ_vpn}" ]; | |
then |
#!/bin/bash | |
while read NAME; do | |
YEAR=$(echo $NAME | sed -r 's/\ -\ /_/' | awk -F_ '{print $1}') | |
NEWNAME=$(echo $NAME | sed -r 's/\ -\ /_/' | awk -F_ '{print $2}') | |
mv "$NAME" "$NEWNAME ($YEAR)" | |
done < <(ls -1 | grep -v rename.sh) | |
shutdown /s /f /t 3600 | |
REM where | |
REM /s - shutdown local computer | |
REM /f - force programs to close without showing warning | |
REM /t 3600 - delay for 3600 seconds (1 hour) |
#!/bin/bash | |
dd if=/dev/vg/sys01 | pv -ptera -s 10g | dd of=/dev/vg/sys02 |
interface=wlan0 | |
driver=nl80211 | |
country_code=RO | |
ieee80211d=1 | |
ssid=SSIDNAME | |
channel=6 | |
hw_mode=g |
#!/bin/bash | |
type iconv >/dev/null 2>&1 || { echo >&2 "iconv has to be installed. Aborting."; exit 1; } | |
find . -type f | while read FILE; do | |
if [ -f "$(echo "$FILE" | iconv -f utf8 -t ascii//TRANSLIT)" ]; then | |
echo "No rename required: $FILE" | |
else | |
mv -v "$FILE" "$(echo "$FILE" | iconv -f utf8 -t ascii//TRANSLIT)" | |
fi | |
done |
until /opt/Nagstamon/Nagstamon/nagstamon.py; do | |
echo "Nagstatmon crashed; respawing..." | |
sleep 1 | |
done | |
# check site for poodle | |
nmap --script ssl-enum-ciphers -p 443 twitter.com |grep "SSLv3: No supported" ||echo "Site vulnerable to poodle" |
# | |
# ESE Key Deamon 1.2.7 config file | |
# | |
# | |
# example 1: to run mutt in xterm we must set DISPLAY | |
# so the command line will be as follows: | |
#MAIL:/bin/sh -c "DISPLAY=:0 xterm -e mutt" | |
# | |
# example 2: turn on/off GPS reciever when lid is open/closed |