Given a Google Drive File Link, how do I locate the link of the folder it resides in?

as above. It is just an unlisted folder, without access rights assigned (i.e. anyone can visit if you have the link).

I made a mistake and sent money to a watch only address on dash electrum,I have the password and wallet.dat file

How do I get generate the keyphase?

Unable to upload file to specific SharePoint drive,

I am trying to upload a file to SharePoint drive using graph API. I am doing OAuth using the below-mentioned link:

GET https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0/authorize?client_id={CLIENT_ID}&scope=offline_access myfiles.write&response_type=code&redirect_uri=http://localhost:3000/sharepoint/integrate

After the authentication flow, I am getting both access token and refresh token. Using the access token I am able to fetch the drive list by calling the below-mentioned REST API endpoint:

GET https://graph.microsoft.com/v1.0/sites/root/drives

Headers:
Authorization: bearer {ACCESS_TOKEN}

I am also able to get the list of items present inside a specific drive by calling the below-mentioned REST API endpoint:

GET https://graph.microsoft.com/v1.0/sites/root/drives/{DRIVE_ID}/root/children/

Headers:
Authorization: bearer {ACCESS_TOKEN}

But when I am trying to upload a file to SharePoint drive using the below-mentioned REST API endpoint:

POST https://graph.microsoft.com/v1.0/sites/root/drives/{DRIVE_ID}/root/{FILE_NAME}:/content

Headers:
Authorization: bearer {ACCESS_TOKEN}
Content-Type: application/json;odata=verbose
Content-Length: FILE_SIZE

Data:
File Buffer

I am getting an error from the SharePoint API stating:

{
"error": {
    "code": "BadRequest",
    "message": "Unable to read JSON request payload. Please ensure Content-Type header is set and payload is of valid JSON format.",
    "innerError": {
        "date": "2021-07-26T12:27:31",
        "request-id": "d54e4e48-738b-4a5c-9499-7e8c6f35ced1",
        "client-request-id": "d54e4e48-738b-4a5c-9499-7e8c6f35ced1"
    }
}
}

Can someone tell me what I am doing wrong here. I am unable to figure it out, been stuck on it for a long time.

My code is in Node.JS, any help related to this would be appreciated.

Thank you in advance.

Updates to functions.php file via CPanel not showing in WordPress

I have made changes to my functions.php file through Theme Editor in WordPress and it works as expected but deletes that piece of code a few days later.
So I tried changing the actual functions.php file through CPanel to make it permanent, WordPress wont recognise these changes? Is my code wrong or does it take some time for this to pull through?

Code below;

add_filter( 'mc4wp_integration_contact-form-7_subscriber_data', function(MC4WP_MailChimp_Subscriber $subscriber, $cf7_form_id) {
   if ($cf7_form_id == 2202) {
       $subscriber->tags() = 'Hire';
   } else if ($cf7_form_id == 2304) {
       $subscriber->tags() = 'Equipment';
   } else if ($cf7_form_id == 3729) {
       $subscriber->tags() = 'Parts';
   } else if ($cf7_form_id == 2305) {
       $subscriber->tags() = 'General';
   } else if ($cf7_form_id == 4444) {
       $subscriber->tags() = 'Info Pack';
   } 
   return $subscriber;
}, 10, 2);

magento2 – Is it safe to manually remove entries on the db_schema_whitelist.json file?

I am wondering if it is safe to manually remove entries on the db_schema_whitelist.json file. I created a table called customer_address_relationshipusing the declarative schema approach and then I generated the db_schema_whitelist.json first and ran the php bin/magento setup:upgrade command. The generated db_schema_whitelist.json file had the following entries:

{
    "customer_address_relationship": {
        "column": {
            "entity_id": true,
            "customer_id": true,
            "address_id": true
        },
        "constraint": {
            "PRIMARY": true,
            "CSTR_ADDR_RELATIONSHIP_CSTR_ID_CSTR_ENTT_ENTT_ID": true,
            "CSTR_ADDR_RELATIONSHIP_ADDR_ID_CSTR_ADDR_ENTT_ENTT_ID": true
        }
    }
}

I then later decided to change my approach to the problem at hand and had to drop the customer_address_relationship table (by removing it from db_schema.xml and generating db_schema_whitelist.json again and then running setup:upgrade). The better approach was to add a column instead to an existing table called customer_address_entity after adding the column in my db_schema.xml and generating the db_schema_whitelist.json file the content of the file was now as follows:

{
    "customer_address_relationship": {
        "column": {
            "entity_id": true,
            "customer_id": true,
            "address_id": true
        },
        "constraint": {
            "PRIMARY": true,
            "CSTR_ADDR_RELATIONSHIP_CSTR_ID_CSTR_ENTT_ENTT_ID": true,
            "CSTR_ADDR_RELATIONSHIP_ADDR_ID_CSTR_ADDR_ENTT_ENTT_ID": true
        }
    },
    "customer_address_entity": {
        "column": {
            "address_type": true
        }
    }
}

Since I no longer need the table customer_address_relationship is it safe to alter the generated db_schema_whitelist.json and remove its entries? what is the implication of this if there is any?

command line – Reference all paths in single linux script – like a header file for better portability

Shell Scripting newbie here.

Please bear with me.

Linux 3.0.101-108.87-default x86_64

I have Script1.sh which is referencing folders . I am trying to include all these paths in the script in a single headerscript.sh and then reference the headerscript.sh in Script1.sh

I am doing this right now

Script1.sh
 
setenv SCRIPT  /../site/SCRIPTS
setenv TOP     /../site/TOP
setenv SUB1    /../site/../.../SUB1
setenv SUB2    /../site/../.../SUB2
setenv SUB3    /../site/../.../SUB3
setenv SUB4    /../site/../.../SUB4
setenv SUB5    /../site/../.../SUB5

Instead I want to do something like this

Script1.sh 

include headerscript.sh

and headerscript.sh will look something like this

headerscript.sh

setenv SCRIPT  /../site/SCRIPTS
setenv TOP     /../site/TOP
setenv SUB1    /../site/../.../SUB1
setenv SUB2    /../site/../.../SUB2
setenv SUB3    /../site/../.../SUB3
setenv SUB4    /../site/../.../SUB4
setenv SUB5    /../site/../.../SUB5

This allows me to make the script modular by just including headerscript.sh in another script and easier to debug.

What should I be doing ?

I don’t want to include this in .alias

configuring VNC server: vim ~/.vnc/xstartup command shows ‘ No such file or directory’

I have started learning Linux only a couple of days ago. Tried to install ubuntu desktop in my ubuntu 18.04 EC2 instance, but failed in a stage with this command vim ~/.vnc/xstartup. it says ‘No such file or directory’.

cryptography – Signing a text file using a pfx file in java

I’m very new to java cryptography. I’m trying to use a .pfx file that contains a public key, it’s private key and a digital certificate to sign a text file. I have been able to access the private key and certificates by loading the .pfx file to the java key store. I want to sign the data using the private key in the .pfx file and then append the digital certificate along with it. This snippet is what I wrote to generate a simple raw signature

I want to be able to do the same using the private key and certificate I get from the .pfx file. This is how I've loaded the key and certificate to the Java key store.

I’ve been stuck at this point for quite sometime. Kindly point me in the right direction. Thank you.

How can I import my custom json file

Hi I need to import my json file but only tutorials i’ve found is to import file for a widget or things like that or json file importer but i do not understand It contains books with their titles ISBN etc…, I want to use it using PHP, and I want it to import in my server to use it like in a folder.

html – Must the image url in a sitemap file begin with the same domain the file is stored on?

I remember when making a sitemap, all URLs defined in between <loc> and </loc> must be part of the same domain as the domain the file is stored on. For example, I can use this line in my sitemap…

http://an.example.com/abc.html

…Only if the sitemap is stored on and publicly accessible from the folder mapped to the an.example.com domain.

But that entry above won’t work if the sitemap is stored on a folder representing a different domain such as y.example.com or even domain.com.

My question is, should I use the above thinking when trying to index for Google images? For example, do image URLs defined in <image:loc> and </image:loc> have to contain the same domain as the location of the sitemap file the entries are contained in?

The reason why I ask is because I have two subdomains. Let’s call them t.example.com and i.example.com. T is for text, and I is for images.

My site map for one page currently would look like something as follows:

<url>
<loc>http://t.example.com/page-one.html</loc>
<image:image>
<image:loc>http://i.example.com/image-one</image:loc>
<image:title>Some image</image:title>
</image:image>
</url>

Am I wrong with using a different subdomain to reference the image? Assume the sitemap file is stored and accessed at http://t.example.com/sitemap.xml