Skip to content

Instantly share code, notes, and snippets.

View pedrocifuentes's full-sized avatar

Pedro Cifuentes pedrocifuentes

View GitHub Profile
@pedrocifuentes
pedrocifuentes / gist:6e993b1125be14a105801e628e75f4f9
Created April 1, 2017 09:53
Check SSL cert expiration date
echo | openssl s_client -servername 54.72.84.XXX -connect www.sysled.es:443 2>/dev/null | openssl x509 -noout -dates
### source https://www.shellhacks.com/openssl-check-ssl-certificate-expiration-date/
@pedrocifuentes
pedrocifuentes / mysqlShowTablesSize.sql
Created August 6, 2015 07:55
MySQL show tables sizes
SELECT table_name AS "Tables",
round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB"
FROM information_schema.TABLES
WHERE table_schema = "$DB_NAME"
ORDER BY (data_length + index_length) DESC;
@pedrocifuentes
pedrocifuentes / gist:1f2b91fcb80a93bbee81
Created July 14, 2015 16:25
Download full web with dependencies
wget --page-requisites -v --convert-links http://**.com/clientes/sysled/index.html
git log --author=Yoel --since=6.weeks --pretty=format:'%C(yellow)%h|%Cred%ad|%Cblue%an|%Cgreen%d %Creset%s' --date=short | column -ts'|' | less -r
#!/bin/sh
USER=$(whoami)
APACHE_USER=$(ps axho user,comm|grep -E "httpd|apache"|uniq|grep -v "root"|awk 'END {print $1}')
sudo chmod +a "$USER allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
sudo chmod +a "$APACHE_USER allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
echo "app/cache & app/logs been properly chmod'ed for $USER and $APACHE_USER"