Skip to content

Instantly share code, notes, and snippets.

nagyv / odoo.ini
Created Dec 29, 2014
odoo supervisor ini
View odoo.ini
directory=/home/openerp/odoo -c /home/openerp/odoo/
nagyv / 0 - odoo logs to sentry
Last active Dec 5, 2018 — forked from avoine/gist:2912777
Script to send rsyslog message of OpenERP to Sentry
View 0 - odoo logs to sentry
This gist provides a simple setup to add Sentry logging to OpenERP/Odoo.
As Odoo's logging setup is rather limited, I'm using syslog to collect and forward logs to Sentry.
These scripts should run without any modification on an Ubuntu based server, assuming the paths and user names for openerp match with the ones in the `supervisord.conf` file.
To have rsyslog2sentry run fine, you'll need some python pagkages installed
$ pip install raven loggerglue
nagyv / gist:e8673fb9344bf6b7fc58
Last active Aug 29, 2015
brew install -v --HEAD goaccess 2>&1 failure
View gist:e8673fb9344bf6b7fc58
$ brew --config
HEAD: f92e7ec4077ebb226a9637b369db0e294a7afa8e
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit ivybridge
OS X: 10.9.2-x86_64
Xcode: 5.1.1
nagyv /
Created May 6, 2014
A python script for downloading and processing Amazon S3 logs using goaccess
import os
from boto.s3.connection import S3Connection
import subprocess
from datetime import datetime, date
import argparse
import tempfile
import json
parser = argparse.ArgumentParser(description="Downloads logs from S3, and parses them with goaccess.")
nagyv /
Created Oct 29, 2012
Django facebook connect middleware w/ facepy
import logging
import facepy as facebook
from django.conf import settings
from django.contrib.auth.signals import user_logged_in
from django.db import models
from django.contrib.auth import logout
from django.contrib.auth.models import User
class FBAuthMiddleware(object):
def __init__(self):
nagyv /
Created May 22, 2012
Google Protobuffer field for Django
''' A model field to store and retrieve Google Protocol Buffer objects easily.
Uses the BlobField available on GAE for storage.
myfield = ProtobufField(protoclass=MyProtocolClass)
where MyProtocolClass is a protocol descriptor class generated from a .proto file.
The field is supposed to store only the given kind of protocol messages.
nagyv / gist:2538496
Created Apr 29, 2012
Testing mongoose pre-save with async
View gist:2538496
var mongoose = require('mongoose'),
async = require('async'),
Schema = mongoose.Schema,
ObjectId = Schema.ObjectId;
var MyS = new Schema({
feeling: String
MyS.pre('save', function(done){
nagyv / mongoose-test.js
Created Apr 4, 2012
The simplest Mongoose app to run
View mongoose-test.js
var mongoose = require('mongoose'),
Schema = mongoose.Schema,
ObjectId = Schema.ObjectId;
var myS = new Schema({
name: {type: String, required: true}
var My = mongoose.model('My', myS);
var my = new My({'name': 'bika'});
nagyv / file1.js
Created Mar 17, 2012
Creating JSON request browser with Tobi
View file1.js
var tobi = require('tobi'),
browser = tobi.createBrowser(8000, "localhost");
json_browser = (function(){
var json_header = {headers:
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest"
nagyv / file1.js
Created Mar 11, 2012
Connecting to mongodb using a mongodb:// uri
View file1.js
var Db = require('mongodb').Db;
options.noOpen = true;
myDb = Db.connect(mongouri, options);
// or
options.noOpen = false;