How to modify hosts file on android?

I want to block certain websites by adding them to hosts file on linux etc/hosts and i’ve managed to do it but on android it doesn’t work.I added this line in system/etc/hosts ”’127.0.0.1 www.example.com”’ and it doesn’t block the website.The phone is rooted.

I also want ot know how to block subpages,something like this:
127.0.0.1 www.example.com/subpage/here

8 – Modify sorting criteria using views_query_alter

I have a view for the content type events with fields event_name, description, summary, event_start_date, etc.
What my requirement is:

  1. Sort the events in ascending order of event_date equal or greater than the current date (upcoming events)
  2. Sort the events in descending order of event_date less than the current date (past events)

NOTE: the upcoming data should come first and then the past data.

enter image description here

enter image description here

Through the normal view UI settings, I couldn’t achieve this. so I tried the views_query_alter hook to modify the sorting criteria. but I couldn’t achieve this. Any help?

/**
 * Implements hook_views_query_alter
 */
function news_t1_views_query_alter(ViewExecutable $view, QueryPluginBase $query) {
  if($view->id() == 'events'){
    $query->orderby(0)('field') = "CASE node__field_st_field_st_value WHEN DATE(node__field_st_field_st_value) >= CURDATE()  END";
    $query->orderby(0)('direction') = "ASC";
    $query->orderby(1)('field') = "CASE node__field_st_field_st_value WHEN DATE(node__field_st_field_st_value) < CURDATE()  END";
    $query->orderby(1)('direction') = "DESC";
    //$view->set_items_per_page(5);  
  }
}

node__field_st is the event_date field name.

linux – Users unable to create files/directories on NFSv3 mount, but can modify

I’ve got two RHEL 6 servers, one is an NFS server (we’ll call it nfs-server, say its IP is 10.1.1.1), and the other is a generic client for all intents and purposes (we’ll call it nfs-client, say its IP is 10.0.0.1).

Both nfs-server and nfs-client are connected to the same centralised authentication system, so UIDs/GIDs are the same for a given user.

nfs-client is mounting an NFSv3 share from nfs-server:/shared_folder/cache to /shared_folder/cache.

The /shared_folder directory on nfs-server is in mode 755, owned by root:root, and the /shared_folder/cache directory is in mode 2775, owned by cache:cache (UID=20014, GID=20004).

I have a set of users who are all members of the cache group in LDAP, but they cannot create or delete anything in the /shared_folder/cache directory itself on nfs-client. However:

  • If a file already exists in /shared_folder/cache that has the correct permissions (writable by group cache), the users can modify the file, but not delete it (e.g. if /shared_folder/cache/testfile exists, and is writable by the cache group, the users can modify the contents of the file, but they cannot delete it)
  • If a subdirectory already exists in /shared_folder/cache that has the correct permissions (mode 2775, owned by cache:cache), the users can modify the directory as normal (e.g. if /shared_folder/cache/testdir/ exists in mode 2775 and owned by the cache group, the users can add/modify/delete files and directories in testdir, but cannot delete testdir itself)
  • If I log in as one of the users on nfs-server, all of a sudden I am able to create/modify/delete files and directories as normal within /shared_folder/cache

How can I fix this NFS mount? Diagnostic info is below the horizontal rule.


The output of id user1 on both nfs-server and nfs-client shows:

uid=8173(<username>) gid=8173(<username>) groups=20004(cache)

nfs-server has the following export configured in /etc/exports:

"/shared_folder/cache"        <nfs-client-IP>(rw)

The output of exportfs -v on nfs-server shows:

/shared_folder/cache
                   <nfs-client-IP>(rw,wdelay,root_squash,no_subtree_check,sec=sys,rw,root_squash,no_all_squash)

ag.algebraic geometry – How to modify the X and Y lengths of a rectangle to equal a target area

Quite simply, I am trying reduce the size of a rectangle in ratio so that is has a certain area. I have a rectangle of area X * Y, I have a target area A, how would I get the multiplier M such that X * M and Y * M equals A

Obviously multiplying X and Y by the ratio between the current and target area will not work, my gut feeling is I will also need the ratio between X and Y.

Sorry for such a simple question, happy to be dup hammered or closed, also sorry for the tag, I am just a bit lost,.

woocommerce offtopic – Product page: add to cart doesn’t work / Cart modify quantity doesn’t work but remove item works

I tried to do debug and also to disable cache plugins and modify nginx configurations but I can’t figure out what happens.

On homepage and shop, ‘add to cart’ works (ajax enabled), but on product page ‘add to cart’ doesn’t work.

On cart page I can’t use – or + to increase or decrease the quantity but the X(delete) works.

I tried to disable ajax on product page but doesn’t work.

Theme: Avada, woocommerce

product page

cart

What if a pool of computers are used to attack a blockchain and modify it in 51% of the network?

I mean if a large computer pool is used to attack a blockchain and modify the copy of the blockchain in 51% of computers in the network.
Then due to consensus, the faulty blockchain will be replicated across the whole network. Thus changing the whole blockchain.

Modify duration of a video with ffmpeg

I have an mp4 video that is 3 minutes long and this is seen in the duration column of Windows explorer and also in video players like VLC.
I want cheat windows explorer and vlc:
Using ffmpeg, is it possible to modify the mp4 file duration metadata to 120 minutes and end after 3 minutes when I play it ?
How would that command be written ?

sharepoint online – Modify the position of application customizer (Breadcrumb) SPFX

Currently Microsoft only supports two placeholders in application customizer:

  • Top Placeholder
  • Bottom Placeholder

Documentation: Use page placeholders from Application Customizer


Workaround:

Instead of using default available placeholders to bind the breadcrumb navigation, you can access the specific DOM elements using selectors (id/class/attribute) & use those to bind the breadcrumb navigation.

Note: DOM manipulation & CSS customizations are not recommended by Microsoft and some of your customization may break if Microsoft changes HTML element id/classes in new release updates.

sharepoint online – Modify a file’s ‘SortBehavior’ field value

In a SharePoint Online Document library I have converted folders to document sets via PowerShell. However, the resulting document sets still have a value of “1” in the hidden and read-only SortBehavior (“Sort Type”) column, which causes them to appear above documents sets that are created from the UI, as they are given the proper value of “0”

I’ve updated the SortBehavior’s ReadOnlyField property to False and it appears that this update was successful.
enter image description here

Despite this, I’m still unable to modify an item’s SortBehavior property and any attempt to do so leads to the following error message:

Invalid data has been used to update the list item. The field you are trying to update may be read only.

Is there any approach that will allow an update to an item’s SortBehavior value in SharePoint Online?

How can we modify the heartbeat synchronization time of the etcd cluster on Kubernetes

I want to modify heartbeat-interval of embedded etcd cluster running on kubernetes, I know while installation we can do with kubeadm extraargs but how to do for running cluster.

Before modifying i want to know current values too.