Showing posts with label Linux.Developer. Show all posts
Showing posts with label Linux.Developer. Show all posts

Thursday, January 02, 2025

Odoo 17 - Custom adds

 

 

[1] Diario/Seq https://apps.odoo.com/apps/modules/17.0/sequence_for_journal

 

Saturday, December 14, 2024

Wednesday, December 11, 2024

pgadmin4 issues on ubuntu 18

Ubuntu 18.04.5 LTS (Bionic Beaver)
 


pgadmin4-desktop pgadmin4-server pgadmin4-web

 

ImportError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /usr/pgadmin4/venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/_rust.abi3.so)

 

 fincahuanaco   ldd --version
ldd (Ubuntu GLIBC 2.27-3ubuntu1.4) 2.27
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.


fincahuanaco   sudo /usr/pgadmin4/bin/setup-web.sh

ImportError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by  
/usr/pgadmin4/venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/_rust.abi3.so)
Error setting up server mode. Please examine the output above.


Docker Alternative

 fincahuanaco   docker pull dpage/pgadmin4

 

sudo docker run -p 5050:5050 -e 'PGADMIN_DEFAULT_EMAIL=email@gmail.com' -e 'PGADMIN_DEFAULT_PASSWORD=password' -e 'PGADMIN_LISTEN_PORT=5050' -d dpage/pgadmin4

 

sudo docker ps

CONTAINER ID   IMAGE            COMMAND            CREATED          STATUS          PORTS     NAMES
2b0f1c329504   dpage/pgadmin4   "/entrypoint.sh"   25 minutes ago   Up 25 minutes             awesome_darwin

sudo docker stop 2b0f1c329504



sudo docker inspect 2b0f1c329504 | grep IPAddress  #discovery ip

 

#force use local network

sudo docker run -p 5050:5050 --network host -e 'PGADMIN_DEFAULT_EMAIL=email@gmail.com' -e 'PGADMIN_DEFAULT_PASSWORD=password' -e 'PGADMIN_LISTEN_PORT=5050' -d dpage/pgadmin4

 

Resume docker containers

$ sudo docker start  $(sudo docker ps -q -l)

 


Docker References:

 

[1] https://hub.docker.com/r/dpage/pgadmin4/

[2] Deploy https://www.pgadmin.org/docs/pgadmin4/latest/container_deployment.html

[3] https://stackoverflow.com/questions/53610385/docker-postgres-and-pgadmin-4-connection-refused

[4] Resume docker container https://stackoverflow.com/questions/21928691/how-to-continue-a-docker-container-which-has-exited

 


 


 

Friday, November 22, 2024

Ubuntu Forware port 80

 

#!/bin/bash
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8069
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8070
iptables-save

 

Permanent in system by:

$sudo vi /etc/rc.local



References:

https://www.odoo.com/forum/help-1/change-to-port-80-instead-of-8069-23031

 

Wednesday, November 13, 2024

PostgreSQL json fields

select name->'es_PE',* from product_template where name->>'es_PE' like '%MEGACI%'

 

References:

[1] https://popsql.com/learn-sql/postgresql/how-to-query-a-json-column-in-postgresql

Ubuntu VGA Resolutions

 

References:

[1] https://pendrivelinux.com/vga-boot-modes-to-set-screen-resolution/

 

Ubuntu add user easily

 

 

$sudo adduser pharmaquipa
$sudo usermod -aG sudo pharmaquipa #add to sudo group

References

[1] https://www.digitalocean.com/community/tutorials/how-to-create-a-new-sudo-enabled-user-on-ubuntu

[2] https://phoenixnap.com/kb/how-to-create-sudo-user-on-ubuntu

Wednesday, October 30, 2024

Facturador Sunat SEE SFS (Linux)

 

 

/usr/lib/jvm/java-8-openjdk-amd64/bin/java -jar ./facturadorApp-2.1.jar server prod.yaml

References:

[1] Make temp certificate for test https://llama.pe/facturador-sunat-see-sfs-certificado-digital
 

Friday, October 25, 2024

Audacious Skins

 Winamp skins for Linux

https://lunduke.substack.com/p/miss-winamp-try-audacious-the-winamp

Tuesday, October 22, 2024

Notes run odoo 16 venv

Using previous virtual environment (~python 3.10)

pip install --upgrade pip
 
pip install lxml==5.1.0
pip3 install Werkzeug==2.0.2
pip install pyOpenSSL
pip3 install docutils
 
pip3 install num2words
 

 Trying on python3.8 by empy virtual environment


python3.8 -m pip install virtualenv

python3.8 -m virtualenv test  

source test/bin/activate     
 

sudo apt install python3.8-dev 

 

pip install -r requirements.txt
 

python3 odoo-bin --http-port=1616 -d enter02


 

Update pgadmin

remove credential:

ls /var/lib/pgadmin/storage
 

pgadmin4 Online

[1] https://www.pgadmin.org/download/pgadmin-4-python

 

Enable remote access to pgadmin4

$vi pgadmin4/lib/python3.10/site-packages/pgadmin4/config.py
 

[1] https://www.digitalocean.com/community/tutorials/how-to-install-configure-pgadmin4-server-mode

 

References:

https://gcore.com/learning/how-to-install-pgadmin4-on-ubuntu/

Friday, September 20, 2024

PostgreSQL command tools

 

Database size

select pg_size_pretty( pg_database_size('dbname') );


Tables order by size

select
  table_name,
  pg_size_pretty(pg_total_relation_size(quote_ident(table_name))),
  pg_total_relation_size(quote_ident(table_name))
from information_schema.tables
where table_schema = 'public'
order by 3 desc;



References:

https://stackoverflow.com/questions/21738408/postgresql-list-and-order-tables-by-size

 


Thursday, September 19, 2024

Video edition issues

 Merge Video and Audio

ffmpeg -i video.mp4 -i audio.mp3 -c:v copy -c:a aac output.mp4

Monday, August 12, 2024

Friday, August 02, 2024

Odoo 17 Lessons

 

Custom Entity

https://odooforbeginnersblog.wordpress.com/2017/03/05/how-to-create-wizards-in-odoo/

Menus

https://www.cybrosys.com/blog/how-to-define-menus-actions-in-odoo-17

Reports

https://apps.odoo.com/apps/modules/16.0/report_xlsx


Tools

https://github.com/OCA/server-brand (disable to external apps)



Friday, July 26, 2024

OSE/PSE Resources

Crawler site

wget -m -p -k -np -R '*html*,*htm*,*asp*,*php*,*css*' -X 'www' https://khalifagroup.ma/odoo-server/ --no-check-certificate

Best alternative

lftp -c 'mirror --parallel=100 https://example.com/files/ ;exit'
$vi ~/.lftprc
set ssl:verify-certificate false
 
Alternative host https://57.129.7.94:444/enterprise/  
 
 

References
[1] https://www.m00nie.com/specifically-disable-cert-verification-lftp

https://khalifagroup.ma/odoo-server/enterprise

Thursday, July 04, 2024

Ubuntu18 Upgrade Postgres10 to Postgres12

 

sudo apt-get install curl ca-certificates gnupg
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
sudo apt-get update
 
 
#pgdg.list #update
deb https://apt-archive.postgresql.org/pub/repos/apt bionic-pgdg main 

 

$ sudo apt update
$ sudo apt install postgresql-12

 

Error that force us to update

psycopg2.errors.UndefinedFunction: function jsonb_path_query_array(jsonb, unknown) does not exist
LINE 1: ...ate_name_index" ON "product_template" USING gin ((jsonb_path...

 
 

Wednesday, June 26, 2024

Odoo 17 migrations issues

Tips

wkhtmltopdf in ubuntu 18 - Qt problem

The latest package taken from the download page (0.12.6.1-2 at the moment), works on Ubuntu 22.04, it has the QT patch inside

Tools

[1] https://github.com/pierrelocus/odoo-attrs-replace

Thursday, June 13, 2024

ERP and CRM

 

102  sudo apt install python3-setuptools
103  sudo apt-get install python3-venv
105  sudo apt-get install python3-virtualenv
106  sudo apt-get install python3.10-venv

112  python3 -m venv odoovenv

118  sudo apt update && sudo apt upgrade -y
119  sudo apt install software-properties-common -y
120  sudo add-apt-repository ppa:deadsnakes/ppa
121  sudo apt update
122  sudo apt install python3.10
123  python3
125  sudo unlink python3
126  python3
131  sudo unlink /usr/bin/python3
132  sudo ln -s /usr/bin/python3.10 /usr/bin/python3

134  cd Software/
135  ls
136  source odoovenv/
137  source odoovenv/bin/activate
138  cd odoo-17.0/
139  ls
141  pip install --upgrade pip
142  pip install -r requirements.txt

150  sudo apt install postgresql
154  sudo apt install python3-dev
155  sudo apt install python3.10-dev
156  sudo apt-get install libsasl2-dev python-dev-is-python3 libldap2-dev libssl-dev
157  sudo apt-get install libldap2-dev
158  sudo apt install python3-ldap
159  sudo apt-get install libpq-dev

Note:

Modules/LDAPObject.c:16:10: fatal error: sasl/sasl.h: No such file or directory

when python3.10 installed from source, and python3.10-dev isn't available

apt-get install python-dev libsasl2-dev
 

Note in Ardaldinho server by python3.10.15

ModuleNotFoundError: No module named 'OpenSSL'

$ pip install pyOpenSSL

ModuleNotFoundError: No module named '_cffi_backend'

$ sudo apt remove python3-cffi
$ pip install cffi  #inner venv

ModuleNotFoundError: No module named 'cryptography.hazmat.backends.openssl.x509'
 

$ pip install pyopenssl==21.0.0 #inner venv

AttributeError: module 'lib' has no attribute 'X509_V_FLAG_NOTIFY_POLICY'. Did you mean: 'X509_V_FLAG_EXPLICIT_POLICY'?

 
$ pip install cryptography==3.4.8
#inner venv

 

Resources:

[1] https://github.com/odoo/odoo

[2] fe_sendauth https://stackoverflow.com/questions/17996957/fe-sendauth-no-password-supplied

[3] https://store.webkul.com/odoo-pos-pharmacy-management.html

[4] https://apps.odoo.com/apps/modules/14.0/bi_pos_pharmacy_management

 


Tuesday, June 11, 2024

Postgres 10/12 into Linux 18

 

sudo systemctl status postgresql.service

sudo systemctl start postgresql.service

sudo systemctl restart postgresql.service


sudo -i -u postgres psql
 

SELECT version();
 
pg_config --version
psql --version
 
CREATE ROLE mysuperuser2 WITH SUPERUSER CREATEDB CREATEROLE LOGIN ENCRYPTED PASSWORD 'mysuperpass2'  
 
$ sudo vi /etc/postgresql/12/main/pg_hba.conf
 
local   all             postgres                                trust #peer
# TYPE  DATABASE        USER            ADDRESS                 METHOD
# "local" is for Unix domain socket connections only
local   all             all                                     md5 #peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication     all                                     peer
host    replication     all             127.0.0.1/32            md5
host    replication     all             ::1/128                 md5
Enable remote access
$ sudo vi /etc/postgresql/12/main/pg_hba.conf
host    all             all             127.0.0.1/32            md5 
host    all             all             192.168.0.1/24            md5 
$ sudo vi /etc/postgresql/12/main/postgresql.conf
listen_address='*' # host1, host2, ..., localhost  
  

Odoo 17 - Custom adds

    [1] Diario/Seq https://apps.odoo.com/apps/modules/17.0/sequence_for_journal