docker exec -it project_name_xxx_php_1 sh
apk add --no-cache --virtual .build-deps $PHPIZE_DEPS;
pecl install xdebug-3.0.2;
docker-php-ext-enable xdebug;
pecl install pcov
composer require --dev pcov/clobber
vi /usr/local/etc/php/php.ini
This file contains 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 | |
// http://ascii-table.com/ansi-escape-sequences.php | |
// http://ascii-table.com/ansi-escape-sequences-vt-100.php | |
// "\033[?25l" Hide the cursor. | |
// "\033[?25h" Show the cursor. | |
// "\033[K" Delete everything from the cursor to the end of the line. | |
// echo '1-Start Line', "\n"; |
This file contains 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
how detect system ? | |
/usr/lib/systemd tells you you're on a systemd based system. | |
/usr/share/upstart is a pretty good indicator that you're on an Upstart-based system. | |
/etc/init.d tells you the box has SysV init in its history | |
----- OR | |
strings /sbin/init | grep -q "/lib/systemd" && echo SYSTEMD | |
strings /sbin/init | grep -q "sysvinit" && echo SYSVINIT | |
strings /sbin/init | grep -q "upstart" && echo UPSTART | |
----- OR | |
sudo stat /proc/1/exe |
This file contains 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
sudo passwd username | |
------------------- hardware info | |
Battery Info | |
upower -i /org/freedesktop/UPower/devices/battery_BAT0 | |
acpi -V | |
less a.txt less is show text file faster than vim or more | |
more a.txt text editor ? | |
------------------ | |
how copy folder with content |
This file contains 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
/** | |
* ورودی تابع آبجکت DateTime است | |
* خروجی این متد تاریخ اول و آخر هفته است | |
* اول هفته شنبه و آخر هفته جمعه | |
* خروجی نمونه | |
* [ | |
* 'from' => 2018-1-6, | |
* 'to' => 2018-1-12 | |
* ] | |
*/ |
This file contains 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
RewriteEngine on | |
# If a directory or a file exists, use it directly | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
# Otherwise forward it to index.php | |
RewriteRule . index.php | |
# Redirect HTTP to HTTPS | |
RewriteCond %{HTTPS} off | |
RewriteCond %{HTTP:X-Forwarded-Proto} !https |
This file contains 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 | |
// http://jeffreysambells.com/2012/10/25/human-readable-filesize-php + some edit | |
// https://gist.github.com/liunian/9338301 | |
function human_filesize($bytes, $decimals = 2) | |
{ | |
if ($bytes < 1024) { | |
return $bytes . ' B'; | |
} | |
$factor = floor(log($bytes, 1024)); |
This file contains 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
if(responseCode.code === 200){ | |
var jsonData = JSON.parse(responseBody); | |
//postman.setEnvironmentVariable("usertoken1", jsonData.data.token); | |
pm.collectionVariables.set("token", jsonData.data.token) | |
} |
This file contains 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
sshuttle --dns -r ubuntu@130.250.10.5 -x 130.250.10.5 0/0 |
This file contains 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 | |
# gitup.sh | |
# gitup.sh HEAD | |
# gitup.sh HEAD~3 | |
if [ ! -z "$1" ] ; then | |
echo "Createing ../update.zip " | |
git diff --name-only "$1" --diff-filter=d | |
git archive -o ../update.zip HEAD $(git diff --name-only "$1" --diff-filter=d) |
OlderNewer