Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryan radiofrequency

View GitHub Profile
@radiofrequency
radiofrequency / gist:557d2b50e9c9612bf7c7e40cedd05e52
Last active Sep 13, 2020
delete node_modules in projects not used over a year
View gist:557d2b50e9c9612bf7c7e40cedd05e52
find . -name "node_modules" -type d -prune -mtime +365 | xargs du -chs
#find . -name "node_modules" -type d -prune -mtime +365 -exec rm -rf '{}' +
@radiofrequency
radiofrequency / expired_certs.sh
Created Oct 12, 2020
show lets encrypt certificates that are expired
View expired_certs.sh
unix_todate=$(date -d "${todate}" "+%s")
for pem in /etc/letsencrypt/live/*/cert.pem; do
if [ $(date --date="$(openssl x509 -enddate -noout -in "$pem"|cut -d= -f 2)" "+%s") -le $unix_todate ];
then
printf '%s: %s\n' \
"$(date --date="$(openssl x509 -enddate -noout -in "$pem"|cut -d= -f 2)" --iso-8601)" \
"$pem"
fi
done | sort
@radiofrequency
radiofrequency / delete_expired_certs.sh
Created Oct 12, 2020
delete expired lets encrypt certificates
View delete_expired_certs.sh
unix_todate=$(date -d "${todate}" "+%s")
getDomainName() {
echo $1 | cut -d'/' -f 5
}
for pem in /etc/letsencrypt/live/*/cert.pem; do
if [ $(date --date="$(openssl x509 -enddate -noout -in "$pem"|cut -d= -f 2)" "+%s") -le $unix_todate ];
then
domain=$(getDomainName $pem)
printf 'deleting cert %s expired: %s\n' \
"$domain" \
View gym.py
import os
import pickle
import warnings
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from tensorflow.keras.callbacks import EarlyStopping
from tensorflow.keras.layers import Dense
from tensorflow.keras.layers import Dropout