What if you wanted to delete a message for everyone, but accidentally pressed delete for me

Is there any way to bring that message back?

macos – MBP 2019 automatically turning on when a key is pressed

So basically what happens on my MBP 2019 is that after I turn it off and I press a key, it automatically turns on (when I say turn off I mean shut down). So basically after I accidentally press a key or touch the trackpad, it turns on when I don’t really want it to, which annoys me.

Is there a way to prevent this feature? Because this feature keeps making me consider why they added a button feature to the touch id sensor.

Does Ubuntu 18.04LTS suddenly restart once the update app is pressed?

Ubuntu 18.04LTS, suddenly restarted once the update app was pressed?

It is an AMD Ryzen 5 2600 CPU, with Gigabyte AB350M-Gaming 3 motherboard with the latest BIOS installed.

I tried to update it to 20.04LTS, but I only had the option to update to 19.10, I saw Ubuntu 20.04 Update Guide: Could there be a corrupt update when I tried to update the machine a few days ago, but it didn't say at the time that there were errors?

Is it your way to see if there is a bug in the syslog or other diagnostic tools built into Ubuntu 18.04?

Thank you

plugins: how can I change the content of the page forever once a button is pressed?

I am creating a verification website that uses QR codes that once scanned show a page that says the product is genuine.

I want to add a "claim list" button at the bottom of the page that will display a "successful claim from this list" page.

Issue: After the listing has been claimed, I want the same QR code to display a page that says "This listing has already been claimed."

I've been shaking my brain for hours, trying to figure out the easiest method to accomplish this, but I'm constantly hitting walls, any help would be greatly appreciated!

Thanks friends,
Dan

Boot: Ubuntu does not shutdown hardware when shutdown option is pressed

When I want to click the shutdown button in the GUI in ubuntu, it doesn't shutdown.


My computer is Acer Es1-533

Information for my software:
Linux igor-Aspire-ES1-533 5.3.0-46-generic # 38 ~ 18.04.1-Ubuntu SMP Tuesday, March 31 04:17:56 UTC 2020 x86_64 x86_64 x86_64 GNU / Linux

Ubuntu Desktop 18.04.4 LTS is running


ADDITIONAL EXPLANATION

I've tried all the solutions on the internet, and I couldn't turn it off properly without holding down the power button for 5 seconds to manually turn it off.

I removed "silent splash" in / etc / default / grub, in "GRUB_CMDLINE_LINUX_DEFAULT", and so I can see what the system does when shutting it down.

And the software shuts down fine, but when the last step to turn off the hardware comes because it is done by turning off the software, it stops and the fan and screen connections remain frozen, I need to press the 5 ec power button to manually turn off .

The message it says when you try to close is:
(422.708302) restart: shutdown
_ _

And that's it, the cursor is not moving, and the fan is spinning, the screen is still on and I need to manually turn it off.

When I tried emergency shutdown like in this answer

https://askubuntu.com/a/1015420/1063735

You turned off the mouse, which means the software is off, but the screen was still running, the screen froze with content (open programs I used when performing the emergency shutdown), and the fans were spinning.

I tried all the solutions, I don't know what to do.

Is it because ubuntu doesn't know how to shutdown this laptop properly?

Can you help me? I really want this to work.


And also to mention about this Acer laptop, that I had a problem with installing ubuntu at first, but I solved it with this answer

https://askubuntu.com/a/876153/1063735

I really didn't know what the problem was, but at installation I was always stuck on "install grub2"
but I think "grub2" is for something like the bootloader, efi, I don't know, something necessary for Linux to boot.
this is a problem?
in that tutorial, you changed some file systems, so it could run or install properly, or maybe it didn't even install that grub2.

Whatever the problem is, can anyone help me fix this?

Keyboard: When pressed, the F7 key performs a strange "opening action". How to find which "action" the F7 key is assigned to?

When I press the F7 key, "something" opens. Apparently, there is some "action" assigned to the F7 key. The problem is, I have no idea what "action / program" it is assigned to. Is there a way to find what happens "in the background" when a certain "hotkey" is pressed?

javascript – Exit the application when the Java Script button is pressed?

I write a java script that starts the game when the start button is pressed and pauses the game when the stop button is pressed. I need to quit the game instead of pausing it. Where should I change my code? to exit the game or the web application.

This is my java script code:

var notes = ();
var gameStarted = false;
var Score = 0;

// ==== CLASS FOR ARROWS ==== //

// 1. Direction of arrows
// 2. jQuery img that links to direction bottom
// 3. Destroy when it arrow gets to the 
// 4. Explode when arrow gets to the bottom

// Class Arrow
function Arrow(direction) {
  // CSS spacings for the arrows //
  var xPos = null;

  switch (direction) {
    case "left":
      xPos = "350px";
      break;
    case "up":
      xPos = "420px";
      break;
    case "down":
      xPos = "490px";
      break;
    case "right":
      xPos = "560px";
      break;
  }

  this.direction = direction;
  this.image = $("");
  this.image.css({
    position: "absolute",
    top: "0px",
    left: xPos
  });
  $('.stage').append(this.image);

} // ends CLASS Arrow

// To enable animating the arrows
Arrow.prototype.step = function() {
  // Controls the speed of the arrows
  this.image.css("top", "+=4px");
};

// Deletes arrows when they get to bottom of page
Arrow.prototype.destroy = function() {
  // removes the image of the DOM
  this.image.remove();
  // Removes the note/arrow from memory/array
  notes.splice(0, 1);
};

// Explodes arrow when hit
Arrow.prototype.explode = function() {
  this.image.remove();
};



// For random arrows
var randNum = 0;

// Frame increasing
var frame = 0;

// Determines the speed of notes
var arrowSpawnRate = 40;


// Random generator for arrows
function randomGen() {
  // Randomizes between 1 and 4
  randNum = Math.floor(Math.random() * 4) + 1;
  if (randNum === 1) {
    notes.push(new Arrow("left"));
  }
  if (randNum === 2) {
    notes.push(new Arrow("right"));
  }
  if (randNum === 3) {
    notes.push(new Arrow("up"));
  }
  if (randNum === 4) {
    notes.push(new Arrow("down"));
  }
} // ends randomGen()

// Render function //
function render() {
  if (frame++ % arrowSpawnRate === 0) {
    randomGen();
  }

  // Animate arrows showering down //
  for (var i = notes.length - 1; i >= 0; i--) {
    notes(i).step();
    // Check for cleanup
    if (notes(i).image.position().top > 615) {
      notes(i).destroy();
    }
  }
} // ends render()

// jQuery to animate arrows //
$(document).ready(function() {
  // shim layer with setTimeout fallback
  window.requestAnimFrame = (function() {
    return window.requestAnimationFrame ||
      window.webkitRequestAnimationFrame ||
      window.mozRequestAnimationFrame ||
      function(callback) {
        window.setTimeout(callback, 40 / 75);
      };
  })();

  /*  place the rAF *before* the render() 
      to assure as close to 60fps with the 
      setTimeout fallback.                    */

  // Infinte loop for game play
  (function animloop() {
    if (gameStarted) {
      requestAnimFrame(animloop);
      render();
    } else {

      window.setTimeout(animloop, 1000);

          // check the state per second
    }
  })(); // ends (function animloop() )
}); // ends $(doc).ready



// Listening for when the key is pressed
$(document).keydown(function(event) {
  for (var i = 0; i < notes.length; i++) {
    if (event.keyCode == 37 && notes(i).direction == "left") {
      if (notes(i).image.position().top > 490 && notes(i).image.position().top < 730) {
        console.log("LEFT! " + notes(i).explode());
        Score++;
        score();
      }
    }
    if (event.keyCode == 38 && notes(i).direction == "up") {
      if (notes(i).image.position().top > 490 && notes(i).image.position().top < 730) {
        console.log("UP! " + notes(i).explode());
        Score++;
        score();
      }
    }
    if (event.keyCode == 40 && notes(i).direction == "down") {
      if (notes(i).image.position().top > 490 && notes(i).image.position().top < 730) {
        console.log("DOWN! " + notes(i).explode());
        Score++;
        score();
      }
    }
    if (event.keyCode == 39 && notes(i).direction == "right") {
      if (notes(i).image.position().top > 490 && notes(i).image.position().top < 730) {
        console.log("RIGHT! " + notes(i).explode());
        Score++;
        score();
      }
    }
  } // ends loop
}); // ends $(doc).keyup


function score() {
  document.querySelector(".Points").textContent = Score;
}

The problem is in this code snippet, pause the game at function animloop()

else {  
      window.setTimeout(animloop, 1000);
    }

Can I enable Alt + Tab when a key is pressed?

I need to have the ability to enable and disable Alt + Tab. Is there any way to do it through AHK? I know how to disable it, but reversing that is not possible, I think.

linux – Run script when the power button is pressed

When I press the power button, I want to run a script. For the sake of this scenario, say file.sh. So, when I press the power button, I want to run file.sh and just file.sh.

Most of the solutions I found involved editing /etc/acpi/powerbtn.sh, but that file does not exist on my system. (I am running Ubuntu 19.04) I tried to create it and complete it with the standard content, but it didn't work. I also tried to hear the keystrokes with acpi_listen, but nothing happened when I pressed the keys, so I don't know if I did it wrong or what. I tried to use xev, which captured key events but nothing was recorded when I pressed the power button.

Does anyone know how to achieve this or what am I doing wrong?

PS I should mention that I would prefer a solution that can be done on the command line, ideally without third-party software. Thank you.


Similar question, but without solutions:

https://askubuntu.com/questions/473693/run-a-script-when-power-button-is-pushed

Basically looking for the Linux equivalent of what they did here:

https://stackoverflow.com/questions/12434863/executing-a-batch-script-on-windows-shutdown

command line – Execute script when the power button is pressed

Similar question, but without solutions:

Run a script when the power button is pressed

When I press the power button, I want to run a script. For the sake of this scenario, say file.sh. So, when I press the power button, I want to run file.sh and just file.sh.

Most of the solutions I found involved the edition of /etc/acpi/powerbtn.sh, but that file does not exist on my system. (I'm running Ubuntu 19.04) I also tried to hear the keystrokes with acpi_listen, but nothing happened when I pressed the keys, so I don't know if I did it wrong or what.

Does anyone know how to achieve this or what am I doing wrong?

PS I must mention that I want a solution that can be done on the command line, without any third-party software. Thank you.