Skip to content

Instantly share code, notes, and snippets.

View mauriciogofas's full-sized avatar

Mauricio Gofas mauriciogofas

View GitHub Profile
@mauriciogofas
mauriciogofas / mysql_debian_user.md
Created October 24, 2023 19:50 — forked from jaircuevajunior/mysql_debian_user.md
Fix logrotate error regarding mysql on Ubuntu

Fix logrotate error regarding mysql on Ubuntu

Sometimes if you are mailed of cronjobs, will may got an error like this:

/etc/cron.daily/logrotate:
error: error running shared postrotate script for '/var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/mysql/error.log '
run-parts: /etc/cron.daily/logrotate exited with return code 1

Well, don't panic! Also don't ignore it! :)

@mauriciogofas
mauriciogofas / wp-mu-cron.sh
Created August 25, 2023 19:16 — forked from faishal/wp-mu-cron.sh
Wordpress Multisite Crontab using WP-CLI
WP_PATH="/var/www/site_path"
for SITE_URL in = $(wp site list --fields=domain,path,archived,deleted --format=csv --path="$WP_PATH" | grep ",0,0$" | awk -F ',' '{print $1 $2}')
do
echo $SITE_URL
for EVENT_HOOK in $(wp cron event list --format=csv --fields=hook,next_run_relative --url="$SITE_URL" --path="$WP_PATH" | grep 'now$' | awk -F ',' '{print $1}')
do
echo $EVENT_HOOK
wp cron event run "$EVENT_HOOK" --url="$SITE_URL" --path="$WP_PATH" > /dev/null 2>&1
done
done
@mauriciogofas
mauriciogofas / perfex_hooks_list
Created January 22, 2022 14:17 — forked from skorpions2000/perfex_hooks_list
Full Perfex Hook List - For Perfex CRM Developers
File ---> application\controllers\admin\Authentication.php:
23: hooks()->do_action('admin_auth_init');
80: hooks()->do_action('after_staff_login');
107: hooks()->do_action('after_staff_login');
117: hooks()->do_action('after_staff_login');
219: hooks()->do_action('after_user_logout');
File ---> application\controllers\admin\Auto_update.php:
14: hooks()->do_action('before_perform_update', $latest_version);
@mauriciogofas
mauriciogofas / easyengine-php7.3.md
Last active January 13, 2021 00:03 — forked from bobwol/easyengine-php7.3.md
Upgrade PHP to v7.3 in Ubuntu with Easy Engine #php #ubuntu #nginx #easyengine

How to install php7.3-fpm with EasyEngine (Ubuntu)


Add php7.3 repository

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

Install php7.3-fpm

@mauriciogofas
mauriciogofas / install-pecl-yaml.sh
Created October 9, 2019 19:54 — forked from jbelien/install-pecl-yaml.sh
PHP: Install PECL extension
sudo apt-get install php-pear php7.2-dev libyaml-dev
sudo pecl install yaml
# If /etc/php/7.2/mods-available/yaml.ini doesn't exist :
sudo cp /etc/php/7.2/mods-available/xml.ini /etc/php/7.2/mods-available/yaml.ini
sudo sed -i -- 's/xml/yaml/g' /etc/php/7.2/mods-available/yaml.ini
sudo phpenmod yaml
sudo service php7.2-fpm restart
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@mauriciogofas
mauriciogofas / gist:5145d37a344b8b9a76b9fa1803e18c1a
Created March 7, 2018 19:38 — forked from casivaagustin-zz/gist:9261586
nginx location rule to redirect non existing images to another server
#Rewrites the request, extracting a fragment of the file name and using a remote server.
location @fetchFromRemote {
rewrite ^/path/to/images/(.*)$ http://remoteserver.com/other/path/to/images/$1 redirect;
}
#Will try to see if we have the file in this server, is not will use fetchFromRemote
location ~ ^/path/to/images/.*(png|jpg|jpeg|gif|ico|swf)$ {
try_files $uri @fetchFromRemote;
}
@mauriciogofas
mauriciogofas / child.js
Created December 15, 2017 08:39 — forked from mohandere/child.js
Iframe height issue - make iframe height dynamic based on content inside
(function(){
'use-strict';
/**
* Iframe to Parent window communication
* sample iframe- <iframe id="guestFrame" name="guestFrame" src="http://other-domain.com/">
* </iframe>
* Uses https://ternarylabs.github.io/porthole/
* Uses https://marcj.github.io/css-element-queries/
@mauriciogofas
mauriciogofas / magento-nginx.conf
Created October 15, 2016 05:03 — forked from gwillem/magento-nginx.conf
Battle-tested Nginx configuration for Magento (source: www.hypernode.com)
# This is an annotated subset of the Nginx configuration from our Magento production platform @ www.hypernode.com
# See https://www.byte.nl/blog/magento-cacheleak-issue
# !!!! If you are a Hypernode customer, do not use this config as it will result in duplicate statements. !!!!!
user app;
worker_processes 4;
pid /var/run/nginx.pid;
events {
@mauriciogofas
mauriciogofas / woo-nginx.conf
Last active February 12, 2016 16:01 — forked from rahul286/moved.md
woo-commerce fastcgi-cache session-conflict solution (attempt)
# WPSINGLE BASIC NGINX CONFIGURATION
server {
server_name woo.rtcamp.net www.woo.rtcamp.net;
access_log /var/log/nginx/woo.rtcamp.net.access.log rt_cache;
error_log /var/log/nginx/woo.rtcamp.net.error.log debug;
root /var/www/woo.rtcamp.net/htdocs;
index index.php index.htm index.html;