Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a
I will be using the root user, but would suggest creating a new user
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' |
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 ;) |
<?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> |
# in xml: | |
# Current day: | |
domain="[('some_date_time', '>', (context_today()-datetime.timedelta(days=1)).strftime('%%Y-%%m-%%d')),('start_time', '<', (context_today()+datetime.timedelta(days=1)).strftime('%%Y-%%m-%%d'))] | |
# Current week: | |
domain="[('some_date_time', '>=', (context_today()-datetime.timedelta(days=context_today().weekday())).strftime('%%Y-%%m-%%d')),('start_time', '<=', (context_today()-datetime.timedelta(days=context_today().weekday())+ datetime.timedelta(days=6)).strftime('%%Y-%%m-%%d'))] | |
# Current year: | |
domain="[('some_date_time', '>=', (datetime.date(datetime.date.today().year, 1, 1)).strftime('%%Y-%%m-%%d')),('start_time', '<=', (datetime.date(datetime.date.today().year, 12, 31)).strftime('%%Y-%%m-%%d'))] | |
#in python: | |
yesterday = datetime.datetime.now() - datetime.timedelta(days = 2) |
#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 |
# > 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 |
##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".