How to return Service Worker with custom HTTP header from custom module

To provide a dynamic file, you need to make a Controller with a method like:

 public function serve(Request $request) {
    $file_str = $file_system->realpath($module_handler->getModule('my_module')->getPath()) . '/assets/js/service-worker.js';

    if (file_exists($file_str)) {

      $response = new BinaryFileResponse($file_str, 200);
      $response->headers()->set('Content-Type', 'application/javascript');
      // Allow same origin service worker.
      $response->headers()->set('Service-Worker-Allowed', "https://drupal.stackexchange.com/");

      return $response;
    }

    throw new NotFoundHttpException();
  }

And then define a route for it, where the path is not existing as a static file, like:

example.serviceworker:
  path: '/serviceworker.js' 
  defaults: 
    _controller: 'Drupalmy_moduleControllerExampleController::serve' 
  requirements: 
    _permission: 'access content' 

see – https://www.drupal.org/docs/drupal-apis/routing-system/introductory-drupal-8-routes-and-controllers-example.

alerting – how to stop a service who crashed to spam all terminals

when a category of failures called “fatal” happen the service spam all terminals with the failure message every second. This is very annoying and disturbed the work on the server.

in the past this was only for kernel critical things, but today even postfix alerts “fatal” because a spam mail does not reach the victim ..

fatal: file /etc/postfix/main.cf: parameter myhostname: bad parameter value: <your hostname here>

Is there a way to stop this?

❕NEWS – Crypto Exchange, Binance Makes KYC Compulsory For Access To Its Service. | NewProxyLists

In view of the recent bully on Binance by the government of different countries as regards the platform not complying with their regulations.
The Binance platform has announced that all registered members to verify account with them with government-issued ID and facial Verification, which will give them access to Binance activities, like cryptocurrency, deposits, trades, and withdrawals. This will help provide protections against Money Laundering and fight other financial crime and also provide a crypto-friendly environment for everyone.
Are you a registered binancian and have you verify your account?.

Are the following layers part of SOA (Service Oriented Architecture) or Microservices Architecture?

In terms of a Java Application, when talking about the following layers, …

  1. UI
  2. Resources
  3. Services
  4. Data Models

… ‘Resources’ represent the API, and ‘Services’ represent the business logic… But, do these layers belong to a Service-Oriented Architecture or do they belong to a Microservices Architecture?

New Captcha service

Hi @Sven
There is a new captcha decoding service called Captcha69. However, they do not support emulating other famous captcha services. Can you integrate their services into GSA SER? I’m happy to provide an API code if you need it.

Best alternative backup service? | Web Hosting Talk


TL;DR – Ubuntu 20.04 VPS on OVH, looking for backup solutions, thinking local? Using Virtualmin, and running 7 sites for free so trying to keep it down in costs. Thanks.

For being so technology saavy in some areas, I am a complete dunce in others.

OVH where I keep my VPS, charges EXTREMELY large amounts of money for backups (much, much, more than the servers themselves)

I had a company hire me, and they wanted to test a bunch of Dedicated Servers, so they chose 20 places, and bought the servers. They canceled the OVH one, and OVH gave them a credit, and since it was under my name the boss said “keep it” because they didn’t need the money back, didn’t need the hassle. So I got a credit of $300.

I chose the $12 a month for 2 year package, 2 cores, 4 GB of RAM for 2 years for free, with leftover money. I figured I run at least 3-5 sites for “free” for friends, they can share an IP and have everything migrated, so that’s what I did. What I didn’t do, was check backups. Backups are insane. I would ALMOST be better off trying to get another one for 2 years, identical setup, and have it be a mirror of the original server in every way except IP. This way no need for a backup?

However I am wondering is there any backup service or something I could do to back things up locally? I would love to save all my sites databases and data on my PC, none of them have videos so they weigh in between 100mb and 400mb at the absolute heaviest. Altogether I have 5-7 GB worth of stuff to back up. I don’t know if I should get a Vultr, Linode, Digital Ocean VPS and use that somehow, or local backup, or what I even have options for.

Offering I post or You post FP$ Service | Forum Promotion

Hello! Originally I had this be for posting on my forum but thought I’d update it.

I will post on your forum

40FP$ per reply. 50FP$ per thread.
Maximum 20 total per person at one time. People can request again as soon as the posts are completed & payment is sent & received.
Will be done no longer than in two weeks time. More than likely sooner.
If I’m new, I’ll upload an avatar & do an intro post as a freebie.
I will offer 2 to 3 lines minimum.
Prefer forums with a general section as I’m not into games nor tech.

You post on my forum

400FP$ for 10 posts. Can be threads or replies.
If new, please upload an avatar & post an intro that will be counted towards the total.
Games are excluded. Please make the post at least one line’s worth.
Even though my forum is holistic in nature, there is a General section, Entertainment, Question of the Day, etc.

You can post here or PM me.
Thank you! :)
HOST https://holisticallysecular.proboards.com/

advertising – Local Campaign Strategy – Core Towns vs Extended Service Area

I’m a local service business that services 5 core towns very well but we also service 10-15 towns frequently but can’t provide nearly the same level of service as the core 5 towns. What’s a “Best Practices” approach to this common local business problem from a Campaign Structure perspective?

One Solution I’m considering: 2 Campaigns

Have a Core Business Area Campaign with Ad groups that really make stronger advertising statements, maybe has a higher budget and more restrictive location area. And then have a Selective Business Area or Broader Business Area campaign that is a little more restrained as far as claims of what we offer, maybe has a lower budget and reaches a larger location?

If this is a good solution, would it be OK if the locations in these areas overlapped because wouldn’t the higher bidding Core Campaign campaign overwrite the lower bidding Broader Business Area campaign?

Alternatively – only 1 campaign:
With 1 campaign, I’d be able to use the bid adjustments at the location level.

I’m feeling like it makes sense to have 2 campaigns but I was hoping someone on here might be aware of best practices.

fedora – podman load executed in systemd service not taking effect on fcos system

Hi I’m new to FedoraCoreOs. But I’m trying a very simple probe of concept. I’m trying to load a .tar docker image into the fedora core os local registry at starup. I’m using systemd and a service which will perform the load, but I’m missing something, since the service is executed, but when I type podman images the imaget listed.

This is my unit configuration

cat etc/systemd/system/test.service

    [Unit]

    Description=My custom service



    [Service]

    Environment=PODMAN_SYSTEMD_UNIT=%n

    Restart=on-failure

    Type=oneshot

    StandardInput=null

    StandardOutput=journal

    StandardError=journal+console

    RemainAfterExit=yes

    ExecStart=/etc/rc.d/init.d/startServiceTest.sh

The script being called is

cat /etc/rc.d/init.d/startServiceTest.sh

#!/usr/bin/env bash

podman load -i /etc/files/docker.tar

When the image boots I check the status of the service and it is run ok
service status output

But after that if I check podman images the docker image is not listed.
Note: If I run the commands manually it works

Any ideas??

KINZA Awards – The best affiliate service | NewProxyLists

Hi,

We’ve got great news! AdsBridge platform is taking part at KINZA Awards in the nomination “The best affiliate service”.

1kQrziSo2ihwvjJrIw0xxV6S6P0XTLgwKzrjboc4.jpg

The voting at KINZA Awards is in full swing and your voice is significant for us!

How to support AdsBridge ❓

1 Sign in to FB/VK;

2 Vote for AdsBridge in nomination “Лучший арбитражный сервис /тул” (The best affiliate service).

Thank you for staying with us and showing your support!

Follow the voting link below! 👇

Wish you a nice day!