Skip to content

Instantly share code, notes, and snippets.

@nagyv
nagyv / README.md
Last active September 20, 2016 13:28
Git image diff

What it this for?

Have you ever wandered how to follow changes in images using git? This is a solution for the problem.

How to install

  1. Copy git-imgdiff.sh somewhere under your $PATH. Probably $HOME/bin.
  2. Create the $HOME/.gitattributes file with the following content ~/.gitattributes
@nagyv
nagyv / rebuild_libreoffice.sh
Last active October 4, 2018 03:40 — forked from lukebranch/rebuild_libreoffice.sh
Rebuild Libreoffice for ubuntu 14.04 trusty with python2 support for python-uno
#!/bin/sh
# we need some fixes from 14.10
# sudo add-apt-repository --enable-source ppa:libreoffice/libreoffice-4-3
sudo add-apt-repository --enable-source ppa:libreoffice/libreoffice-4-3 -y
# fetch this repository
sudo apt-get update -y
# update your libreoffice installation
sudo apt-get install libreoffice python3-uno -y
# get all build dependencies for libreoffice
sudo apt-get build-dep libreoffice -y
@nagyv
nagyv / odoo.ini
Created December 29, 2014 15:44
odoo supervisor ini
[program:odoo]
user=openerp
directory=/home/openerp/odoo
command=odoo.py -c /home/openerp/odoo/openerp_serverrc.prod
environment=PATH="/home/openerp/odoo/venv/bin"
autostart=true
autorestart=true
stopsignal=QUIT
stopwaitsecs=30
startsecs=5
@nagyv
nagyv / 0 - odoo logs to sentry
Last active December 5, 2018 06:49 — forked from avoine/gist:2912777
Script to send rsyslog message of OpenERP 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
nagyv / gist:e8673fb9344bf6b7fc58
Last active August 29, 2015 14:01
brew install -v --HEAD goaccess 2>&1 failure
$ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew.git
HEAD: f92e7ec4077ebb226a9637b369db0e294a7afa8e
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit ivybridge
OS X: 10.9.2-x86_64
Xcode: 5.1.1
CLT: 5.1.0.0.1.1396320587
@nagyv
nagyv / goaccess.py
Created May 6, 2014 15:37
A python script for downloading and processing Amazon S3 logs using goaccess
#!/bin/python
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
nagyv / middleware.py
Created October 29, 2012 09:32
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
nagyv / fields.py
Created May 22, 2012 10:53
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.
Usage:
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
nagyv / gist:2538496
Created April 29, 2012 07:10
Testing mongoose pre-save with async
var mongoose = require('mongoose'),
async = require('async'),
Schema = mongoose.Schema,
ObjectId = Schema.ObjectId;
var MyS = new Schema({
feeling: String
});
MyS.pre('save', function(done){
async.parallel([
@nagyv
nagyv / mongoose-test.js
Created April 4, 2012 13:37
The simplest Mongoose app to run
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'});