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 | |
/** | |
* Content from http://en.wikipedia.org/wiki/List_of_HTTP_status_codes | |
* | |
* You may also want a list of unofficial codes: | |
* | |
* 103 => 'Checkpoint', | |
* 218 => 'This is fine', // Apache Web Server | |
* 419 => 'Page Expired', // Laravel Framework |
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
docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 -v sonarqube:/opt/sonarqube/data sonarqube | |
docker run -d -u zap -i owasp/zap2docker-stable zap.sh -p 8090:8090 | |
docker run -i owasp/zap2docker-stable zap-cli quick-scan --self-contained --start-options '-config api.disablekey=true' http://localhost | |
docker run -d -u zap -p 8080:8080 -p 8090:8090 -i owasp/zap2docker-stable zap-webswing.sh | |
http://localhost:8080/zap | |
docker start sonarqube |
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 | |
$client = new GuzzleHttp\Client(); | |
$promise = $client->requestAsync('GET', 'http://httpbin.org/get'); | |
$promise->then( | |
function (ResponseInterface $res) { | |
echo $res->getStatusCode() . "\n"; | |
}, | |
function (RequestException $e) { | |
echo $e->getMessage() . "\n"; |
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
Can We Override the Default Charset? | |
-Dfile.encoding="UTF-8" | |
-Dsun.jnu.encoding="UTF-8" | |
java -Dfile.encoding=utf-8 -jar target\application.jar |
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
-- ---------------------------------------------------------------- | |
DROP FUNCTION IF EXISTS getIdEntrepriseFromPrestation; DELIMITER // | |
CREATE FUNCTION getIdEntrepriseFromPrestation(id_post_prestation INT) RETURNS INT BEGIN | |
DECLARE idEntreprise INT; | |
SELECT pm.meta_value INTO idEntreprise FROM wp_612371_postmeta pm INNER JOIN wp_612371_posts p ON p.ID=pm.post_id | |
WHERE p.post_type = "prestation" AND pm.meta_key = "Entreprise" AND p.ID=id_post_prestation; | |
RETURN idEntreprise; | |
END // DELIMITER ; | |
SELECT getIdEntrepriseFromPrestation(74511); |
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
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); | |
_firebaseMessaging.configure( | |
onLaunch: (Map<String, dynamic> message) { | |
print('onLaunch called'); | |
}, | |
onResume: (Map<String, dynamic> message) { | |
print('onResume called'); | |
}, | |
onMessage: (Map<String, dynamic> message) { | |
print('onMessage called'); |
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
mount /dev/sdb5 /mnt | |
mount --bind /dev /mnt/dev | |
mount --bind /dev/pts /mnt/dev/pts | |
mount --bind /boot /mnt/boot | |
mount -t proc /proc /mnt/proc | |
mount -t sysfs /sys /mnt/sys | |
for dir in proc dev sys etc bin sbin var usr lib lib64 tmp; do | |
# mkdir /mnt/$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
sudo a2dismod php5.6 | |
sudo a2dismod php7.0 | |
sudo a2enmod php7.2 | |
sudo update-alternatives --set php /usr/bin/php7.2 | |
sudo update-alternatives --set phar /usr/bin/phar7.2 | |
sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.2 | |
# sudo update-alternatives --set phpize /usr/bin/phpize7.2 | |
# sudo update-alternatives --set php-config /usr/bin/php-config7.2 |
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
wget https://files.phpmyadmin.net/phpMyAdmin/4.9.10/phpMyAdmin-4.9.10-all-languages.zip | |
unzip phpMyAdmin-4.9.10-all-languages.zip | |
sudo mv phpMyAdmin-4.9.10-all-languages/ /usr/share/phpmyadmin | |
sudo mkdir -p /var/lib/phpmyadmin/tmp | |
sudo chown -R www-data:www-data /var/lib/phpmyadmin | |
sudo mkdir /etc/phpmyadmin/ | |
sudo cp /usr/share/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php |
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
mkdir /tmp/chrome2 | |
google-chrome --user-data-dir=/tmp/chrome2/ |