Form ajax in frontend loses search values

I am using an ajax form in the frontend, and at the user experience level it is fabulous, the user can have fun finding what he wants by playing with the filters, no problem.

The problem instead arises when once the user decides to choose a result, he obviously enters the result page, but if he decides to go back to the search page, poof, search results disappeared, because there is no url from which fetching data the form does not keep the previous search in memory.

Structure of the ajax form:

<form action="<?php echo site_url() ?>/wp-admin/admin-ajax.php" method="POST" id="filter">
<!-- form fields -->
<button>Apply filter</button>
<input type="hidden" name="action" value="myfilter">
</form>

and:

<div id="response"></div>

functions.php

add_action('wp_ajax_myfilter', 'ajax_filter_function'); // wp_ajax_{ACTION HERE}
add_action('wp_ajax_nopriv_myfilter', 'ajax_filter_function');

function ajax_filter_function(){
        $args =  array(
            'post_type' => 'pro',
            'posts_per_page' => -1,
            'meta_key'    => $_POST('categoryfilter'),
            'orderby'    => 'meta_value_num',
            'order'       => $_POST('order'),
        );
    $query = new WP_Query( $args );

    if( $query->have_posts() ) :

        while( $query->have_posts() ): $query->the_post();
          /*SOME DATA SHOW PRODUCT*/
        endwhile;
        wp_reset_postdata();
    endif;

}

since the results are inside a single-nameofcustomposttype.php, obviously when the user selects the product he wants the url he follows the permalink of the custom post type, how to solve this huge problem?

My phone loses connection after sending 150-200 sms

I’m sms spamming to my business number (because of a campaign from my provider). But after sending 150-200 sms from my personal number to any number my phone loses connection. I called the service provider of my personal phone that I use to send sms. They said it shouldn’t happen. I’m using an application for sms spamming and it is sending 1 sms per second. Samsung Galaxy S7 Edge 32GB Android 7.0 rooted.

magento2.3 – Magento 2.3 – Controller plugin redirect back to form loses form values

I have a plugin running on the aroundExecute of the MagentoCustomerControllerAccountCreatePost controller.

use MagentoFrameworkControllerResultRedirectFactory;
use MagentoFrameworkUrlFactory;
use MagentoFrameworkMessageManagerInterface;

public function __construct(
    UrlFactory $urlFactory,
    RedirectFactory $redirectFactory,
    ManagerInterface $messageManager

)
{
    $this->urlModel = $urlFactory->create();
    $this->resultRedirectFactory = $redirectFactory;
    $this->messageManager = $messageManager;
}

public function aroundExecute(
    MagentoCustomerControllerAccountCreatePost $subject,
    Closure $proceed
)
{
    $this->messageManager->addErrorMessage(
        'Error testing'
    );
    $defaultUrl = $this->urlModel->getUrl('*/*/create', ('_secure' => true));
    $resultRedirect = $this->resultRedirectFactory->create();
    return $resultRedirect->setUrl($defaultUrl);

}

This works fine, but all form values on the registration form are lost on redirect back.
Any idea how I can pass them back to the original form and have them repopulate the form fields?
Thanks

networking – Ubuntu 20.04 loses network in AWS after updates 28 october

28 october I run a series of normal updates on one of my Amazon-EC2 instances. For some reason it locked up and I had to reboot it. It got up but it never got any network again. So after a lot of troubleshooting I restored it from an old snapshot. After updating it (that went smoothly) I rebooted as expected and it got up, but without network connectivity. This is quite annoying.

Is this a known problem? When I look in dpkg.log in the instance that crashed first, the following packages were updated (filtered dump from dpkg.log). I see quite a lot of network-related stuff there.

upgrade ca-certificates:all 20190110ubuntu1.1 20201027ubuntu0.20.04.1
upgrade distro-info-data:all 0.43ubuntu1.1 0.43ubuntu1.2
upgrade accountsservice:amd64 0.6.55-0ubuntu12~20.04.1 0.6.55-0ubuntu12~20.04.2
upgrade libaccountsservice0:amd64 0.6.55-0ubuntu12~20.04.1 0.6.55-0ubuntu12~20.04.2
upgrade bind9-dnsutils:amd64 1:9.16.1-0ubuntu2.3 1:9.16.1-0ubuntu2.4
upgrade bind9-libs:amd64 1:9.16.1-0ubuntu2.3 1:9.16.1-0ubuntu2.4
upgrade bind9-host:amd64 1:9.16.1-0ubuntu2.3 1:9.16.1-0ubuntu2.4
upgrade libplymouth5:amd64 0.9.4git20200323-0ubuntu6 0.9.4git20200323-0ubuntu6.1
upgrade plymouth-theme-ubuntu-text:amd64 0.9.4git20200323-0ubuntu6 0.9.4git20200323-0ubuntu6.1
upgrade plymouth:amd64 0.9.4git20200323-0ubuntu6 0.9.4git20200323-0ubuntu6.1

My (admittedly bad) forensics says that something goes wrong in cloud-init. That init is necessary as an instance gets a new IP every time it boots (it has a static IP but that is routed to the dynamic one).

I see two ways forward: Either I restore from my dump again and try to hold the packages above somehow or I find a way to fix the resulting network issue without having access to the live machine (as it has no network), I do have access to the file system when the machine is taken down though.

Any ideas or help appreciated! Thank you!

gateway – Ubuntu 16.04 server loses default route on restart

One of my Ubuntu servers always loses its default route when restarted. I have a second server which has an almost identical set up which works fine. I am not sure when the problem started but it first became an issue when we started auto patching so the servers get rebooted every month.

rful011@secesprd02:~$ ifconfig
bond0     Link encap:Ethernet  HWaddr f4:e9:d4:a0:6f:50  
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:27405882 errors:0 dropped:127 overruns:0 frame:0
          TX packets:11898380 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:38129519206 (38.1 GB)  TX bytes:14527843371 (14.5 GB)

bond0.1060 Link encap:Ethernet  HWaddr f4:e9:d4:a0:6f:50  
          inet addr:10.6.0.68  Bcast:10.6.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4349473 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2832180 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:36350288670 (36.3 GB)  TX bytes:13842264977 (13.8 GB)

and in /etc/networks/interfaces:

auto bond0
iface bond0 inet manual
    post-up ifenslave bond0 enp2s0f0 enp2s0f1
    pre-down ifenslave -d bond0 enp2s0f0 enp2s0f1
    bond-slaves none
    bond-mode 4
    bond-miimon 100
    bond-lacp_rate 0

auto enp2s0f0
iface enp2s0f0 inet manual

auto enp2s0f1
iface enp2s0f1 inet manual

auto bond0.1060
iface bond0.1060 inet static
    address 10.6.0.68
    netmask 255.255.255.0
    network 10.6.0.0
    broadcast 10.6.0.255
    gateway 10.6.0.254

These files are identical (except for the IP address) to the setup on the machine that works.

This is an important production server so I really don’t want to go bouncing it often to test stuff !
Does anyone have any ideas on how to diagnose what is going on.

❕NEWS – One person loses $ 20,000 in BNB and Binance CEO asks community for help | Proxies123.com

A person made a mistake sending 800 BNB ($ 20,000) in BNB and begged Binance to help him, this transaction was made on Binance Smart Chain. In response on September 12 the CEO of Binance asked the community if they think he should help this person, he was considering helping him.
This person alleges that the exchanger is responsible for being the developer of this new chain.
This reopens the debate on such a complicated topic, reverse crypto.
Is it worth helping the person who has made a mistake or is it necessary to establish that the code is absolute law and it doesn’t matter what happens to the users?

Inheritance and domain-specific logic loses its independency?

Im sorry in forward, Im sure I wont be able to express myself well.
Its a game system:

abstract class GameType
{
    private $score;

    public __constructor($score)
    {
        $this->score = $score;
    }

    public abstract function getName();

    public function getScore()
    {
        return $this->score;
    }
}

final class Soccer extends GameType
{
    public function getName() :
    {
        return 'soccer';
    }
}

final class Basketball extends GameType
{
    public function getName() :
    {
        return 'basket ball';
    }
}

final class Hockey extends GameType
{
    public function getName() :
    {
        return 'hockey';
    }
}

this illustrates 3 kind of games, each can be scored, all has different names (I know, getName() could be replaced with constants, but lets forget it for now)

Now this seems to be fine and system-independent, lets say it’s being developed by a team with FRAMEWORK A and it can be passed to another system developed by FRAMEWORK B

Until now. A new requirement, lets send an email if a score takes place:

abstract class GameType
{
    private $score;

    public __constructor($score)
    {
        $this->score = $score;
    }

    public abstract function getName();

    public abstract function notifyIfScored();

    public function getScore()
    {
        return $this->score;
    }
}

final class Soccer extends GameType
{
    public function getName() :
    {
        return 'soccer';
    }

    public abstract function notifyIfScored()
    {
        FRAMEWORK1::sendEmail('score 1');
    }
}

final class Basketball extends GameType
{
    public function getName() :
    {
        return 'basket ball';
    }

    public abstract function notifyIfScored()
    {
        FRAMEWORK1::sendEmail('score 2');
    }
}

final class Hockey extends GameType
{
    public function getName() :
    {
        return 'hockey';
    }

    public abstract function notifyIfScored()
    {
        FRAMEWORK1::sendEmail('score 3');
    }
}

sending email is tied to FRAMEWORK1, but even if we could pass it outside as Dependency Injection, its still looks like the class has to do "more" and by doing this, it looses the independence of ANY framework.

display – Macbook Air 2019 – External 4K monitor loses resolution

I have a 2019 Macbook Air and I use a QGeeM USB-C hub to connect to an ASUS 28″ 4k monitor.
The Monitor has a DP port and and 2 HDMI ports – one for 4K @ 30Hz and the other 1080p @ 60Hz.
I connect to the HDMI port that supports 4k @ 30Hz.
I use a Logitech keyboard with the USB dongle connected to the hub. And an Apple bluetooth trackpad.
I leave the macbook screen/lid closed and connect to the hub.

98% of the time the 4k resolution on the monitor works perfectly. Every once in a while, the 4K monitor loses its resolution and I can only get 1080p.
Sometimes, I can just restart the macbook, unplug and replug the display HDMI cable and everything works fine. And sometimes I end up spending an entire day trying to fix this.

Any ideas on why this happens ? How do I fix this ?

Thanks,V

networking – minikube on virtual box loses HostOnly network after host was in sleep mode – How to recover?

I’m running minikube with the vbox driver. I noticed that when I get back to my workstation after it’s been in sleep mode, I can’t do kubectl get pods (or any other kubectl command).

Some digging and I found that the the HostOnly network adapter of the minikube machine is not working. I logged in to the machine with minikube ssh and tried to restart the interface but I’m just getting an error.

$ ifdown eth1 
ifdown: can't open '/etc/network/interfaces': No such file or directory

the only thing currently working is to minikube stop and minikube start again. But that takes long and I just want to get back to work.

any ideas on how to fix the network quicker after it’s been in sleep mode? or prevent it losing the network altogether?

wireless networking – Ubuntu 20.04 loses wifi card

I just dis a fresh install of Ubuntu 20.04 on an old computer and after 1-2H of usage the wifi drops and there is no way to connect it back since the prefs show an error message: No wifi adaptor found. (Works again after a reboot).

FYI: The wifi card is an Atheros AR9485 (internal) and is running using ath9k & everything is up-to-date