Skip to content

Instantly share code, notes, and snippets.

@sh41
sh41 / 01 Create a debug version of the docker image.sh
Last active April 16, 2024 10:08
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:
@ConnorAtherton
ConnorAtherton / past_papers_scheme.scm
Last active August 29, 2015 14:01
Example answers to past paper questions on key lists
;Any arbitrary list s can be transformed into a key-list by transforming each item in s
;into a key-element (choosing appropriate keys in the process).
;Write a function (make-key-list s) that returns a key-list based on its list argument s.
;2009 Paper
(define (m-k-l s)
(define (m-k-l-tr s id)
(if (null? s) '()
(cons(cons id (list (car s)))(m-k-l-tr (cdr s) (add1 id)))))
(m-k-l-tr s 1))