Skip to content

Instantly share code, notes, and snippets.

View macagua's full-sized avatar
🏠
Working from home

Leonardo J. Caballero G. macagua

🏠
Working from home
View GitHub Profile
@macagua
macagua / hello.php
Created June 23, 2019 14:43
Hello world PHP CLI example
<?php
if($argc != 2) {
echo "Use: php hello.php [name].\n";
exit(1);
}
$name = $argv[1];
echo "Hello, $name\n";
@macagua
macagua / my_db-ddl.sql
Created June 23, 2019 21:48
DDL (Data Definition Language) syntax example for a MySQL Database
-- 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 / README.rst
Last active September 1, 2019 00:03
Returning CSV format from django-rest-framework
@macagua
macagua / Python_Cache_Packages_Conda.txt
Last active March 30, 2022 22:18
[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
mkdir -p ~/.conda/pkgs && printf 'pkgs_dirs:\n - ~/.conda/pkgs\n' >> ~/.condarc

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 / debug-zodb-bloat.rst
Created January 9, 2021 06:33 — forked from lrowe/debug-zodb-bloat.rst
Debugging ZODB bloat [2005]

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

@macagua
macagua / odoo_calculate_workers.sh
Last active July 21, 2021 13:06
Analyzes the characteristics of the server and helps calculate the number of workers and memory for each
#!/bin/bash
# CONST 1GB
CONST_1GB="1024*1024*1024"
# VARIABLE WORKERS
CMD_W=0
@macagua
macagua / odoo.conf
Created July 23, 2021 22:00 — forked from n37r06u3/odoo.conf
Sample Odoo/Nginx Config (with dbfilter_from_header support)
# 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 / Makefile
Created September 1, 2021 14:46 — forked from rsperl/Makefile #snippet
self-documenting makefile with colors
SHELL=/bin/bash
# to see all colors, run
# bash -c 'for c in {0..255}; do tput setaf $c; tput setaf $c | cat -v; echo =$c; done'
# the first 15 entries are the 8-bit colors
# define standard colors
ifneq (,$(findstring xterm,${TERM}))
BLACK := $(shell tput -Txterm setaf 0)
RED := $(shell tput -Txterm setaf 1)
@macagua
macagua / letsencrypt_2020.md
Created September 21, 2021 04:18 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files: