Skip to content

Instantly share code, notes, and snippets.

@akhdaniel
akhdaniel / PG Bouncer + Odoo Installation Steps.md
Last active November 25, 2024 10:24
PG Bouncer + Odoo Installation Steps

sudo apt install pgbouncer

Edit the pgbouncer configuration file /etc/pgbouncer/pgbouncer.ini

  * = host=localhost port=5432
  Set the listen_port = 5432 and listen_address = * 
  Set the auth_type = md5. 

Run below query in psql

@akhdaniel
akhdaniel / Get Error Message of subprocess.call()
Created December 30, 2020 20:46
Get Error Message of subprocess.call()
import subprocess
import sys
# create two files to hold the output and errors, respectively
with open('out.txt','w+') as fout:
with open('err.txt','w+') as ferr:
out=subprocess.call(["ls",'-lha'],stdout=fout,stderr=ferr)
# reset file to read from it
fout.seek(0)
# save output (if any) in variable
@akhdaniel
akhdaniel / How To Open A Port In CentOS 7 With Firewalld.md
Last active October 6, 2020 03:08
How To Open A Port In CentOS 7 With Firewalld

Open Specific Port

firewall-cmd --permanent --add-port=100/tcp
firewall-cmd --reload
firewall-cmd --list-ports
firewall-cmd --permanent --add-port=200-300/tcp
@akhdaniel
akhdaniel / Odoo blank tiba2, assets hilang, odoo.define is not a function
Created August 15, 2020 07:18
Odoo blank tiba2, assets hilang, odoo.define is not a function ?
masuk ke database, execute this:
DELETE FROM ir_attachment WHERE url LIKE '/web/content/%';
restart Odoo
@akhdaniel
akhdaniel / Installing Gammu on Raspberry Pi, Huawei E220
Last active August 16, 2020 01:04 — forked from damonsk/gist:3955099
Installing Gammu on Raspberry Pi, Huawei E220
# Send SMS messages using Raspberry Pi.
# Using gammu and Huawei E220
# Prepare SD card with wheezy.
# Login / complete rasp-config / reboot / login
# Set vimrc to prevent annoying ADBC arrow keys
cp /etc/vim/vimrc ~/.vimrc
@akhdaniel
akhdaniel / Install chromedriver on MacOS.md
Created May 6, 2020 09:23
Install chromedriver on MacOS
brew install chromedriver
spctl --add --label 'Approved' /usr/local/bin/chromedriver
xattr -d com.apple.quarantine /usr/local/bin/chromedriver
@akhdaniel
akhdaniel / 00_etc-hosts.md
Created May 2, 2020 23:45 — forked from mul14/00_etc-hosts.md
/etc/hosts for Vimeo, Reddit, and Imgur.

Unblock Vimeo, Reddit, Imgur, dan Netflix

Saya support Internet Positif untuk memblokir porn, situs judi, dan hal-hal ilegal lainnya. Tapi pemerintah dan ISP sangat konyol karena tidak mengizinkan akses ke Vimeo, Reddit, Imgur, Netflix--yang mana bukanlah situs dengan konten utama ilegal.

Linux / BSD / macOS

Tambahkan list di bawah ke /etc/hosts.

Windows

Step 1 - Add the Odoo repository

yum install -y epel-release
yum-config-manager --add-repo=https://nightly.odoo.com/10.0/nightly/rpm/odoo.repo
yum update && yum install odoo

enable odoo services

update ir_property
set value_text='standard'
where name = 'property_cost_method'
and res_id='product.category,117'
enter DB via psql:
DELETE FROM ir_attachment WHERE res_model='ir.ui.view'
restart Odoo