Skip to content

Instantly share code, notes, and snippets.

View fibo99's full-sized avatar

fibo99

  • Remoulins, France
View GitHub Profile
@shingonoide
shingonoide / cleanup_odoo_session.sh
Last active August 30, 2023 14:27
Simple script to clean up Odoo session files
#!/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)
@hespresati
hespresati / jail.local
Created March 10, 2016 13:03
Fail2Ban Tomcat7 configuration
# Fail2Ban local configuration file
[tomcat-manager]
enabled = true
port = 8080,8443
filter = tomcat-manager
logpath = /var/log/tomcat7/localhost_access_log.*.txt
maxretry = 3
@maethor
maethor / letsencrypt-auto-renew.sh
Last active January 15, 2020 16:49
This script generates or regenerates SSL certificates using acme-tiny to sign the certificate signing requests found in /etc/letsencrypt/
#!/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/
@kucaahbe
kucaahbe / dotdeb.txt
Last active January 24, 2017 14:21
install redis on debian stable
add dotdeb repository: http://www.dotdeb.org/instructions/
sudo aptitude install redis-server # for stable
sudo aptitude -t stable install redis-server # for testing
@victorbstan
victorbstan / php_object_to_array.php
Created December 17, 2010 04:18
recursively cast a PHP object to array
<?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);