Do I need to associate my backend API server with a domain name to get an SSL certificate for it (HTTPS)?

I have developed my DRF back-end API locally, deployed it on an AWS Lightsail instance (with a public static IP) and I now want to secure it with HTTPS.

I understand that in order to use Let’s Encrypt (and not pay for an SSL certificate), I have to have a domain name associated to my instance IP since Let’s Encrypt doesn’t provide certificates for public IPs. As this is my back-end API (and not just a website), I don’t intend to buy a domain specifically for this.

  1. Can I, somehow, associate my Lightsail IP with another domain that I’ve already purchased (and is used to host my company’s landing page)? If yes, will there be any impact on my API’s performance?

  2. Is there any other alternative to obtain an SSL? (Apart from paying another CA to issue this for my public IP?)

Go to Source
Author: kingJulian

WordPress Multisite determine the correct domain to be set as current/default domain when setting multisite in Local fresh installation

I am unsuccessfully trying to setup multisite with WordPress’s fresh setup(WordPress installed in subfolder under htdocs of Localhost), but existing copy of Database already imported(provided by client).

Now the database already has atleast 15-16 different domain URLs already as entries of siteurl and home field in various wp_options tables for each site-domain.

And I want to use the same site-domains with little modifications to be able to work in Localhost WP multisite(like .com replaced with .local or so).

But even after doing all that and setting up multisite with following wp-config.php settings, when I try to access domain1.local, it tries to redirect to domain2.local like http://domain2.local/wp_signup.php?domain1.local and never redirects properly:

....
/* Multisite */
define('MULTISITE', true);
define('WP_ALLOW_MULTISITE', true);
define('SUBDOMAIN_INSTALL', true);
define('DOMAIN_CURRENT_SITE', 'domain1.local');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
....

.htaccess:

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*.php)$ $1 [L]
RewriteRule . index.php [L]

Can anyone help in figuring out what’s wrong here ?

Go to Source
Author: Vicky Dev

How to create an Event-Driven Architecture with many external sources

I work for this Accounting company – as a Product Owner – that uses several external services (one for Contract management, another one for Accounting Demands management, a third one for Financial purposes and so on).

My IT Director wants us to build an Event-Driven Architecture to gather all the events that happen externally and bring them into our NoSQL in as-close-as-possible realtime.

The problem specifically is: how can I gather this data from external sources? What would be the best procedure for hundreds of events every day from different services? Consuming their APIs periodically?

Can you guys shine a light on how this can be properly done?

Go to Source
Author: Otto Neres

Why can’t grub find the disk by UUID?

I’m trying to troubleshoot why I can’t boot to Windows.

The relevant entry in grub.cfg is:

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on /dev/sda3)' --class windows --class os $menuentry_id_option 'osprober-efi-BC6E-0415' {
        insmod part_gpt
        insmod fat
        set root='hd0,gpt3'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3  BC6E-0415
        else
          search --no-floppy --fs-uuid --set=root BC6E-0415
        fi
        chainloader /efi/Microsoft/Boot/bootmgfw.efi
}

Best I can tell, everything here is correct:
/dev/disk/by-uuid/BC6E-0415 is indeed the Windows boot manager partition.

However I’m slightly confused by the references to (hd0,gpt3) because that’s a completely different partition on a completely different physical disk. hd0 is the disk on which grub is installed though, in case that’s relevant.

The actual error I get when I try and boot Windows is:

error: no such device: BC6E-0415
error: file `/efi/Microsoft/Boot/bootmgfw.efi' not found

I do notice that in grub, if I drop to a grub command prompt and do an ls, the only hard disk I see listed is hd0 when my system actually has 4 hard disks. As I mentioned above, hd0 is the hard disk that has grub and my Linux installs.

So I think my question might be: why, when I boot to grub, can’t grub see any hard disks besides the one grub is on?

If I boot into Linux (Ubuntu 20.04.1) I can see all my hard disks just fine.

Go to Source
Author: Bridgey

If malware can be attached to an image file, then why aren’t images a common attack vector?

For example, if someone uploads a malicious image on website like Instagram or Facebook, and then hundreds of people viewed this image, wouldn’t that be an easy way to infect the devices of hundreds or thousands of people? If so, why do people view tens or hundreds of images without being afraid of getting their device infected?

Go to Source
Author: user241941

#Error! in ImportJSON formula in google sheets

I have been successfully using the following ImportJSON formula in google sheets:

=ImportJSON(csgoempire.com/api/v2/metadata/roulette/history?seed=1997, “/”, “noInherit,noTruncate,noPrefixHeaders”,94)

But it was until recently that, the same formula started to give below #ERROR! result. Could you please help? It has been working perfectly for almost 2 month:

enter image description here

Go to Source
Author: Sabuhi

Prevent THREADPOOL waits due to idle worker thread trimming

After reading Unusual THREADPOOL Waits by Josh Darnell, a Twitter user mentioned there is an undocumented trace flag to prevent trimming idle workers:

tweet

The idea is that once SQL Server has created enough threads to service the peak workload, it should not then trim worker threads (release them to the OS) after 15 minutes or so of them not being needed.

The idle worker threads will continue to use resources (e.g. memory) but there will not be the burst of THREADPOOL waits when more workers are suddenly required. Apparently this can be of assistance when using Always On Availability Groups.

What is this undocumented trace flag, and how does it work?

Go to Source
Author: Paul White 9

Parsing tabular data with awk issues

I am reposting this since people wanted a little more info and my question was closed, here is an example of what the output looks like, just typical tabular .txt stuff:

asdfsdf sdfsadf sdfsdf  92  83
sdfsdf  ewrwef  dsruh   32  42
sjgho   uhiu    uhgkuh  91  21

In the above, I am trying to just remove all entries where after the third tab it is below 80, and after the 4th it is below 70. So the 4th and 5th columns if viewed in excel must be above 80 and 70 respectively. In this case, only the first row should remain.

(old question)

I am trying to parse a tabular text file generated by Blastp using awk. Previously I have used this somewhat ugly code, because it worked, to go through to the right columns and cull out values below what I wanted.

#!/bin/bash 
#$ -cwd
#$ -pe mpi 16

awk '$4 > 80.0' blastoutput.txt > StepOne.txt
awk '$5 > 70.0' StepOne.txt > Culled.txt

Using it on a new blast result however, the file sizes remain at 300k kb with only a slight decrease on step one, and none for two. My best guess is that it is only recognizing a single line from the whole blast output file, and therefore not removing more. I would think maybe it had something to do with Unix/Windows line ends not being recognized as I saw on other answers, but the thing is I haven’t changed the way I’ve generated the blast results and it was working before, so I don’t know why it would all of a sudden change the way tabular results are created.

I’ve also tried using some parsing options I saw in other answers like the following:

perl -lane 'print $_ if ($F[4] >80.0)' blastp_output_8_26.txt > StepOne.txt

but the results seem to be the same.

Does anyone know what I could do to the blastp output file to make it work with my code? I am convinced something is amiss there, but all my attempts to fix it so far have been for naught.

Thanks.

Go to Source
Author: Asclepius123

Are DHCPv6 Information-request messages via unicast permitted?

RFC8415 section 16:

A server MUST discard any Solicit, Confirm, Rebind, or
Information-request messages it receives with a Layer 3 unicast
destination address.

RFC8415 section 18.4:

For example, unicast transmission is not allowed for Solicit,
Confirm, and Rebind messages (see Sections 18.3.1, 18.3.3, and
18.3.5, respectively), even if the Server Unicast option (see
Section 21.12) is configured. For Request, Renew,
Information-request, Release, and Decline messages, it is allowed
only if the Server Unicast option is configured
.

These statements contradict each other. Are unicast transmissions (after the receipt of a Server Unicast option) permitted or not?

Go to Source
Author: betanummeric

Gravity Forms for Woocommerce Add-on – GF Products amount not calculated in cart

Has anyone had experience with the Gravity Forms for Woocommerce Add-on? Specifically when generating GF Product fields.

Here is what I am trying to accomplish:
Using a Woocommerce product, I’ve added ACF fields, so that my client can add/edit/disable menu items for a Build Your Own BBQ.

enter image description here

I use a gravity form and its filters to generate these menu items as GF products based on the ACF field values.

enter image description here

Using the Gravity Forms for Woocommerce Add-on, I use the Gravity Form with the Woocommerce product, so that it can be added to the cart and checkout.

enter image description here

When setting quantities, the product calculation is correctly totaled.

enter image description here

When added to cart, is where the issue is. The cart shows as $0.00, while the “product” is correct.

enter image description here

GF product fields work fine when added directly through the Gravity Forms wordpress UI. But I need to generate them via code. The Add-on developer has said that in theory it should work when done this way, but was not sure. Has anyone tried this before?

Here is the code I wrote to generate the GF Products (menu items):

add_filter( 'gform_pre_render_10', 'backyard_smokeout_products' );
add_filter( 'gform_pre_validation_10', 'backyard_smokeout_products' );
add_filter( 'gform_admin_pre_render_10', 'backyard_smokeout_products' );
add_filter( 'gform_pre_submission_filter_10', 'backyard_smokeout_products' );
function backyard_smokeout_products($form) {
    $counter = array();
    $new_fields = array();

    foreach ($form['fields'] as $field) {
        $counter[] = is_int($field->id) ? $field->id : 0;
    }

    $counter = max($counter) + 1;

    $section = array (
        'id' => $counter,
        'type'  => 'section',
        'label' => 'Add Sides to your Custom BBQ',
        'description'   => '(a minimum quantity of 4 is required for any item you order)',
    );
    $field = GF_Fields::create($section);
    array_push($new_fields, $field);
    $counter++;

    $sides = get_field('backyard_sides', 1122);

    if($sides) {
        foreach ($sides as $side) {
            if($side['side_enable'] == true) {
                $props = array (
                    'id' => $counter,
                    'label' => $side['side_name'],
                    'type'  => 'product',
                    'inputs' => array(
                        array(
                          'id'    => $counter.'.1',
                          'label' => 'Product Name',
                          'name'  => $side['side_name'],
                        ),
                        array(
                          'id'    => $counter.'.2',
                          'label' => 'Price',
                          'name'  => $side['side_price'],
                        ),
                        array(
                          'id'    => $counter.'.3',
                          'label' => 'Quantity',
                          'name'  => 'param_qty'
                        ),
                    ),
                    'basePrice' => $side['side_price'],
                    'inputType' => 'singleproduct',
                    'cssClass'  => 'side-item gf_inline',
                    'description' => $side['side_description'],
                );
                $field = GF_Fields::create( $props );
                array_push($new_fields, $field);
                $counter++;
            }      
        }
    }


    for ($i=0; $i < count($form['fields']); $i++) { 
        if ('This form is generated programmatically' == $form['fields'][$i]['label']) {
            array_splice( $form['fields'], $i + 1, 0, $new_fields );
            return $form;        
        }
    }
    return $form;
}

Go to Source
Author: Alexnl

How to securely manage anti-populism social media bot army? [closed]

I’m planning on conducting a study on the spread of governmental propaganda, fake news, and rise of xenophobic hatred among users of social media platforms. As in my country it is still Facebook which is the most popular such site across generations, that’s the one I’m considering to choose.

My plan is to set up a couple hundreds of bots. The government of my country has gradually shifted towards strong populism, xenophobia, and authoritarianism in recent years, thus pro-governmental groups and Facebook pages would surely be an ideal start. The accounts would seem like a real person (some with photos of real individuals, preferably using royalty-free online image sources) but most, obviously, would just have some generic profile picture.

The point is to use marginalized opposition, as well as international news sites as the source of information to protest against the government’s use of propaganda, hence raising awareness to the dangers of public incitement against a group of people (be it either members of an ethnic, religious, sexual minority, intellectuals, critiques, pro-opposition figures or any other group).

A script would be in charge of regularly logging in each of these accounts and randomly selecting one account each day to be the one hinting the comments across governmental platforms, while managing all the rest to like and share the thoughts of the daily selected account.

My question is: Is there a concern about Facebook detecting that a huge number of accounts are being managed from a single computer, and shutting the whole down? Would a VPN service be a solution, given that the script would only use a specific IP address to log in at most a couple of accounts and then change the IP to a different one? Or, instead of the hassle and financial consequences of having to use multiple VPNs, would it be more advisable to use the Tor browser and access the Facebook accounts via that?

Go to Source
Author: cornel1404

Can Object pool design pattern cause memory shortage?

When I am using the Object pool design pattern, and allowing the pool to grow, by creating new objects when they are required but not available in the pool, and placing them in the pool after they have been used, can it eventually cause memory shortage, or some kind of an out of memory exception/error?

It looks very reasonable that after some time it will happen, because the pool grows, and the object within it don’t get deleted.

Go to Source
Author: Daniel

cant restore nuget packege on ubuntu after upgrae to .net core 3.1

i am running .net core 2.1 on Ubuntu 18.04 so far so good

i upgrade my project to .net core 3.1 and installed the 3.1 SDK

since than i cant use ‘dotnet restore’

this is the full output

/usr/share/dotnet/sdk/3.1.401/NuGet.targets(128,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/repos/myproj/portal/PortalApi/PortalApi.csproj]
/usr/share/dotnet/sdk/3.1.401/NuGet.targets(128,5): error :   The SSL connection could not be established, see inner exception. [/repos/myproj/portal/PortalApi/PortalApi.csproj]
/usr/share/dotnet/sdk/3.1.401/NuGet.targets(128,5): error :   The remote certificate is invalid according to the validation procedure. [/repos/myproj/portal/PortalApi/PortalApi.csproj]

any idea why ?

thanks

Go to Source
Author: David Munsa