Skip to content

Instantly share code, notes, and snippets.

View rafnixg's full-sized avatar
:octocat:
Working from home

Rafnix Guzman rafnixg

:octocat:
Working from home
View GitHub Profile
@101t
101t / Deployment Guide to Installing Odoo 14 on Ubuntu 20.04.md
Last active August 26, 2024 01:54
Deployment Guide to Installing Odoo 14 on Ubuntu 20.04
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active July 18, 2025 00:13
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@vijoin
vijoin / odoo_fix_bus_unavailable_exception.md
Created July 15, 2019 15:15
Odoo: How to fix Exception: bus.Bus unavailable after activating workers

Odoo: How to fix Exception: bus.Bus unavailable after activating workers

This hasn't been tested yet

Error:

File "/.../.../odoo/addons/bus/bus.py", line 188, in poll
    raise Exception("bus.Bus unavailable")
Exception: bus.Bus unavailable
@BillyPurvis
BillyPurvis / Jenkinsfile
Last active January 14, 2024 18:40
A Basic Jenkins Scripted Pipeline Github Clone Repo Stage
String branchName = env.BRANCH_NAME
String gitCredentials = "CREDENTIAL_ID"
String repoUrl = "https://github.com/username/repo-name.git"
node {
// Start Stages
stage('Clone') {
// Clones the repository from the current branch name
echo 'Make the output directory'
sh 'mkdir -p build'
@akhmadkresna
akhmadkresna / sale_checkout_inheritance.py
Last active April 28, 2021 16:29
odoo controller inheritance
from odoo.addons.website_sale.controllers.main import WebsiteSale
class WebsiteSaleInherit(WebsiteSale):
@http.route(['/shop/checkout'], type='http', auth="public", website=True)
def checkout(self, **post):
# use super to call prevously defined checkout methods so we not overriding the method but extend it.
res = super(WebsiteSale, self).checkout(**post)
# code your bugs in here ;)
@giansalex
giansalex / Boleta.xml
Last active May 24, 2025 19:21
Comprobantes Facturación Electrónica SUNAT UBL 2.1 (Factura, Boleta, NCR, NDB, ICBPER, Forma Pago), generados con Greenter https://greenter.dev/
<?xml version="1.0" encoding="UTF-8"?>
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2">
<ext:UBLExtensions>
<ext:UBLExtension>
<ext:ExtensionContent />
</ext:UBLExtension>
</ext:UBLExtensions>
<cbc:UBLVersionID>2.1</cbc:UBLVersionID>
<cbc:CustomizationID>2.0</cbc:CustomizationID>
<cbc:ID>B001-1</cbc:ID>
@ilyasProgrammer
ilyasProgrammer / date_compare.py
Last active January 29, 2023 08:07
Odoo compare datetime and date in domain. Current day, week, month, year in domain.
# in xml:
# Current day:
domain="[('some_date_time', '&gt;', (context_today()-datetime.timedelta(days=1)).strftime('%%Y-%%m-%%d')),('start_time', '&lt;', (context_today()+datetime.timedelta(days=1)).strftime('%%Y-%%m-%%d'))]
# Current week:
domain="[('some_date_time', '&gt;=', (context_today()-datetime.timedelta(days=context_today().weekday())).strftime('%%Y-%%m-%%d')),('start_time', '&lt;=', (context_today()-datetime.timedelta(days=context_today().weekday())+ datetime.timedelta(days=6)).strftime('%%Y-%%m-%%d'))]
# Current year:
domain="[('some_date_time', '&gt;=', (datetime.date(datetime.date.today().year, 1, 1)).strftime('%%Y-%%m-%%d')),('start_time', '&lt;=', (datetime.date(datetime.date.today().year, 12, 31)).strftime('%%Y-%%m-%%d'))]
#in python:
yesterday = datetime.datetime.now() - datetime.timedelta(days = 2)
@jasperf
jasperf / wget
Created June 29, 2016 01:55 — forked from bueckl/wget
Wget examples
#Spider Websites with Wget – 20 Practical Examples
Wget is extremely powerful, but like with most other command line programs, the plethora of options it supports can be intimidating to new users. Thus what we have here are a collection of wget commands that you can use to accomplish common tasks from downloading single files to mirroring entire websites. It will help if you can read through the wget manual but for the busy souls, these commands are ready to execute.
1. Download a single file from the Internet
wget http://example.com/file.iso
2. Download a file but save it locally under a different name
wget ‐‐output-document=filename.html example.com
@GabLeRoux
GabLeRoux / fix-ssl-cert-snakeoil.key-ubuntu-postgresql.sh
Created April 1, 2016 06:39
Fix postgresql error FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied
# > It happened to me and it turned out that I removed erroneously the postgres user from "ssl-cert" group, set it back with
gpasswd -a postgres ssl-cert
# Fixed ownership and mode
sudo chown root:ssl-cert /etc/ssl/private/ssl-cert-snakeoil.key
sudo chmod 740 /etc/ssl/private/ssl-cert-snakeoil.key
# now postgresql starts! (and install command doesn't fail anymore)
sudo /etc/init.d/postgresql start
@vijoin
vijoin / odoo-docker.md
Last active February 27, 2020 23:32
Guía rápida para la instalación de Docker y su respectivo contenedor para Odoo

Contenedores Docker para Odoo

##Introducción Un dolor de cabeza muy común para los desarrolladores odoo es el tener que establecer tu entorno de desarollo o tener que explicarle a un nuevo desarrollador todo lo que debe configurar para tener un entorno de pruebas. A veces sucede que queremos tener en paralelo dos versiones distintas de openerp/odoo.

Hasta ahora la solución que utilizaba era crear máquinas virtuales Virtualbox, pero eran bastante fastidiosas al tener que configurar adaptadores puente para poder acceder a los servicios dentro de la máquina virtual.

La solución ante tantas variaciones y exigentes configuraciones es un "Contenedor Docker".