Skip to content

Instantly share code, notes, and snippets.

View cavearr's full-sized avatar

Carlos Venegas Arrabé cavearr

View GitHub Profile
@cavearr
cavearr / README
Created June 14, 2022 19:49 — forked from diemuzi/README
Nginx + PHP-FPM Configuration
This a Nginx + PHP-FPM Configuration
It contains all the configurations needed to build Nginx + PHP-FPM from source and to configure the services.
Current setup on Nginx 1.7.9 and PHP 5.6.4
If any files are missing, please request them by contacting me at diemuzi@gmail.com
@cavearr
cavearr / 00_README.md
Created March 22, 2022 18:05 — forked from LeZuse/00_README.md
Install node on Apple Silicon M1 both ARM and x86 (Rosetta)

Node.js on Apple Silicon

Node Version Manager (https://github.com/nvm-sh/nvm) works perfectly across native node installations as well as emulated Rosetta installations. The trick I am using here is to install one LTS version of node under Rosetta and another stable version as native binary.

TODO

  • find a way how to run the same node version on both platforms
@cavearr
cavearr / zimbra-backup-emails.sh
Created January 28, 2022 23:44 — forked from filippo/zimbra-backup-emails.sh
How to backup and restore emails of a specific account on zimbra
# The command below creates a tgz file with all emails for user@domain.com in .eml format:
# execute as root
/opt/zimbra/bin/zmmailbox -z -m user@domain.com getRestURL "//?fmt=tgz" > /tmp/account.tgz
# You can do the same via a REST URL:
wget http://ZIMBRA.SERVER/home/user@domain.com/?fmt=tgz
# to restore email:
/opt/zimbra/bin/zmmailbox -z -m user@domain.com postRestURL "//?fmt=tgz&resolve=reset" /tmp/account.tgz
@cavearr
cavearr / get_report.sh
Created January 28, 2022 23:44 — forked from LuisCardenasSolis/get_report.sh
Reporte de mensajes enviados y recibidos - Zimbra
#!/bin/bash
if [ -z $1 ]; then
echo "ERROR: Proporcionar el usuario para le reporte"
exit 1
fi
sender(){
echo "Sender :"
/opt/zimbra/libexec/zmmsgtrace -s "^${1}$" /opt/backup/logs/zimbra.log-202* > /tmp/${1} 2> /dev/null
@cavearr
cavearr / backup-mailbox.sh
Created January 28, 2022 23:43 — forked from aryulianto/backup-mailbox.sh
script for backup-mailbox zimbra
##!/bin/bash
## Format Backup:
FORMAT=tgz
## Lokasi Backup
ZBACKUP=/srv/backup/
## Nama Folder Backup Berdasarkan Tanggal Backup
DATE=`date +"%d%m%y"`
@cavearr
cavearr / notes.md
Created January 28, 2022 23:41 — forked from gordyt/notes.md
Configure ZCS to run with external MariaDB

Configure ZCS to run with external MariaDB

Introduction

For this test I decided to start with a clean MariaDB install and initialize it with a backup from a current ZCS server. In the steps that follow:

  • ubuntu-test-1 will be the service that has a full ZCS install.
  • ubuntu-test-2 will be the database server.

ubuntu-test-1

https://silentadmin.gsans.com/everything-else/moving-zimbra-8-6-to-zimbra-8-7-1-on-a-new-server/
Moving Zimbra 8.6 to Zimbra 8.7.1 on a new server
Disclaimer: I have the NETWORK/PRO version but chose not to use the backups. This method should work with both the free and paid version as a result. I have used a variation of this for every update since version version 7. We perform offsite backups and use tar to handle the sparse 80GB ldap file. This can run hot without the need to stop zimbra for most cases. The plan is to run this often and just before final cut-over do your shutdown as an extra precaution. You should be able to minimize your disruption to the production server. If you are just testing out the update process, you may never have to shutdown the production. I don’t and haven’t had any ldap issues testing while learning what it going to take to upgrade zimbra on my testing machines. You can test the new server with these hot images and even perform an upgrade test with this method. As the bac
@cavearr
cavearr / gist:2c14edb59fbdd7e1751417158a44dc07
Last active August 25, 2021 21:51
Install WSL2 Window 10

Install WSL + WSL2

1.- Open Powershell as administrator. 2.- Execute:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

3.- Check Hiper-V compatibility, for it, launch msinfo32 and check compatibility.

4.- Install wsl2 and restart:

@cavearr
cavearr / cachebust.conf
Created April 28, 2021 13:53 — forked from johndwells/cachebust.conf
NGINX - Cachebust static JS and CSS assets that contain a version segment
# Cachebust static JS and CSS assets that contain a version segment, e.g.
# /css/app.purged.min.v0.1.45.css ==> /css/app.purged.min.css
location ~* (.+)\.v(?:[\d\.]+)\.(js|css)$ {
try_files $uri $1.$2;
}
@cavearr
cavearr / jsmainloop.js
Created March 20, 2020 09:27
Javascript main loop y setTimeout
//-- A día de hoy, los motores javascript de los navegadores, sólo tienen un thread, lo que significa que no pueden
//-- ejecutar funciones en paralelo.
//-- Cuando utilizamos setTimeout, conceptualmente pensamos que habrá algún tipo de interrupción que temporizará
//-- el ciclo del programa para ejecutar esa taréa cuando toque.
//-- Pero esto no es así, el "main loop" de javascript, encolará las funciones y las ejecutará una detrás de otra,
//-- priorizando el "orden de las temporizaciones" pero sin respetarlas.
//--
//-- Como ejemplo mostramos el siguiente caso, se lanza una función temporizada para ejecutarse a los 100ms, pero como
//-- la siguiente función a ejecutarse , le toma 400ms, la primera no se ejecutará hasta que termine esta última.