Skip to content

Instantly share code, notes, and snippets.

select s.view_id,
s.version_id,
(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, (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, (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_updates from mview_state s where s.
@mccabe615
mccabe615 / phpdangerousfuncs.md
Last active June 17, 2024 06:45
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
@denji
denji / nginx-tuning.md
Last active June 26, 2024 17:56
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@matthewlehner
matthewlehner / autopgsqlbackup
Created July 11, 2012 16:10
Auto PostgreSQL backup script.
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9