Skip to content

Instantly share code, notes, and snippets.

View repodevs's full-sized avatar

Edi Santoso repodevs

View GitHub Profile
@kirancheraku
kirancheraku / DesktopToastsSample.cpp
Created December 2, 2015 13:17
Persistent toast notification in Win32 app with COM server
#include "stdafx.h"
#include "ToastActivator_h.h"
using namespace Microsoft::WRL;
using namespace ABI::Windows::UI::Notifications;
using namespace ABI::Windows::Data::Xml::Dom;
using namespace Windows::Foundation;
class DECLSPEC_UUID("BD8EC9B3-CAEB-465A-B5C0-2ABA5D5839D1") CToastActivator
WrlFinal : public Microsoft::WRL::RuntimeClass<Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::ClassicCom>, INotificationActivationCallback, FtmBase>
@sandys
sandys / postgres.sh
Created May 9, 2012 07:54
postgresql master slave setup on the same machine
pg_createcluster 9.1 testing --start #/etc/postgresql/9.1/testing/
pg_lsclusters
pg_dropcluster 9.1 testing --stop
#follow with rm -rf or potential error
rm -rf /var/lib/postgresql/9.1/testing/
Moved the Write Ahead Log (WAL) to its own partition (so fsyncs of the WAL don't flush all of the dirty data files)
@yelizariev
yelizariev / new-api.sh
Last active March 17, 2017 05:37
Helpers for migrating to new odoo api (10.0+). Obsolete. Check for latest version here: https://odoo-development.readthedocs.io/en/latest/migration/index.html
# IMPORTS
# replace osv, orm
find . -type f -name '*.py' | xargs sed -i 's/from openerp.osv import orm$/from odoo import models/g'
find . -type f -name '*.py' | xargs sed -i 's/from openerp.models.orm import Model$/from odoo.models import Model/g'
find . -type f -name '*.py' | xargs sed -i 's/osv.osv_memory/models.TransientModel/g'
find . -type f -name '*.py' | xargs sed -i 's/osv.osv/models.Model/g'
find . -type f -name '*.py' | xargs sed -i 's/osv.except_osv/UserError/g'
find . -type f -name '*.py' | xargs sed -i 's/osv\./models./g'
find . -type f -name '*.py' | xargs sed -i 's/\<orm\./models./g'
find . -type f -name '*.py' | xargs sed -i 's/\(import .*\), osv/\1, models/g'
@judotens
judotens / kaskus.py
Last active August 23, 2017 14:36
Kaskus search using official API - just for fun
# PS:
# - Extract your own kaskus oauth consumer_key & consumer_secret frm native app. Ref: http://seriot.ch/abusing_twitter_api.php#3
# - No public doc found, but here i attach an api sample sniffed from mitmproxy
import urllib, urllib2
import time
import oauth.oauth as oauth
import string
import random
import sys, json
@iledarn
iledarn / instruction.rst
Last active April 18, 2018 02:24
instruction about replicated odoo

Here you may see about bi-directional replication we have used http://2ndquadrant.com/en/resources/bdr/

We use here 64bit ubuntu 14.04 with docker to demonstrate our replication solution. First we need to install docker .

sudo su
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" > /etc/apt/sources.list.d/docker.list
@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
@maxcnunes
maxcnunes / postgres-dblink.sql
Created April 11, 2016 11:36
Example using dblink to execute a SELECT query between different databases. (PG 9.4)
@shr00mie
shr00mie / jupyterlab_install.sh
Last active July 20, 2019 10:41
Jupyterlab Install + Service on Ubuntu Server 16.04LTS
#!/bin/bash
# variables
# listening address for jupyter. set to localhost if only accessing locally.
read -p $'\n\e[32mServer static IP address\e[m: ' ipAddress
# Set this either as parent or direct working directory of the project you want to work on.
read -p $'\n\e[32mProject Parent Directory\e[m: ' WorkingDirectory
echo -e "\n...\e[32mGenerating random token\e[m...\n"
@funbaker
funbaker / nginx_odoo_multiprocess
Last active July 31, 2019 08:32
odoo nginx static files
upstream odoo9_xmlrpc {
server <xmlrpc address>;
}
upstream odoo9_longpolling {
server <longpolling address>;
}
server {
listen 80;