pg_restore: [archiver] did not find magic string in file header: please check the source URL and ensure it is publicly accessible

I have been trying to push a dump file from my local Postgrel DB (which I uploaded into my Google Drive and is accessible to public) into my Heroku remote DB with the following URL:

heroku pg:backups:restore '' DATABASE_URL 

I am already logged in into my Heroku app from the terminal on which I run the command. but I got the same error twice. I have been searching online and found threads such as pg_restore: [archiver] did not find magic string in file header but I could not help link between the two, since I am very new two Postgrel. I Hope you guys point me out towards the issues. Very much appreciated.

Starting restore of to postgresql-symmetrical-52186... done  Stop a running restore with heroku pg:backups:cancel.  Restoring... ! ▸    An error occurred and the backup did not finish. ▸     ▸    waiting for restore to complete ▸    pg_restore finished with errors ▸    waiting for download to complete ▸    download finished with errors ▸    please check the source URL and ensure it is publicly accessible ▸    Run heroku pg:backups:info r002 for more details.   === Backup r002 Database:         BACKUP Started at:       2019-09-14 21:14:26 +0000 Finished at:      2019-09-14 21:14:27 +0000 Status:           Failed Type:             Manual Backup Size:      0.00B (0% compression)  === Backup Logs 2019-09-14 21:14:27 +0000 pg_restore: [archiver] did not find magic string in file header 2019-09-14 21:14:27 +0000 waiting for restore to complete 2019-09-14 21:14:27 +0000 pg_restore finished with errors 2019-09-14 21:14:27 +0000 waiting for download to complete 2019-09-14 21:14:27 +0000 download finished with errors 2019-09-14 21:14:27 +0000 please check the source URL and ensure it is publicly accessible 

How to ensure web-camera is accessed legitimately?

I’ve recently became baffled as to how often is there an attempt to use a web-camera on my laptop. And I mean – out of the blue, when I had neither an intent nor a context to use it.

How do I know it’s used? Well, I have an AV which has a function “block usages of a device X” (X can be a microphone or a web-camera for instance). And when it does so, the popup shows “oh, look, user, web-camera access is blocked!” Also, to explain what do I mean “I noticed recently”: it’s that I enabled this feature in the AV recently. I suspect all these things were happening even before, but I just didn’t know about them.

Unfortunately, the AV doesn’t provide a way to see what was accessing the camera. And here’s the main problem – it all happens in seemingly “harmless” situations. Examples?

  • I launch a web-browser after restarting a PC – alert, web-camera access
  • I launch Steam? Alert
  • I open a tab in youtube the first time (!?) Alert.

So far, I use tape.

But clearly there should be better ways to do this which allow legitimate usage.

More context:

  • Windows 10 PC (laptop)
  • Kaspersky AV
  • AV doesn’t show any problems (such as viruses)
  • Network monitoring doesn’t show any suspicious traffic

My Questions:

  • Should I even concern myself about these usages?
  • What can I do to absolutely ensure it’s not used without my consent?
  • What kind of information is it possible to leak through this, is it really possible to remotely enable the camera and shoot the user?

CIS (L1) Ensure ‘Devices: Allowed to format and eject removable media’ is set to ‘Administrators and Interactive Users’

I am implementing CIS on Windows 10 1803 and I cannot work out this control.

Description: This policy setting determines who is allowed to format and eject removable NTFS media. You can use this policy setting to prevent unauthorized users from removing data on one computer to access it on another computer on which they have local administrator privileges. The recommended state for this setting is: Administrators and Interactive Users.

Rationale: Users may be able to move data on removable disks to a different computer where they have administrative privileges. The user could then take ownership of any file, grant themselves full control, and view or modify any file. The fact that most removable storage devices will eject media by pressing a mechanical button diminishes the advantage of this policy setting.

For a start, I have never known anyone not be allowed to eject and format removable media (assuming hard disks, usb drives etc).

But I am even less sure on why the control is asking me to set it to ‘Administrators and Interactive Users’ when the default is just ‘Administrators’.

CSC CIS Windows 1803: The recommended state for this setting is: Administrators and Interactive Users. The default value is Administrators only. Administrators and Interactive Users will be able to format and eject removable NTFS media. It is advisable to set Allowed to format and eject removable media to Administrators. Only administrators will be able to eject NTFS-formatted removable media.

Would this setting also upset software that manages USB devices, such as Checkpoint Removable Media Encryption?

How do I ensure my product is correct the first time?

I am working on a product that will not be able to be updated once released. Furthermore, if the product malfunctions, the results may include death, serious bodily harm, or major financial setbacks. Therefore, my code must be correct the first time, as I will not get a second chance.

What techniques are available for this? I already plan on extensive testing, but I know that testing can only demonstrate the presence of bugs, not prove their absence.

How to ensure field is unique using JavaScript

I have two lists:

List A – a workflow tasks list

List B – an employees list containing fields such as employee name (person column), employee number (single line of text), etc.

I have a workflow that assigns tasks to a user on List A. As part of completing the task, the user is required to enter an employee number which is then copied by the workflow to the employee list (List B).

How can I ensure that the employee number entered when the task is completed does not already exist in List B. The same requirement applies to the employee name field which is a person column. How can I ensure that when the user clicks to complete the task, that the data entered does not already exist in the employees list.

I have thought of doing the check on the workflow after the task is completed and then reassign another task if the value already exists, but I think it will be better if the check is done on submit of the task.

I think JavaScript/JQuery/SPservices will be ideal for this scenario but I am still learning these stuff. Will appreciate some help solving this.

Thanks in advance.

How to ensure Chrome remembers open tabs?

For the past couple of weeks, Chrome has been forgetting which tabs I had open in the previous session, and opens with a blank tab.

I’ve been doing some testing, and it appears that Chrome is now treating the WhatsApp, Basecamp, Slack, etc. external Chrome apps as if they were Chrome windows. Since Chrome remembers only the tabs in the last window you close, I must remember to always open Chrome first and close it last. I forget half the time, and lose my pinned tabs, and whatever I was reading.

Any idea how to fix it?

Ensure unicity of a 10 characters alphanumeric String

I have a requirement of developing a service that must generate each day few millions of random and unique alphanumeric String of length 10 (I can’t increase this length, this is a customer prerequisite). Having a ID, the next ID must not be guessable.

I want to be sure that all IDs will be unique because thoses IDs will be later used in a database (not of my own) and will represent the ID of a product, so it MUST be unique. I know that the probability of a collision is low but I want to prevent this.

I have no problem to generate a random String, but I want to ensure that all generated IDs are really unique. I was thinking about using a local SQL database and inserting few millions per day in this database (which will ensure unicity as this ID would be a primary key). I will then pick up those IDs, mark them as “processed” and send them.

To improve insertion performance, I was thinking about having a table for each year (a partition?).

Do you think this is a good solution to ensure unicity? Would you have any other solution, may be better than a SQL database?


Ensure model fits specification

I am trying to write a tiny FIX protocol implementation. The specification states several data types. Here is a screenshot of the int types:

enter image description here

Now I have created a type Length like this:

public class Length  {     [Range(1, int.MaxValue)]     public int Value { get; set; } } 

I would have have expected some kind of exception if a value gets assigned which is out of the defined range. This is not whats happening. I guess I have a wrong understanding of how ValidationAttributes work.

So the question is:

What would be the best way to ensure the property only holds data that fullfills the specification?

This are the solutions I can think of:

  • Using some kind of ‘Guard’ library
  • Add checks to the setter method
  • Run validation after object creation

As you already have realized I am not very firm on this topics. So please bare with me.

How to ensure that my Google accounts sync frequently?

Since I upgraded my S7 to Nougat I notice that the syncing of my google accounts is particularly slow.

If on a computer I create a calendar event, or I send myself an email, I often do not see that as an Inbox notification, or reflected on my Google Calendar widget, until I actually open either app.

I guess (but I am not sure — how about push notifications?) that this is related to the Google Account syncing being too slow, see attached below (“Sync Calendar”, “Sync Gmail” and “Sync Inbox”), taken on 6/20 8:15am.

The things I already tried:

  • I do have continuous internet, tried switching between WiFi and 4G mobile internet, all work. I receive near-real time notifications for e.g. WhatsApp and Slack.
  • In Settings > Apps > Special Access > Optimize battery usage, I added the below to “not optimized”:

    • Calendar
    • Calendar storage
    • Gmail
    • Google Play services
    • Inbox
  • In Settings > Device maintenance > Battery > Unmonitored apps, I added
    • Calendar
    • Inbox

How can I ensure only one instance of a micro-service queries a database and downloads files to shared storage at a time?

I have a micro-service that sends files to clients on request.
It acquires these files by querying a database where other users have saved details of the file.
The micro-service queries the database periodically, if there is a new file(s) it contacts artifactory and downloads the file to a shared storage that all instances of the micro-service use.
How can I ensure that only one instance queries and downloads files at a time?