This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# example | |
# add this to crontab -e of odoo user | |
# curl -sL https://gist.github.com/shingonoide/1947a97e3c00168372e950a6788ce9ad/raw/cleanup_odoo_session.sh > /tmp/cleanup_sessions.sh && sh /tmp/cleanup_sessions.sh 4 | |
HOW_OLDER=${1:-6} | |
VERBOSE=${2:-0} | |
SESSION_FOLDER="$HOME/.local/share/Odoo/sessions" | |
TOTALFILES=$(find $SESSION_FOLDER -name '*.sess' | wc -l) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fail2Ban local configuration file | |
[tomcat-manager] | |
enabled = true | |
port = 8080,8443 | |
filter = tomcat-manager | |
logpath = /var/log/tomcat7/localhost_access_log.*.txt | |
maxretry = 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Guillaume Subiron, Sysnove, 2016 | |
# Inspired by Benjamin Sonntag's https://github.com/octopuce/octopuce-goodies/blob/master/letsencrypt-renew/letsencrypt-auto-renew.sh | |
# | |
# Description : | |
# | |
# This script generates or regenerates SSL certificates using acme-tiny | |
# to sign the certificate signing requests found in /etc/letsencrypt/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add dotdeb repository: http://www.dotdeb.org/instructions/ | |
sudo aptitude install redis-server # for stable | |
sudo aptitude -t stable install redis-server # for testing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
This function saved my life. | |
found on: http://www.sitepoint.com/forums//showthread.php?t=438748 | |
by: crvandyke | |
It takes an object, and when all else if/else/recursive functions fail to convert the object into an associative array, this one goes for the kill. Who would'a thunk it?! | |
*/ | |
$array = json_decode(json_encode($object), true); |