development strategy – wp-insert-post execute from server?

I wanted to ask for help.

I am working on a project to develop a program to publish a post to many wordpress sites that aren’t on a multisite network but are all on the same server.

the requirements for this program is that it does not take delay for publishing so the post should be sent once onto the server and the server will have to add the post to many sites and the program also needs to filter the publishing of the post to sites with the requested categories.

I Have started to work on it. i found 2 solutions to adding a posts to a wordpress site:

  1. wp-insert-post and other functions in the wordpress documentation
  2. xml-rpc

for now i understand the program will be slipt into 3 parts:

  1. an interface where the sites with the similar category will be selected to the post.
  2. a program on the server that receives the publish request and the chosen sites to submit it to.
  3. a program to publish to the website.

if anyone has any tips and ideas to help or has worked on a similar project please help.

reactjs – How to re execute componentDidMount again when i click the component again?

enter image description here

This is my top navbar of my project and
enter image description here

when i click on blogs button list of all blogs will rendered and in this component i have a search option now when i have search text let’s say “vue” then i will get the required result

handleSubmit = values => {
    const { size } = this.state;
    this.setState({ searchString: values.searchString, isSearch: true });
    SearchSchema.searchString = this.state.searchString;
    this.props.history.push(`/blogs?q=${values.searchString}`);
    this.props.actions.loadBlogs({ page: 0, size, searchString: values.searchString });
  };

and this is componentDidMount of Blog Component

componentDidMount = () => {
    const { size } = this.state;
    const params = new URLSearchParams(this.props.location.search);
    const q = params.get('q');
    if (q) {
      this.setState({ searchString: q, isSearch: true });
      this.props.actions.loadBlogs({ page: 0, searchString: q, size });
    } else {
      this.setState({ searchString: '', isSearch: false });
      this.props.actions.loadBlogs({ page: 0, size });
    }
  };

After getting the result when i again clicked on Blogs from Top Navbar (in screenshot) url is getting changed but not getting all the blogs

<Link className="nav-link" to="/blogs">
            Blogs
          </Link>

enter image description here

screenshot with search result and url will be http://localhost:8075/blogs?q=vue
same screenshot is also applicable when i clicked blogs button again url is getting changed but blogs is not updated http://localhost:8075/blogs

command line – Error during the installation of Java: cannot execute binary file: Exec format error

I have feeling that I messed up something badly, I am new Linux user, so I was trying to install java..

So basically the command that I run in terminal is following:

java -version

Error which I get

-bash: /usr/local/java/jdk-16/bin/java: cannot execute binary file: Exec format error

I was basically following this tutorial, and I might know where’s problem, but now I can’t find out which one tutorial I followed up, because after I did everything it didn’t worked, so I treid another one… And I can’t really recall the exact path where I was creating those changes(in which directory). I just know that I was going into /exec/ and there was some other files that I made changes to with nano, I remember that I added something like $JAVA_HOME = …. and then something

If someone can help, I’d be grateful

Execute Command with Oracle sqlcl directly on command line and save to CSV

I am using Apache Airflow to download data from Oracle source. To allow the SQL query be visible on Airflow UI, I am looking for approach to have the SQL query passed as parameter directly on command line, rather than using execute SQL file approach.

Using execute file approach, I’d do

sql username/password@//host:port/servicename @query.sql

and the file would contain spool command for the output path.

Can I perhaps do something like

sql username/password@//host:port/servicename --query="SELECT * FROM data.order" --output="/path/to/csv/data.csv"

The SQL query passed to the command line will be rather long and will require multiline text.

How to execute plugin and theme updates from a web hook / endpoint?

REST or anything RESTful is a generally adhered to standard of getting things done via API. It also has the capability of documenting itself.

Now I had expected to write an answer here about how it’s not a great idea to allow endpoints to update or modify any of your codebase but I see it seems the good folks at Automattic have thought it ok and they know the core a lot better than I do, I also presume you need to be authenticated before using it.

Go to (yourwordpresswebsite.com)/wp-json/

It brings up a sort of library of endpoints and how to use them

If you go to routes then find "/wp/v2/plugins/(?P<plugin>(^./)+(?:/(^./)+)?)" and endpoints

You can see the following

    0   "GET"
        args    {…}
    1   
        methods 
        0   "POST"
        1   "PUT"
        2   "PATCH"
        args    {…}
    2   
        methods 
        0   "DELETE"

Which you can match up in the REST API docs on plugins

This sort of updating via API should IMO only be done for ease of something like mass-rollout. Say you have a hundred servers running the same core setup and your testing has concluded it’s safe.

You can also just set up WordPress to update itself automatically instead and save yourself the bother.

There are some interesting examples of using composer to install / update WordPress. Look at johnpbloch, satispress. Also off the shelf Wordfence Central

url rewrite – Execute custom php file outside /pub folder in Magento2 Nginx

I would like to execute a custom php file (required for a validation and scan) on our Magento2 installation. The file however should remain and be located in the main /var/www/html/ folder and not in the /var/www/html/pub/ folder.

I have tried the following in my main vhost configuration but still getting a 404

    location /mycustomfile.php {
        try_files $uri $uri/;
        location ~* .php$ {
        fastcgi_pass fastcgi_backend;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
        }
    }

Also I have seen to “whitelist” the file in /var/www/html/nginx.conf.sample under:

    # PHP entry point for main application
    location ~ 
  
    (index|get|static|report|404|503|health_check|mycustomfile).php$ {

Some expert help would be greatly appreciated, thank you!

EDIT:

Okay I figured it out:

    location /mycustomfile.php {
        try_files $uri $uri/;
        root /var/www/html;
        location ~* .php$ {
        fastcgi_pass fastcgi_backend;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
        }
    }

memory – Can XIP (execute in place) be used for kernel protection?

Starting with kernel 5.13 RiscV will get XIP where parts of the kernel run from non volatile memory like flash. In theory you could make parts of the kernel really read only either from the hardware side by storing on a write protected chip or a bit limited write protection via the hypervisor when run in a VM. Will this be useful to thwart any memory related attacks? And can this be extended to other binaries?

https://www.phoronix.com/scan.php?page=news_item&px=RISC-V-XIP-For-Linux-5.13

https://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git/commit/?h=for-next&id=06c7c914de26c5a4f1418fd54e4dfd0be4215de6

java – Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.4.3:run (default-cli)

Estou com o seguinte erro no desenvolvimento de uma aplicação utilizando as seguintes ferramentas:

Quando executo mvn spring-boot:run, apresenta o erro
Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.4.3:run (default-cli) on project HeroesAPI

  1. Spring Boot
  2. Maven 2.4.3
  3. Swagger
  4. DynamoDB
  5. WebFlux
  6. Lombok,SLF4J

Abaixo é meu arquivo pom.xml com todas as dependências baixadas

4.0.0

org.springframework.boot
spring-boot-starter-parent
2.4.3

com.digitalinnovationheroes
HeroesAPI
0.0.1-SNAPSHOT
HeroesAPI
API de armazenamento de heróis com webflux

<java.version>1.8</java.version>

org.springframework.boot
spring-boot-starter-rsocket

org.springframework.boot
spring-boot-starter-security

org.springframework.boot
spring-boot-starter-webflux

org.springframework.security
spring-security-messaging

org.springframework.security
spring-security-rsocket

    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>io.projectreactor</groupId>
        <artifactId>reactor-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springdoc</groupId>
        <artifactId>springdoc-openapi-webflux-ui</artifactId>
        <version>1.2.32</version>
    </dependency>
    <dependency>
        <groupId>com.github.derjust</groupId>
        <artifactId>spring-data-dynamodb</artifactId>
        <version>5.0.4</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.13</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>software.amazon.awssdk</groupId>
        <artifactId>dynamodb</artifactId>
        <version>2.0.0-preview-9</version>
    </dependency>
</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <mainClass>HeroesApiApplication</mainClass>
                <excludes>
                    <exclude>
                        <groupId>org.projectlombok</groupId>
                        <artifactId>lombok</artifactId>
                    </exclude>
                </excludes>
            </configuration>
        </plugin>
    </plugins>
</build>