Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Leonardo J. Caballero G. macagua

🏠
Working from home
View GitHub Profile
@macagua
macagua / odoo.conf
Created Jul 23, 2021 — forked from n37r06u3/odoo.conf
Sample Odoo/Nginx Config (with dbfilter_from_header support)
View odoo.conf
# Author: Ryan Cole
# Website: https://ryanc.me
# GitHub: https://github.com/MGinshe
# Usage:
# Place this file in /etc/nginx/sites-enabled/
# Make sure you edit the DOMAIN_HERE and SSL_CERTIFICATE, and DB_FILTER sections
#
# Note: This config file is designed to be used with the Odoo dbfilter_from_header module
# https://apps.openerp.com/apps/modules/9.0/dbfilter_from_header/
@macagua
macagua / odoo_calculate_workers.sh
Last active Jul 21, 2021 — forked from sauljabin/odoo_calculate_workers.sh
Analyzes the characteristics of the server and helps calculate the number of workers and memory for each
View odoo_calculate_workers.sh
#!/bin/bash
# CONST 1GB
CONST_1GB="1024*1024*1024"
# VARIABLE WORKERS
CMD_W=0
@macagua
macagua / debug-zodb-bloat.rst
Created Jan 9, 2021 — forked from lrowe/debug-zodb-bloat.rst
Debugging ZODB bloat [2005]
View debug-zodb-bloat.rst

Warning

This was written in 2005 so may be out of date. Originally published on the old Plone documentation section: https://plone.org/documentation/kb-old/debug-zodb-bloat/

About

Having spent a lot of time tracking down the cause of ZODB bloat in an Archetypes application I thought I'd share my experience in case it was useful to anyone else.

Step 1: Analysis

View keybase.md

Keybase proof

I hereby claim:

  • I am macagua on github.
  • I am macagua (https://keybase.io/macagua) on keybase.
  • I have a public key ASBbhGPTec6zi20gyoSBdEc8VUQOEg1GQQSqneIxwlq8Kgo

To claim this, I am signing this object:

@macagua
macagua / gist:d1eb20b4d0541da2650cd7000e4d2577
Created Sep 18, 2019
[TIP] When there is Internet latency and requires installing python packages by conda tool but the installation failed, then you can prevent conda from re-downloading previously downloaded packages, running this command
View gist:d1eb20b4d0541da2650cd7000e4d2577
mkdir -p ~/.conda/pkgs && printf 'pkgs_dirs:\n - ~/.conda/pkgs\n' >> ~/.condarc
@macagua
macagua / README.rst
Last active Sep 1, 2019
Returning CSV format from django-rest-framework
View README.rst
@macagua
macagua / my_db-ddl.sql
Created Jun 23, 2019
DDL (Data Definition Language) syntax example for a MySQL Database
View my_db-ddl.sql
-- ddl my_db
-- create database my_db;
-- use my_db;
create table person(
id int not null,
name varchar(50),
lastname varchar (40),
age varchar (1),
@macagua
macagua / hello.php
Created Jun 23, 2019
Hello world PHP CLI example
View hello.php
<?php
if($argc != 2) {
echo "Use: php hello.php [name].\n";
exit(1);
}
$name = $argv[1];
echo "Hello, $name\n";
@macagua
macagua / info.php
Created Jun 23, 2019
phpinfo example for show details information about PHP's configuration
View info.php
<?php phpinfo(); ?>
@macagua
macagua / README.rst
Last active Oct 4, 2018
HTTP Server request and response for GET and POST verbs demostration with Python 3
View README.rst

README

To use this:

  1. Install httpie via pip inside a virtualenv, executing the following command: pip install httpie
  2. Execute HTTP Server script on your machine, executing the following command: python3 my-httpserver.py
  3. Test a HEAD request using http script from httpie package,