sharepoint online – File object created and modified property values vary from ListItemCollection and FileCollection

I noticed some differences in values when calling File obj Created and Modified properties from ListItemCollection and FileCollection. Details below:

Below is some old code that fetched files from folder in FileCollection where I initialize required properties:

using (var spClientContext = new AuthenticationManager().GetACSAppOnlyContext(siteUrl, _clientId, _clientSecret))
{
    if (spClientContext != null)
    {
        List list = spClientContext.Web.Lists.GetByTitle("Documents");
        spClientContext.Load(list);
        spClientContext.Load(list.RootFolder);
        spClientContext.Load(list.RootFolder.Folders);
        spClientContext.ExecuteQuery();
        FolderCollection fcol = list.RootFolder.Folders;

        if (fcol != null)
        {
            foreach (Folder f in fcol)
            {
                if (f.Name.Equals(folderName, StringComparison.InvariantCultureIgnoreCase))
                {
                    spClientContext.Load(f.Files,
                                         items => items.Include(
                                             item => item.Name,
                                             item => item.Author,
                                             item => item.ModifiedBy,
                                             item => item.ListItemAllFields("Created"),
                                             item => item.ListItemAllFields("Modified"),
                                             item => item.ListItemAllFields("FileRef"),
                                             item => item.Length));

                    spClientContext.ExecuteQuery();

                    FileCollection fileCol = f.Files;

                    foreach (File file in fileCol)
                    {
                        // Do Stuff
                    }
                }
            }
        }
    }
}

When I output the File Created and Modified date/time values I get the following:

  • Created: 6/17/2021 11:40:28 PM (Correct Date/Time)
  • Modified: 6/17/2021 11:41:12 PM (Correct Date/Time)

Below is my updated code which collects files in ListItemCollection and initializes File properties:

using (ClientContext spClientContext = new AuthenticationManager().GetACSAppOnlyContext(siteUrl, _clientId, _clientSecret))
{
    if (spClientContext != null)
    {

        CamlQuery camlQuery = new CamlQuery();

        camlQuery.FolderServerRelativeUrl = getSiteUrlAbsolutePath(siteUrl) + "/Shared Documents/" + folderPath;

        camlQuery.ViewXml = "<View Scope="RecursiveAll">" +
            "<Query>" +
            "<Where>" +
            "<Eq><FieldRef Name='FSObjType' /><Value Type='Integer'>0</Value></Eq>" +
            "</Where>" +
            "</Query>" +
            "</View>";

        List list = spClientContext.Web.Lists.GetByTitle("Documents");

        ListItemCollection listItems = list.GetItems(camlQuery);

        spClientContext.Load(listItems,
                             items => items.Include(
                                 item => item.DisplayName,
                                 item => item.FileSystemObjectType,
                                 item => item.File,
                                 item => item.File.Name,
                                 item => item.File.Author,
                                 item => item.File.ModifiedBy,
                                 item => item.File.ListItemAllFields("Created"),
                                 item => item.File.ListItemAllFields("Modified"),
                                 item => item.File.ListItemAllFields("FileRef"),
                                 item => item.File.Length));

        spClientContext.ExecuteQuery();

        if (listItems != null && listItems.Count > 0)
        {
            foreach (ListItem item in listItems)
            {
                if (item.FileSystemObjectType.Equals(FileSystemObjectType.File))
                {
                    // Do Stuff
                }
            }
        }
    }
}   

When I output the File Created and Modified date/time values I get the following:

  • Created: 6/18/2021 6:40:28 AM (Incorrect Date/Time)
  • Modified: 6/18/2021 6:41:12 AM (Incorrect Date/Time)

All the other File properties in the new code appearing to be correct. From what I can tell in the new code Created and Modified are outputting UTC and not recognizing time zone setting in SharePoint site settings? Or am I initializing the File properties in the wrong spot?

Thanks for any feedback and help!

windows 10 – Any way to automatically delete files created in a folder once any file is 30 days old?

I have a temporary folder in Windows 10 where I created files for temporary usage. But it gets messy once there are lot of files. I don’t need files which are like a month old.

So is there any way to make any files in that folder which is 30 days old, gets deleted automatically (not permanently, just move to Recycle Bin)?

I need sharepoint api Url that can help me to change metafileds i.e owner of folder once it got created via api

Looking for SharePoint URL that can be used to do POST operation for changing meta fields such as owner of the folder once folder got created through REST API

Will be waiting for help.

SharePoint documentation link: Working with folders and files with REST

module – Magento 2: Custom Order Date and Shipping Amount in Programmatically created Order

module – Magento 2: Custom Order Date and Shipping Amount in Programmatically created Order – Magento Stack Exchange

dnd 5e – What’s the best way to resolve a paradox created when a mage shapeshifted into a larger creature enters an antimagic field, but its true form doesn’t?

This is based on a situation that’s happening in my current campaign, though the example below is simplified to remove unnecessary context.

The shapechange spell (Player’s Handbook, page 274) only limits the form that its user can change into by Challenge Rating, rather than size.

In the following situation, how, if at all, would shapechange be suppressed?

A level 20 wizard and a level 20 druid stand with 10 feet of space between them (figure 1).

To begin their battle, the druid casts shapechange, transforming into an ancient brass dragon, a Gargantuan creature (figure 2).

To counteract this, the wizard casts antimagic field (Player’s Handbook, page 213) which creates a field of anti-magic in a 10-foot radius sphere around the wizard within

“Spells and other magical effects, except those created by an artifact or a deity, are suppressed in the sphere and can’t protrude into it.”

It seems clear-cut that shapechange is suppressed until the druid exits the antimagic field, and so reverts to its normal, medium form (figure 4).

Now the druid’s smaller, Medium form, is no longer within the antimagic sphere. So it should regain the effects of shapechange, transforming back into an ancient brass dragon—which immediately puts its form back into the antimagic field, repeating the process. If it were another buff spell, such as fire shield (Player’s Handbook, page 242), that doesn’t affect the target’s size, this would be a nonissue. But shapechange, along with enlarge/reduce (Player’s Handbook, page 237), polymorph (Player’s Handbook, page 266), and any other spell that might increase the target’s size run into this issue. enter image description here

dns – Prevent subdomains created for minecraft from directing to the webserver on the machine

When you point a subdomain at an IP address, that subdomain will be available for all protocols. When you point subdomains for Minecraft at this server that hosts both Minecraft and a web server, and HTTP and HTTPS requests for those Minecraft subdomains are going to hit the web server.

One way to prevent the subdomains from hitting the web server would be to host Minecraft and the web server on separate server. Presumably you would not want to use that solution because it would increase your costs significantly.

You could also get a second IP address for your server and configure your Minecraft server and your web server for the two IP addresses. Most web servers have the ability to choose which IP address for a machine they bind to. This would also incur some additional costs. (Extra IP addresses usually have cost with your hosting company.) Multicraft has a setting for which IP address to bind. You would point the Minecraft subdomain to one IP address, the Multicraft web server host name to the other IP address, and ensure that the web server is only bound to the one IP address.

The third solution is configuring virtual hosts. When a web browser connects to a web server at an IP address, it sends the host name it is connecting to. This allows the web server to behave differently for different host names (for example serving separate content for each host name.) In your case, you would use this virtual hosts to serve error pages for all but your one desired subdomain.

Unfortunately I don’t see any settings for virtual hosts in the multicraft settings. You would need to run an additional webserver that supports virtual hosts and use a reverse proxy to forward requests for just one virtual host to the multicraft web server which would run on some non-standard port. It is even possible that multicraft is already running this way. Their howto has references to some Apache configuration. Their security documentation has some additional references to Apache.

In any case you would need to:

  1. Run Apache on ports 80/443
  2. Run the standalone multicraft server on some other port (like 8080).
  3. Configure a default virtual host in Apache that shows an error page (like a 404 not found).
  4. Install and enable mod_proxy (the proxy module for Apache).
  5. Configure a virtual host with the reverse proxy. The Apache configuration would look something like:
<VirtualHost>
   # Because it comes first in the configuration file,
   # this virtual host is the "default" virtual host
   ServerName localhost
   # You would have to create this empty directory, 
   # or choose some other empty directory to use
   ServerRoot C:/xampp/htdocs/empty/
</VirtualHost>

<VirtualHost>
   ServerName multicraft.example.com
   ProxyPass "/" "http://localhost:8080/"
   ProxyPassReverse "/" http://localhost:8080/"
</VirtualHost>

tor – Bitcoin Core Onion Service created unexpectedly

Why is Bitcoin Core onion service created when I have not mentioned anything related in bitcoin.conf?

bitcoin.conf in Windows (data directory):

prune=2048

bitcoin.conf in Fedora (running bitcoind)

prune=2048
datadir=/mnt/hgfs/mainnet

/mnt/hgfs/mainnet -> E:Core-Backupbitcoin-mainnet (Shared folder in VM)

ls /mnt/hgfs/mainnet
anchors.dat   blocks      fee_estimates.dat     peers.dat
banlist.dat   chainstate  mempool.dat           settings.json
bitcoin.conf  debug.log   onion_v3_private_key

Logs:

2021-06-12T01:19:40Z tor: Got service ID 64randomchars, advertising service 64randomchars.onion:8333
2021-06-12T01:19:40Z msghand thread start
2021-06-12T01:19:40Z addcon thread start
2021-06-12T01:19:40Z net thread start
2021-06-12T01:19:40Z AddLocal(64randomchars.onion:8333,4)

dns – Prevent subdomains created for minecraft from directing to the webserver on the machine

When you point a subdomain at an IP address, that subdomain will be available for all protocols. When you point subdomains for Minecraft at this server that hosts both Minecraft and a web server, and HTTP and HTTPS requests for those Minecraft subdomains are going to hit the web server.

One way to prevent the subdomains from hitting the web server would be to host Minecraft and the web server on separate server. Presumably you would not want to use that solution because it would increase your costs significantly.

You could also get a second IP address for your server and configure your Minecraft server and your web server for the two IP addresses. Most web servers have the ability to choose which IP address for a machine they bind to. This would also incur some additional costs. (Extra IP addresses usually have cost with your hosting company.) Multicraft has a setting for which IP address to bind. You would point the Minecraft subdomain to one IP address, the Multicraft web server host name to the other IP address, and ensure that the web server is only bound to the one IP address.

The third solution is configuring virtual hosts. When a web browser connects to a web server at an IP address, it sends the host name it is connecting to. This allows the web server to behave differently for different host names (for example serving separate content for each host name.) In your case, you would use this virtual hosts to serve error pages for all but your one desired subdomain.

Unfortunately I don’t see any settings for virtual hosts in the multicraft settings. You would need to run an additional webserver that supports virtual hosts and use a reverse proxy to forward requests for just one virtual host to the multicraft web server which would run on some non-standard port. It is even possible that multicraft is already running this way. Their howto has references to some Apache configuration. Their security documentation has some additional references to Apache.

In any case you would need to:

  1. Run Apache on ports 80/443
  2. Run the standalone multicraft server on some other port (like 8080).
  3. Configure a default virtual host in Apache that shows an error page (like a 404 not found).
  4. Install and enable mod_proxy (the proxy module for Apache).
  5. Configure a virtual host with the reverse proxy. The Apache configuration would look something like:
<VirtualHost>
   # Because it comes first in the configuration file,
   # this virtual host is the "default" virtual host
   ServerName localhost
   # You would have to create this empty directory, 
   # or choose some other empty directory to use
   ServerRoot C:/xampp/htdocs/empty/
</VirtualHost>

<VirtualHost>
   ServerName multicraft.example.com
   ProxyPass "/" "http://localhost:8080/"
   ProxyPassReverse "/" http://localhost:8080/"
</VirtualHost>

Access new files created by backend service deployed on Heroku through the web?

I have a simple REST backend service. That backend service generates image files of users. Where do I write these files later on them to be accessible through HTTP/S for the clients?

DreamProxies - Cheapest USA Elite Private Proxies 100 Private Proxies 200 Private Proxies 400 Private Proxies 1000 Private Proxies 2000 Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive Proxies-free.com New Proxy Lists Every Day Proxies123