Skip to content

Instantly share code, notes, and snippets.

@simpleadm
simpleadm / phpdangerousfuncs.md
Created October 19, 2020 13:45 — forked from mccabe615/phpdangerousfuncs.md
Dangerous PHP Functions

Command Execution

exec           - Returns last line of commands output
passthru       - Passes commands output directly to the browser
system         - Passes commands output directly to the browser and returns last line
shell_exec     - Returns commands output
\`\` (backticks) - Same as shell_exec()
popen          - Opens read or write pipe to process of a command
proc_open      - Similar to popen() but greater degree of control
pcntl_exec - Executes a program
@simpleadm
simpleadm / mview.sql
Last active September 26, 2018 13:15 — forked from unicoder88/mview.sql
select s.view_id,
s.version_id,
s.status,
(SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = database() AND TABLE_NAME = concat(s.view_id, '_cl')) as increment_id,
(select count(*) from catalog_product_price_cl cl where cl.version_id > s.version_id) as pending_updates
from mview_state s where s.view_id = 'catalog_product_price'
UNION
select s.view_id, s.version_id, s.status, (SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = database() AND TABLE_NAME = concat(s.view_id, '_cl')) as increment_id, (select count(*) from catalog_product_flat_cl cl where cl.version_id > s.version_id) as pending_updates from mview_state s where s.view_id = 'catalog_product_flat'
UNION
select s.view_id, s.version_id, s.status, (SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = database() AND TABLE_NAME = concat(s.view_id, '_cl')) as increment_id, (select count(*) from cataloginventory_stock_cl cl where cl.version_id > s.version_id) as pending_upd
@simpleadm
simpleadm / my.cnf
Created December 28, 2017 11:23 — forked from yvoronoy/my.cnf
MySQL Magento Config
[mysqld]
## After edit config you have to remove log files and restart mysql server
## because after changing innodb-log-file-size you should recreate ib_logfiles
## Stop MySQL server
## rm /data/dir/ib_logfile*
## Run MySQL server
##Table open cache under MacOS and MySQL 5.6 should be 250.
##Otherwise you will get error MySQL server has gone away
##table-open-cache = 250