This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env php | |
| <?php if (PHP_SAPI !== 'cli') die('cli access only'); | |
| $host = '127.0.0.1'; | |
| $port = mt_rand(31000, 60000); | |
| $dir = locate_webroot(); | |
| if (!$dir) { | |
| echo "Error: Could not locate the web root\n"; | |
| echo sprintf("Usage: php %s /var/www/html\n", __FILE__); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $build_array_text = function (array $array, $indent = 4, $space = " ", $depth = 0) use (&$build_array_text) { | |
| $string = "array(\n"; | |
| $keys = array_keys($array); | |
| $assoc = array_keys(array_fill(0, count($array), null)) !== $keys; | |
| $lastK = $keys[count($array) - 1]; | |
| foreach ($array as $k => $v) { | |
| $string .= str_repeat($space, $indent * ($depth + 1)) . ($assoc ? "'$k' => " : "") . | |
| (is_array($v) ? $build_array_text($v, $indent, $space, $depth + 1) : | |
| (is_bool($v) ? ($v ? "true" : "false") : | |
| (is_numeric($v) ? $v : "'" . addslashes($v) . "'")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php return trigger_error('UOPZ IDE helper should not be loaded', E_USER_WARNING); | |
| // The following opcodes are defined as constants by uopz: | |
| /** | |
| * Invoked by exit() and die(), recieves no arguments. Return boolean TRUE to exit, FALSE to continue | |
| */ | |
| define('ZEND_EXIT', 79); | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| c.*, | |
| fk.fk_table_schema, | |
| fk.fk_table_name, | |
| fk.fk_column_name, | |
| fk.constraint_name fk_constraint_name | |
| FROM ( | |
| SELECT | |
| table_catalog, | |
| table_schema, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| find . -type f | xargs grep -Hno "$@" | grep -E '^\.' | awk -F':' '{print $1, "-L", $2 "," $2}' | xargs -I@ sh -c 'printf "@\t"; git blame --date="short" @' | perl -pe 's/^(.+) -L [^ ]+\t(\w+) \(.+?([0-9-]+).+/$3\t$2\t$1/' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # copy php ini scan directory entries to the temp folder | |
| PHP_INI_SCAN_DIR=$(php --ini | egrep '^Scan' | perl -pe 's/^.+: //') | |
| PHP_INI_TEMP_DIR=$(mktemp -d) | |
| find "${PHP_INI_SCAN_DIR}" -maxdepth 1 -type l -name '*.ini' -not -name '*xdebug.ini' | xargs -I@ cp @ "${PHP_INI_TEMP_DIR}" | |
| # set the temp folder as the php ini scan directory | |
| export PHP_INI_SCAN_DIR=$PHP_INI_TEMP_DIR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -eo pipefail | |
| export PHP_OPENSSL_DIR=yes | |
| if [ "$(uname)" == "Darwin" ]; then | |
| PHPBREW_OS_FLAGS="" | |
| PHPBREW_OS_VARIANTS="+pdo" | |
| else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env php | |
| <?php | |
| $args = call_user_func(function () { | |
| preg_match_all( | |
| '/"[^"]+"|\'[^\']+\'|[^ ]+/', | |
| preg_replace_callback( | |
| '/--?([a-z0-9_-]+)(?:[ =]("[^"]*"|\'[^\']*\'|[^ -]+))?/i', | |
| function ($match) use (&$args) { | |
| $k = $match[1]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| JENKINS_PATH=/var/lib/jenkins | |
| JOBS_PATH=$JENKINS_PATH/jobs | |
| WORKSPACE_PATH=$JENKINS_PATH/workspace | |
| MULTI_BRANCH_PROJECTS=$( \ | |
| find "$JOBS_PATH" -maxdepth 2 -type f -name 'config.xml' | \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| PACKAGE_INSTALL_DATES=$( \ | |
| zgrep -h '' /var/log/apt/history.log* \ | |
| | perl -0777 -pe 's/\n{2}/\0/g' \ | |
| | perl -0777 -pe 's/\n/|/g' \ | |
| | perl -0777 -pe 's/\0/\n/g' \ | |
| | grep 'Install:' \ | |
| | sort -r \ | |
| | perl -pe 's/^.*Start-Date: ([^ ]+).*Install: (.+?)\|.+$/\1: \2/' \ |