Skip to content

Instantly share code, notes, and snippets.

View repodevs's full-sized avatar

Edi Santoso repodevs

View GitHub Profile
@repodevs
repodevs / macOS.sh
Created December 12, 2018 14:56
gpg: signing failed: Inappropriate ioctl for device macOS
❱ git config user.signingKey 38AF394C
❱ git config commit.gpgSign true
❱ echo "test" | gpg --clearsign
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
test
gpg: signing failed: Inappropriate ioctl for device
gpg: [stdin]: clear-sign failed: Inappropriate ioctl for device
@repodevs
repodevs / example.py
Created July 10, 2019 04:19
Django multiple insert data / bulk create
"""
This is simple snippet to insert multiple data / bulk create in django
"""
# take example, we have a list of dict data
datas = [{
"name": "A",
"number: 1,
}, {
"name": "B",
@repodevs
repodevs / NOTES.md
Last active October 29, 2022 10:55
Odoo OCA queue_job to comply with pgBouncer

EDITED

Use bellow config in your odoo.conf to make it works by bypassing pgbouncer for queue_job

[options]
addons_path = /mnt/extra-addons
data_dir = /var/lib/odoo
db_host=pgbouncer
db_name = odoo
@repodevs
repodevs / stock_move.py
Created October 22, 2022 22:24 — forked from ahmedelbougha/stock_move.py
Example of Odoo Multi-Threading - Background Process
from odoo import api, fields, models
from odoo.tools import float_is_zero
from odoo.exceptions import UserError, ValidationError
import threading
import time
import logging
class StockMove(models.Model):
_inherit = 'stock.move'
@repodevs
repodevs / filter
Created December 20, 2017 10:25 — forked from hofrob/filter
Odoo Logstash Filter
filter {
if [type] == "odoo" {
grok {
match => { "message" => "%{ODOOLOG}" }
}
date {
match => [ "timestamp", "yyyy-MM-dd HH:mm:ss,SSS" ]
}
}
}
@repodevs
repodevs / django_undo_migration.md
Created February 2, 2020 18:45
How to undo migration in Django

Let say you have migrations like this

project/apps/accounts/migrations
├── 0001_initial.py
├── 0002_historicalprofile_historicaluser.py
├── 0003_auto_20190807_1559.py
├── 0004_auto_20190811_1013.py
@repodevs
repodevs / main.js
Created February 26, 2017 05:42
electron example with odoo
const electron = require('electron');
const rq = require('request-promise');
const notifier = require('node-notifier');
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
let mainWindow
app.on('window-all-closed', function() {
app.quit();
@repodevs
repodevs / my-nginx.conf
Created December 22, 2016 03:02
nginx error page with custom css
## lets say we have erro page err.html in we css folder,
## we want nginx can serve the css... blah talk is cheap, lets see the conf \ :v /
error_page 500 502 503 504 = @errorz;
location @errorz {
root /var/www/html/e;
try_files $uri /index.html = 500 502 503 504;
}
@repodevs
repodevs / pgsql_backup.sh
Created May 18, 2019 19:50 — forked from sirbrillig/pgsql_backup.sh
Postgresql daily backup script.
#!/bin/bash
#
# Backup a Postgresql database into a daily file.
#
BACKUP_DIR=/pg_backup
DAYS_TO_KEEP=14
FILE_SUFFIX=_pg_backup.sql
DATABASE=
USER=postgres
@repodevs
repodevs / wsl-debian-error.md
Created May 18, 2021 08:02
WSL 2 docker debian error when apt-get update

When Docker Desktop installed on Windows and WSL 2 activated and then the compute hibernate. the date inside the docker will not up to date with the host. this issue will cause error in debian container (for exampe: doing apt update)

to solve the error, update the clock with

wsl -d docker-desktop hwclock -s in CMD.

ref: microsoft/WSL#4114 (comment)