google search console – Create Dynamic rss.xml file in progressive web app

I have a progressive web app in angular-8 and whole project is based on MEAN stack and deployed over google cloud platform instance.

Code is built and it’s dist is deployed on that instance.

I have applied for google news and it is approved. To show new stories in the google news rss.xml file should be updated with that new article’s details.

But problem is that when rss.xml is live within angular project and running on server how can I update that file with new article’s details?

Please help.

how can put executable code in mp4 and pdf file?

The field that you’re nibbling at is called Digital Rights Management (DRM), and it’s a big field. Protecting your documents and music, for example, fall under Content Restrictions.

There are significant shortcomings to applying DRM, some of which are:

  • It may make it harder for legitimate readers to access your content
  • It may break or end-of-life and leave your content unreadable
  • It may be possible for attackers to bypass DRM and access your content

As an example, if you Google “mp4 drm” almost all the top hits have to do with bypassing the protections, not with enforcing them.

In short, it’s a hard problem with many bad solutions and a smaller number of usable ones. For these reasons, and because of the ethical implications of restricting content owner’s rights, some people have rebranded DRM as “Digital Restrictions Management.”

In summary:

  1. What you want is hard to do. It’s not as simple as “putting executable code in mp4 and pd4 file”
  2. Solutions exist, but may be limited in usability

storage – Problem with camera concerning file names und photos app

Short version:

How can the camera app be brought to save pictures again with the regular format “IMG_2021….jpg”? On my Nokia 7.2 this is not the case anymore (see picture).

Screenshot of Windows file explorer

Long version / additional explanations:

Before I bought my Nokia 7.2, I used the SD card already in a Samsung Galaxy Note und hatte and had stored on it (among other) several pictures. For the new pictures, a new folder was automatically created and the old pictures remained saved.

Sometime, an additional folder was automatically created without that I had anything to do with it, maybe due to an update. After that there were three subfolders in DCIM, both on the device and on the SD card:

  • 100ANDRO (probably from Galaxy Note, but I’m not sure anymore)
  • Kamera
  • Camera
    From then on, the pictures got stored in the folder “Camera”. Until that point, everything was allright.

At the end of last year I noticed that new pictures don’t get stored anymore with the regular format “IMG_2020….jpg” but instead with an unlogical file name, see screenshot of Windows file explorer. Only newly created videos still get stored with with the regular format.

A few days ahaid of that, the following had happend:
The “Fotos” app from Google suddenly claimed that there was no access to delete pictures (which had always worked before) and that I should use the gallery app for that. Therefore I installed Google Gallery and for comparison one or two additional gallery apps. I then could delete pictures directly again and didn’t have to switch to the “Files” app or another one.

When I realised the new file naming of the pictures I first thought, it might have something to do with the installation of the gallery apps and I removed them again. However, that had no effect.

My next attempt has probably caused a subsequent problem, but didn’t solve the original issue: In the system settings I deleted the cache and data of the apps “Kamera” (Google Camera) and “Fotos” (Google Photos). Since then, new pictures are still stored with the ‘wrong’ file name.
On the other hand, I noticed – just a few days later – that many old pictures are missing. The folders “100ANDRO” are both empty, both on the device and the SD card. At least the folder on the SD card had contained several pictures before. The two “Kamera” folders have vanished with the containing pictures. From all the created pictures I don’t have anymore those from about 1 1/2 years.

I find it disturbing that pictures made with the camera are removed when deleting the data of any app. From my point of view, the folder DCIM does not belong to any app at all, as opposed to f. ex. the folder WhatsAppImages in WhatsApp > Media. Anyhow, I probably have to live with that; a restore of the deleted pictures is rather time consuming and/or expensive.

But how can the Google Camera app be brought to store the pictures again with the regular format “IMG_2021….jpg”?

Thanks for your help or any tipps.

By the way, why does the Camera app frequently change the storage folder from sd card to device? (If I’m not mistaken, this didn’t only happen after installing updates.)

logrotate – can I rotate log based on file creation time?

I have logrotate config like this:

/var/log/example*.log {
    weekly
    rotate 1
    missingok
    notifempty
    compress
}

Some of the example*.log files have existed for quite long time more than few months. I want to compress them with logrotate. But the config is newly added, thus it will only start to rotate them after another week.

rotating pattern: /var/log/example*.log  weekly (1 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/example-a.log
Creating new state
  Now: 2021-01-23 10:07
  Last rotated at 2021-01-23 10:00
  log does not need rotating (log has been already rotated)
considering log /var/log/example-b.log
Creating new state
  Now: 2021-01-23 10:07
  Last rotated at 2021-01-23 10:00
  log does not need rotating (log has been already rotated)
considering log /var/log/example-c.log
Creating new state
  Now: 2021-01-23 10:07
  Last rotated at 2021-01-23 10:00
  log does not need rotating (log has been already rotated)

I wonder is there a way to let the logrotate rotate files based on the creation time or mtime, when it is too old then compress them.

Another problem is the files matching wild card are all rotated together. No matter if the log file is newly created or not. I checked the /var/lib/logrotate/logrotate.status It seems like example*.log is treated as whole. That means all files match this pattern will be rotated at same day. For example: a new log file example-d.log has been added after 6 days of last rotation. Then it will be rotated the next day after it created. But I would like the newly added log example-d.log to rotate after 1 week. Is there any other tool can rotate logs like what I want?

AppleScript: How to add text in a text file at a specific location

I want to add some tags in text files save as with .xml extension. The input.txt is like this:

Purolator Edmonton

607431612227

And the output.xml should be like this:

<tags>
    <tag1>Purolator Edmonton</tag1>
    <tag2>607431612227</tag2>
</tags>

c# – Loading external file data into Scriptable Object in Unity

I’ve been at this for two long days, trying to figure out a way to handle saving and loading data for a mobile puzzle game I’m working on. The game has level packs and each level pack has multiple levels. Level packs can be purchased via IAP.

I need access to the fixed data and an easy way to add new data, so I used Scriptable Objects to store my Level Pack and Level data:

LevelPack

  • id
  • type (paid, free)
  • IAPproductId
  • levels (list of levels)

Level

  • id
  • totalTime (total time to solve puzzle)
  • warningTime (give a warning during level)
  • levels (list of levels)

I also need to store the following dynamic data, which can change during runtime:

  • completedTime for each level
  • isPurchased for each level pack

I tried adding these to the scriptable objects and it’s really easy to maintain and work with. But I can’t figure out a way to persist that data between sessions or game updates.

I created a save system that saves just the completed levels to an external file using binary formatter. So every time a level is completed, I change Level.completedTime to the new time on the scriptable object, then do GameState.Instance.UpdateLevelProgress(levelPack.id, levelId, time); to save the file that contains a dictionary with all the completed times.

 public void UpdateLevelProgress(int levelPackId, int levelId, float time)
     {
         if (!levelProgress.ContainsKey(levelPackId))
         {
             levelProgress.Add(levelPackId, new Dictionary<int, float>());
         }
 
         // set time
         levelProgress(levelPackId)(levelId) = time;
 
         // save to file
         SaveGame();
     }

Even though I figured out how to save, I don’t know how to load the data from the file into each Level scriptable object. There is an onEnable function for ScriptableObject, but that runs way before my GameState.LoadGame() function that runs inside a preload scene. So GameState.Instance.levelProgress is empty at that point.

Is there a better, cleaner way to do this?

PS:

Here’s my GameState file:

using UnityEngine;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;

(System.Serializable)
public class GameStateData
{
    public Dictionary<int, Dictionary<int, float>> levelProgress;

    public GameStateData(GameState gameState)
    {
        levelProgress = gameState.levelProgress;
    }
}

public class GameState : Singleton<GameState>
{
      

    // Prevent non-singleton constructor use
    protected GameState() {  }

    // declare variables
    public Dictionary<int, Dictionary<int, float>> levelProgress = new Dictionary<int, Dictionary<int, float>>();



    #region Load / Save Methods
    public void LoadGame()
    {

        string path = Path.Combine(Application.persistentDataPath, "game.save");

        if (File.Exists(path))
        {
            BinaryFormatter formatter = new BinaryFormatter();
            FileStream stream = new FileStream(path, FileMode.Open);

            GameStateData data = formatter.Deserialize(stream) as GameStateData;
            stream.Close();

            // overwrite current data with loaded data
            levelProgress = data.levelProgress;
        }
    }

    public void SaveGame()
    {
        BinaryFormatter formatter = new BinaryFormatter();

        string path = Path.Combine(Application.persistentDataPath, "game.save");
        FileStream stream = new FileStream(path, FileMode.Create);

        GameStateData data = new GameStateData(this);

        formatter.Serialize(stream, data);
        stream.Close();
    }
    #endregion

    public void UpdateLevelProgress(int levelPackId, int levelId, float time)
    {
        if (!levelProgress.ContainsKey(levelPackId))
        {
            levelProgress.Add(levelPackId, new Dictionary<int, float>());
        }

        // set time
        levelProgress(levelPackId)(levelId) = time;

        // save to file
        SaveGame();
    }

}

```

linux – How would I rsync from SRC to DEST, verify the DEST file, then delete the SRC file? (rcursively)

I have two directories in a bash script held by these two variables

$SRC

$DEST


How would I do a rsync

  1. copying files from $SRC/ to $DEST/,
  2. Verifying that the $DEST/* files match the $SRC/ files (best match available , however slow)
  3. and then delete the $SRC/ file?

Everything I google gives an example of doing an rsync and then deleting the DEST file.

I do not understand this, why would do an rsync to a destination directory, and then delete it?

do a google search and see what I mean.

mysql – Importing an SQL File in to a Service-Based Database (using Visual Studio 2019)

I got an SQL File, when I run XAMP/ PHPMyAdmin I am simply able to import the .SQL file and done. But now I got a Windows Form Application with a Service-Based Database attached to it but there seems to be no option to import the database. Is there something that I am missing? Or do I need additional software / a other type of database to perform this action. (The SQL file contains both the structure and values)

It’s for testing purposes.

title – Showing file directory on Sharepoint

I’m just starting to learn how to use Sharepoint. I don’t have a background in IT and am not very sure of the correct terms to use to use so do please bear with me as I try to explain.

I understand that SharePoint uses the root folder name as part of the url. After creation of the root folder, we can change SharePoint library title where by doing so, does not change its internal name (which is the root folder name).

In my SharePoint site, I have a few document libraries which have been assigned internal names and I renamed the title for each one of them. I’d like to facilitate navigation on Sharepoint by showing the directory. Is it possible to display on Sharepoint, a directory that is in some form of Tree/branching format, but reflect the title of the document library, instead of the root folder name?

get custom file URL wordpress

Let’s say I have a some Files with the name,

  1. $Step-1 => sample_page_1.php
  2. $Step-2 => sample_page_2.php

I can do this:

 <a class="top-progress-bar-stepper"  href="http://132.176.22.165:4337/exm/Step-1/#">
       <span class="bar-label">Drawings</span>
 </a>
 <a class="top-progress-bar-stepper"  href="http://132.176.22.165:4337/exm/Step-2/#">
       <span class="bar-label">Upload</span>
 </a>

Any one help me