Skip to content

Instantly share code, notes, and snippets.

View lahaxearnaud's full-sized avatar
🎯
Focusing

LAHAXE Arnaud lahaxearnaud

🎯
Focusing
View GitHub Profile
@lahaxearnaud
lahaxearnaud / pihole
Last active November 5, 2023 14:11
Pihole
0.0.0.0 adfox.yandex.ru
0.0.0.0 adfstat.yandex.ru
0.0.0.0 adm.hotjar.com
0.0.0.0 ads-api.tiktok.com
0.0.0.0 adtech.yahooinc.com
0.0.0.0 advertising-api-eu.amazon.com
0.0.0.0 advertising.apple.com
0.0.0.0 afs.googlesyndication.com
0.0.0.0 analytics-api.samsunghealthcn.com
0.0.0.0 analytics-sg.tiktok.com
/**
* Responds to any HTTP request.
*
* @param {!express:Request} req HTTP request context.
* @param {!express:Response} res HTTP response context.
*/
exports.helloWorld = (req, res) => {
let name = req.body.name || 'World';
➜ ~ ab -n 1000 -c 10 https://XXXXXXXXXX.execute-api.eu-central-1.amazonaws.com/default/test
// ...
Concurrency Level: 10
Time taken for tests: 16.969 seconds
Complete requests: 1000
Failed requests: 0
Total transferred: 305000 bytes
HTML transferred: 19000 bytes
Requests per second: 58.93 [#/sec] (mean)
Time per request: 169.686 [ms] (mean)
exports.handler = async (event) => {
console.log("value2 = " + event.name);
var text = event.name || "from Lambda";
const response = {
statusCode: 200,
body: JSON.stringify('Hello ' + text),
};
return response;
};
docker save jonbaldie/varnish -o layers.tar
tar xvjf layers.tar
cd c06fe384a155fd3501bdb5689a4d79a18c80a63243038184f457793490b7ddde
tar xvjf layer.tar
cat install.sh
version: '3'
services:
worker_mailer:
image: ma-super-image-de-worker:latest
environment:
- QUEUE_NAME=amqp_mailer
volumes:
- "/PATH/VERS/MON/APP/SF:/app:rw"
deploy:
FROM php:7.2
# Composer
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
&& php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
&& php composer-setup.php --install-dir=/bin --filename=composer \
&& php -r "unlink('composer-setup.php');"
# amqp
RUN apt-get update && apt-get install -y librabbitmq-dev libssh-dev \
[program:amqp_mailer]
command=php /symfony/bin/console messenger:consume-messages amqp_mailer
startsecs = 0
stdout_logfile=/tmp/supervisord-amqp.log
stdout_logfile_maxbytes=10MB
App\Message\Handler\ConfirmCommandMailerHandler:
tags: ['messenger.message_handler']
<?php
namespace App\Message\Handler;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Messenger\MessageBusInterface;
use App\Message\ConfirmCommandMailer;
use \Swift_Mailer;
/**