Skip to content

Instantly share code, notes, and snippets.

@cedricmagne
cedricmagne / 0001-BUGIFX-Magento-Zend-Framework-1-PHP5.6.patch
Created June 12, 2016 18:43 — forked from renttek/0001-BUGIFX-Magento-Zend-Framework-1-PHP5.6.patch
Bugfix for Zend Framework 1 in Magento (>= 1.7.*.*) + PHP 5.6
From 473846959772d8160b34b92ae3bcecddf24b972f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Julian=20Nu=C3=9F?= <julian.nuss@outlook.com>
Date: Tue, 23 Sep 2014 21:07:29 +0200
Subject: [PATCH 1/1] [BUGIFX] Zend Framework 1 + PHP5.6
---
lib/Zend/Locale/Format.php | 22 +++++++++++-----------
lib/Zend/Service/Audioscrobbler.php | 6 +++---
lib/Zend/Service/Technorati.php | 6 +++---
lib/Zend/Validate/Hostname.php | 4 ++--
@cedricmagne
cedricmagne / cmd.sh
Last active April 22, 2016 13:00
Linux commands
# Truncate a file
$ cat /dev/null >| my_file.log
## OR
$ truncate -s0 yourfile
##if permission denied, use sudo
$ sudo truncate -s0 yourfile
@cedricmagne
cedricmagne / varnish.sh
Last active November 29, 2020 19:43
Command to run Varnish on mac OS X
# must run as root
sudo varnishd -f /usr/local/etc/varnish/default.vcl -s file -a 127.0.0.1:80
# help: see available arguments with descriptions
varnishd -h
# -f Specifies the location of the vcl script to launch Varnish with.
# -s Specifies storage options. The file argument stores in /tmp by default. You can specify another location with -s file,/location
# -a Specifies the address and port that Varnish will run at. You can access your website through Varnish using this address and port.
@cedricmagne
cedricmagne / m2_cli.sh
Last active February 2, 2016 09:13
Magento 2 Command Line Tool (/bin/magento). See more: https://firebearstudio.com/blog/magento-2-command-line-tool-binmagento.html
## Usage
command [options] [arguments]
## Options
--help (-h) Display this help message
--quiet (-q) Do not output any message
--verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debugging
--version (-V) Display an application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
@cedricmagne
cedricmagne / change_definer.sh
Last active December 2, 2020 23:45
Change TRIGGERS DEFINER in MySQL
##
## Create mysql triggers dump
## We add DROP TRIGGER IF EXISTS with option --add-drop-trigger
## This option is supported only by mysqldump as supplied with MySQL Cluster. It is not available when using MySQL Server 5.5.
## If you don't need password dont use -p option.
##
mysqldump -u <USERNANME> -p --routines --add-drop-trigger --no-create-info --no-data --no-create-db --skip-opt <database> > outputfile.sql
##
## Change old DEFINER with sed command
@cedricmagne
cedricmagne / util.sql
Last active May 21, 2017 21:56
MySQL command
-- Show triggers
SHOW TRIGGERS;
-- Show free lock
SELECT IS_FREE_LOCK('DATABASE_NAME.reindex_full')
-- Log all queries
-- Mysql need to have write access on mysql_general.log
SET global log_output = 'FILE';
SET global general_log_file='/var/log/mysql/mysql_general.log';