Skip to content

Instantly share code, notes, and snippets.

View nseinlet's full-sized avatar

SEINLET Nicolas nseinlet

View GitHub Profile
#!/bin/bash
RED='\e[31m'
GREEN='\e[32m'
BLUE='\e[34m'
NC='\e[39m' # No Colo
REP1="odoo"
REP2="enterprise"
base_dir="/datas/src-migrations/diffs"
#!/usr/bin/env bash
#%# family=manual
case $1 in
config)
echo graph_category postgres
echo graph_title PostgreSQL Vacuum jobs waiting
echo vacuum_job_waiting.label Vacuum jobs waiting
echo analyse_job_waiting.label Analyse jobs waiting
exit 0
#!/bin/sh
RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
NC='\033[0m' # No Colo
REP1="odoo"
REP2="enterprise"
base_dir="/datas/src-migrations/diffs"
#!/usr/bin/python3
# coding: utf-8
import odoolib
import sys
import random
import threading
from datetime import datetime, date
@nseinlet
nseinlet / read_all_models.py
Created May 3, 2019 07:51
read all odoo models
# coding: utf-8
import odoolib
from datetime import datetime, date
from dateutil.relativedelta import relativedelta
connection = odoolib.get_connection(hostname="localhost", database="odoo", login="admin", password="admin", port=8069)
ir_model = connection.get_model("ir.model")
model_ids = ir_model.search([])
@nseinlet
nseinlet / log2taskset.py
Created April 3, 2019 08:51
odoo logs 2 locust load test
#!/usr/bin/python3
import sys
# grep -v /longpolling openerp.log.1 | grep 127.0.0.1 | grep get | grep -v /event/get_country_event_list | grep -v /im_livechat/ | grep -v trial_do |grep -v /static/ | grep -v assets | grep -v button_immediate | grep -v /web | grep -v /xmlrpc/ | grep -v /yodlee/ | grep -v /plaid/ | awk ' { print $14 }' | sort | uniq -c | sort -nr > urls20190403.log
if __name__ == '__main__':
if len(sys.argv) < 6:
print("Usage : logs2taskset.py host min_wait max_wait logfile taskfile")
else:
logfile = sys.argv[4]
# -*- encoding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Management Solution
# Copyright (C) 2004-TODAY Odoo S.A. <http://www.odoo.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# -*- encoding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Management Solution
# Copyright (C) 2004-TODAY Odoo S.A. <http://www.odoo.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.