Skip to content

Instantly share code, notes, and snippets.

@sprightly
sprightly / 01 Create a debug version of the docker image.sh
Created February 14, 2020 14:11 — forked from sh41/01 Create a debug version of the docker image.sh
Debugging segmentation faults in PHP in a docker container.
git clone git@github.com:docker-library/php.git docker-library-php
## Go to the specific version you're interested in
cd docker-library-php/7.1/fpm/alpine
## Edit the .Dockerfile.
## Change
## ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data
## to
## ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --enable-debug
## Comment out or delete:
@sprightly
sprightly / console.sql
Last active April 4, 2017 10:32
OroCRM generate carts for magento bundle at mysql
DELIMITER //
DROP PROCEDURE IF EXISTS `generateMagentoCarts`;
CREATE PROCEDURE `generateMagentoCarts` (IN startId INT, amount INT)
BEGIN
DECLARE cartId, orderId, workflowItemId, secondWorkflowItemId INT;
WHILE startId < amount DO
INSERT INTO orocrm_magento_cart (ac_last_contact_date, ac_last_contact_date_in, ac_last_contact_date_out, ac_contact_count, ac_contact_count_in, ac_contact_count_out, serialized_data, items_qty, items_count, base_currency_code, store_currency_code, quote_currency_code, store_to_base_rate, store_to_quote_rate, email, gift_message, is_guest, payment_details, notes, status_message, imported_at, synced_at, sub_total, grand_total, tax_amount, createdAt, updatedAt, origin_id, first_name, last_name, customer_id, store_id, shipping_address_id, billing_address_id, status_name, opportunity_id, user_owner_id, organization_id, channel_id, data_channel_id) VALUES (NULL, NULL, NULL, NULL, NULL, NULL, 'Tjs=', '2', 2, 'USD', 'USD', 'USD', '1', '1', 'FrankJClarke@gustr.com', NULL, 0
@sprightly
sprightly / console.sql
Last active April 4, 2017 09:10 — forked from x86demon/Campaign + Leads + Opportunities.sql
OroCRM generate carts for magento bundle at postgres
CREATE OR REPLACE FUNCTION generateMagentoCarts(startId INT, amount INT)
RETURNS INT AS $$
DECLARE
cartId INTEGER;
orderId INTEGER;
workflowItemId INTEGER;
secondWorkflowItemId INTEGER;
BEGIN
FOR i IN startId .. amount
LOOP
@sprightly
sprightly / phpbrew-fpm
Last active December 27, 2017 07:28 — forked from kivlara/php5-fpm
PHP-FPM as service with PHPBrew installed under vagrant user
#!/bin/sh
### BEGIN INIT INFO
# Provides: php-fpm php5-fpm
# Required-Start: $remote_fs $network
# Required-Stop: $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts php5-fpm
# Description: Starts PHP5 FastCGI Process Manager Daemon
### END INIT INFO