Skip to content

Instantly share code, notes, and snippets.

View repodevs's full-sized avatar

Edi Santoso repodevs

View GitHub Profile
@repodevs
repodevs / kaskus.py
Created August 23, 2017 14:36 — forked from judotens/kaskus.py
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
@repodevs
repodevs / product.py
Created August 24, 2017 05:59
an ugly method, to constrains odoo default_code (and name)
# -*- coding: utf-8 -*-
# © 2017 Edi Santoso <repodevs@gmail.com>
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
from odoo import api, fields, models, _
class Product(models.Model):
_inherit = 'product.template'
@api.constrains('default_code', 'name')
def _check_code(self):
@repodevs
repodevs / partner.py
Created September 6, 2017 05:48
odoo name_get inherit
# -*- coding: utf-8 -*-
# © 2017 Niaga Solution - Edi Santoso <repodevs@gmail.com>
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from odoo import api, models
class Contact(models.Model):
_inherit = 'res.partner'
@api.multi
def name_get(self):
@repodevs
repodevs / phpmyadmin.conf
Created September 16, 2017 04:40
nginx PhpMyAdmin config example
# /etc/nginx/phpmyadmin.conf
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
#!/bin/bash
echo "Start Export Process"
echo "Log into Keybase..."
keybase login
echo "Exporting your PGP keys..."
keybase pgp export -o keybase.public.key
keybase pgp export -s -o keybase.private.key
@repodevs
repodevs / instruction.rst
Created October 21, 2017 07:27 — forked from iledarn/instruction.rst
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
@repodevs
repodevs / nginx_odoo.conf
Created January 18, 2017 06:52
odoo nginx config
server {
listen 80 default_server;
#rewrite ^/.*$ https://$host$request_uri? permanent; #Uncomment this line in case you want to use https only
#server_name {{ODOO_DOMAIN}};
include odoo_params;
location /longpolling {
proxy_pass http://127.0.0.1:8072;
}
location / {
@repodevs
repodevs / autoaway.py
Created December 20, 2017 08:42 — forked from charliewolf/autoaway.py
Email notifications for chats received in Fonality HUD when away
#!/usr/bin/python
# Quick and (very) dirty script to send emails when a user gets a message and is away from HUD
from base64 import b64decode
from hashlib import sha256
import sqlite3
import datetime
import itertools
import os
@repodevs
repodevs / odoo-wsgi.py
Created February 3, 2018 10:09 — forked from danidee10/odoo-wsgi.py
Odoo wsgi file for running odoo10 as a wsgi application
# WSGI Handler sample configuration file.
#
# Change the appropriate settings below, in order to provide the parameters
# that would normally be passed in the command-line.
# (at least conf['addons_path'])
#
# For generic wsgi handlers a global application is defined.
# For uwsgi this should work:
# $ uwsgi_python --http :9090 --pythonpath . --wsgi-file openerp-wsgi.py
#
@repodevs
repodevs / hosts
Created February 11, 2018 16:32
Open Reddit and Vimeo
# place this ini /etc/hosts
# Reddit
151.101.129.140 reddit.com
151.101.49.140 www.reddit.com
151.101.49.140 i.redditmedia.com
151.101.49.140 m.reddit.com
151.101.49.140 g.redditmedia.com
151.101.49.140 a.thumbs.redditmedia.com
151.101.193.140 redditgifts.com