Skip to content

Instantly share code, notes, and snippets.

View cavearr's full-sized avatar

Carlos Venegas Arrabé cavearr

View GitHub Profile
@cavearr
cavearr / index.php
Created March 21, 2019 23:26 — forked from linktohack/index.php
Adminer 4.2.5 loader without password for SQLite
<?php
function adminer_object() {
class AdminerSoftware extends Adminer {
function login($login, $password) {
return true;
}
}
return new AdminerSoftware;
}
include "./adminer-4.2.5.php";
@cavearr
cavearr / autoptimize_defer_inline_jquery.php
Created March 29, 2019 10:02 — forked from futtta/autoptimize_defer_inline_jquery.php
POC to defer inline JS that requires jQuery
<?php
add_action('plugins_loaded','ao_defer_inline_init');
function ao_defer_inline_init() {
if ( get_option('autoptimize_js_include_inline') != 'on' ) {
add_filter('autoptimize_html_after_minify','ao_defer_inline_jquery',10,1);
}
}
function ao_defer_inline_jquery( $in ) {
@cavearr
cavearr / installed-plugin-details.php
Created April 29, 2019 17:11 — forked from bradyvercher/installed-plugin-details.php
WordPress Plugin: Show a "Details" link for installed plugins to view information from the WordPress.org plugin directory.
<?php
/**
* Plugin Name: Installed Plugin Details
* Description: Show a "Details" link for installed plugins to view information from the WordPress.org plugin directory.
* Version: 1.0.0
* Author: Blazer Six
* Author URI: http://www.blazersix.com/
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
*
@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;
}
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 / 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

@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 / 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 / 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 / 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