Skip to content

Instantly share code, notes, and snippets.

View repodevs's full-sized avatar

Edi Santoso repodevs

View GitHub Profile
@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 / 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)

@repodevs
repodevs / gist:82566dafaf515d32a1832812ac2bd773
Created January 27, 2021 15:20
Linux command to watch bandwidth usage using ifstat
$ ifstat -ntS -i eth0
@repodevs
repodevs / latest-opera-instant-search.txt
Created January 9, 2021 08:32
Latest Opera browser that has Instant Search feature
Download Latest Opera Browser that has Instant Search feature at http://get.opera.com/ftp/pub/opera/desktop/67.0.3575.97/
@repodevs
repodevs / docker-in-docker.md
Last active January 1, 2021 06:47
Run Docker inside Docker Ubuntu Images

Run Docker inside Docker Ubuntu Images

The story begin when I want to install docker inside mltooling/ml-workspace-minimal images, which is based on ubuntu 18. so here how to run docker inside docker ubuntu images

docker run -d --name mltool \ 
  -p 8080:8080 \ 
  -v /root:/workspace \ 
 -v /var/run/docker.sock:/var/run/docker.sock \ 
@repodevs
repodevs / .env
Created December 5, 2020 16:59
python-decouple casting octal number 0o in python3
# by default this is will be converted to string
# if you want cast to octal number you need custom cast function
FILE_UPLOAD_PERMISSIONS=0o644
@repodevs
repodevs / find_and_fix_permission.sh
Created December 5, 2020 16:16
Linux command to find and fix permission file
#!/bin/bash
find -type f -not -perm 644 -exec chmod 644 {} \;
@repodevs
repodevs / prune-node_modules.sh
Created May 27, 2020 05:34
Remove unnecessary files from node_modules
# Install `node-prune` from https://github.com/tj/node-prune
curl -sf https://gobinaries.com/tj/node-prune | sh
# Find all `node_modules` directory
# and prune it.
find . -name "node_modules" -type d -exec node-prune {} \;
@repodevs
repodevs / sequelize-mapToModel-example.js
Created April 27, 2020 05:11
sequelize mapToModel example
/**
* @param {UUID} sourceId An ID to find.
*
* @returns {Object} an single object instance of Sequelize Model.
*/
async function getMyTableData(sourceId) {
const sequelize = await this.hub.api('DbConnector', 'Sequelize');
const mytable = await sequelize
.query(`SELECT *
FROM "my_table_name"