Example:
RUN ln -sf /usr/share/zoneinfo/Europe/Warsaw /etc/localtime
██████ ██ ▄█▀▄▄▄ ██████ ▒█████ █ █░ ▄▄▄ ██▓ ▓█████ ███▄ ▄███▓ █ █░ ██▓ ███▄ █ ▓█████▄ ▒█████ █ █░ ██████ ▄▄▄ ██▓███ ██▓
▒██ ▒ ██▄█▒▒████▄ ▒██ ▒ ▒██▒ ██▒▓█░ █ ░█░▒████▄ ▓██▒ ▓█ ▀ ▓██▒▀█▀ ██▒▓█░ █ ░█░▓██▒ ██ ▀█ █ ▒██▀ ██▌▒██▒ ██▒▓█░ █ ░█░▒██ ▒ ▒████▄ ▓██░ ██▒▓██▒
░ ▓██▄ ▓███▄░▒██ ▀█▄ ░ ▓██▄ ▒██░ ██▒▒█░ █ ░█ ▒██ ▀█▄ ▒██░ ▒███ ▓██ ▓██░▒█░ █ ░█ ▒██▒▓██ ▀█ ██▒░██ █▌▒██░ ██▒▒█░ █ ░█ ░ ▓██▄ ▒██ ▀█▄ ▓██░ ██▓▒▒██░
▒ ██▒▓██ █▄░██▄▄▄▄██ ▒ ██▒▒██ ██░░█░ █ ░█ ░██▄▄▄▄██ ▒██░ ▒▓█ ▄ ▒██ ▒██ ░█░ █ ░█ ░██░▓██▒ ▐▌██▒░▓█▄ ▌▒██ ██░░█░ █ ░█ ▒ ██▒░██▄▄▄▄██ ▒██▄█▓▒ ▒▒██░
▒██████▒▒▒██▒ █▄▓█ ▓██▒▒██████▒▒░ ████▓▒░░░██▒██▓ ▓█ ▓██▒░██████▒░▒████▒▒██▒ ░██▒░░██▒██▓ ░██░▒██░ ▓██░░▒████▓ ░ ████▓▒░░░██▒██▓ ▒██████▒▒ ▓█ ▓██▒ ██▓ ▒██▒ ░ ░░██████▒
▒ ▒▓▒ ▒ ░▒ ▒▒ ▓▒▒▒ ▓▒█░▒ ▒▓▒ ▒ ░░ ▒░▒░▒░ ░ ▓░▒ ▒ ▒▒ ▓▒█░░ ▒░▓ ░░░ ▒░ ░░ ▒░ ░ ░░ ▓░▒ ▒ ░▓ ░ ▒░ ▒ ▒ ▒▒▓ ▒ ░ ▒░▒░▒░ ░ ▓░▒ ▒ ▒ ▒▓▒ ▒ ░ ▒▒ ▓▒█░ ▒▓▒ ▒▓▒░ ░ ░░ ▒░▓ ░
░ ░▒ ░ ░░ ░▒ ▒░ ▒ ▒▒ ░░ ░▒ ░ ░ ░ ▒ ▒░ ▒ ░ ░ ▒ ▒▒ ░░ ░ ▒ ░ ░ ░ ░░ ░ ░ ▒ ░ ░ ▒ ░░ ░░ ░ ▒░ ░ ▒ ▒ ░ ▒ ▒░ ▒ ░ ░ ░ ░▒ ░ ░ ▒ ▒▒ ░ ░▒ ░▒ ░ ░ ░ ▒ ░
░ ░ ░ ░ ░░ ░ ░ ▒ ░ ░ ░ ░ ░ ░ ▒ ░ ░ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▒ ░ ░ ░ ░ ░ ░ ▒ ░ ░░ ░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
░ ░
Example:
RUN ln -sf /usr/share/zoneinfo/Europe/Warsaw /etc/localtime
<?php
if ($_POST) {
if ($_POST['hash'] == $_SESSION['hash']) {
echo 'Form sent!';
} else {
echo 'Error: form was already sent!';
}
}
$hash = md5(microtime());
$_SESSION['hash'] = $hash;
?>
<form method="post" action="">
<input type="hidden" name="hash" value="<?php echo $hash ?>">
<input type="text" name="test">
<input type="submit" value="submit">
</form>
SET @from="http://example.localhost";
SET @to="https://example.com";
UPDATE wp_options SET option_value = replace(option_value, @from, @to) WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, @from, @to);
UPDATE wp_posts SET post_content = replace(post_content, @from, @to);
UPDATE wp_postmeta SET meta_value = replace(meta_value, @from, @to);
In your xdebug.ini file:
; For Xdebug 2 (2.5.5) / Linux
zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9003
xdebug.remote_host=172.17.0.1
; For Xdebug 2 (2.5.5) / Windows
zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9003
xdebug.remote_host=172.17.0.1
; For Xdebug 3 (3.1.1) / Linux
zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20200930/xdebug.so
xdebug.mode=debug
xdebug.discover_client_host=no
xdebug.client_port=9003
xdebug.client_host=172.17.0.1
; For Xdebug 3 (3.1.1) / Windows
zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20200930/xdebug.so
xdebug.mode=debug
xdebug.discover_client_host=no
xdebug.client_port=9003
xdebug.client_host=host.docker.internal
Per project
git config core.fileMode false
Global
git config --global core.fileMode false
Warning
Changes of the global setting won’t be applied to existing repositories. Additionally, git clone and git init explicitly set core.fileMode to true in the repo config as discussed in Git global core.fileMode false overridden locally on clone
Warning 2
core.fileMode is not the best practice and should be used carefully. This setting only covers the executable bit of mode and never the read/write bits. In many cases you think you need this setting because you did something like chmod -R 777, making all your files executable. But in most projects most files don’t need and should not be executable for security reasons.
The proper way to solve this kind of situation is to handle folder and file permission separately, with something like:
find . -type d -exec chmod a+rwx {} \; # Make folders traversable and read/write
find . -type f -exec chmod a+rw {} \; # Make files read/write
If you do that, you’ll never need to use core.fileMode, except in very rare environment.
git rev-parse --abbrev-ref HEAD | xclip -i -sel clip
Tested on: docker php:5.6.40-fpm
If you need Xdebug version compatibile with older php versions and you can’t do it by PECL.
Download sources to .docker
dir e.g. .docker/xdebug-2.5.5.tgz
In Dockerfile:
# Xdebug install from sources
RUN echo \
&& mkdir /usr/local/lib/xdebug
COPY .docker/xdebug-2.5.5.tgz /usr/local/lib/xdebug/xdebug-2.5.5.tgz
RUN echo \
&& cd /usr/local/lib/xdebug/ && tar zxvf xdebug-2.5.5.tgz \
&& cd /usr/local/lib/xdebug/xdebug-2.5.5 \
&& phpize \
&& ./configure --enable-xdebug \
&& make \
&& make install
Tested on GNU bash 5.0.17
find . -type f -name '*.php' -exec sh -c '
for name do
file "$name"
done' sh {} + | grep "(with BOM)"
#!/bin/bash
ls=$(ls -l /)
while IFS= read -r line; do
echo "$line"
done <<<"$ls"
Like this:
find . -type d -print0 | xargs -0 chmod 0755
find . -type f -print0 | xargs -0 chmod 0644
Or like this:
find . -type d -exec chmod 0755 {} \;
find . -type f -exec chmod 0644 {} \;