18.04 – LivePatch fails with error "Patches can not be applied: Update can not be applied: finitModule system call can not be executed: required key not available"

I ran Canonical-LivePatch, but it shows the following error messages. First it tried to update with the error Patches can not be applied: Update can not be applied: finitModule syscall can not be executed: required key not available, After this error, the refresh will be denied.

What could be the problem with installing the update? I could not find anything about this error message.

I am using Ubuntu 18.04.2 LTS.

$ journalctl -t Canonical-LivePatch
[...]
June 17 23:11:24 callisto canonical-livepatch[1183]: Client.Check
June 17 23:11:24 callisto canonical-livepatch[1183]: Verify with LivePatch service.
June 17 23:11:24 callisto canonical-livepatch[1183]: Update of the last test
June 17 23:11:24 callisto canonical-livepatch[1183]: last test touched
June 17 23:11:24 callisto canonical-livepatch[1183]: Applying the Update 52.3 for 4.15.0-51.55-generic
June 17 23:11:24 callisto canonical-livepatch[1183]: during update: Patches can not be applied: update can not be applied: finitModule system call can not be executed: required key not available
June 18th 00:11:24 callisto canonical-livepatch[1183]: Client.Check
June 18th 00:11:24 callisto canonical-livepatch[1183]: Verify with LivePatch service.
June 18th 00:11:24 callisto canonical-livepatch[1183]: Update of the last test
June 18th 00:11:24 callisto canonical-livepatch[1183]: last test touched
June 18th 00:11:24 callisto canonical-livepatch[1183]: Currently there are no updates available.
June 18th 00:11:24 callisto canonical-livepatch[1183]: The module may have caused a kernel crash! Module is not used.
June 18th 00:11:24 callisto canonical-livepatch[1183]: To override this warning, remove /var/snap/canonical-livepatch/common/locks/livepatch_Ubuntu_4_15_0_51_55_generic_52_52.3
June 18th 00:11:24 callisto canonical-livepatch[1183]: During the update: Patches can not be applied: The lock file "/var/snap/canonical-livepatch/common/locks/livepatch_Ubuntu_4_15_0_51_55_generic_52_52.3" already exists

installation – clone project: script could not be executed

I just cloned an empty Drupal 8 project locally, first I called up and used the webfolder

PHP Localhost: 8000

With this virtualization, a 404 error occurs every time I enter the root edit rule.
To solve the problem, I created a vhost configuration:





Server name www.site.lcl
DocumentRoot / home / users / projects / platform / website / app / web
 
   Allowoverride all
Allow order, reject
Allow of all
Need all granted
 

With this configuration, the routes are displayed correctly, but a new error occurs. All CSS and JS files are not loaded on all pages, and this error occurs on the console:

It was rejected, a script from & # 39; http: //www.site.lcl/' because its MIME type (& # 39; text / html & # 39;) is not executable and strict MIME-type validation is enabled.

I tried to edit the php.ini file as follows: default_mimetype = "", restart Apache and clear the cache, but no result.

In both installations, the php.ini file used is the same.

How can I solve this?

Javascript – The same function is executed several times with a different parameter

I want to perform the function Add article() for every article. Several items belong to the same slot (category). For each category I have to execute the function with the same slot. I do not want to manually write down the slot for each item, and I want to keep it readable.

let equipment = {
Head: {},
Cape: {},
Neck: {},
Ammunition: {},
Weapon: {},
Body: {},
Sign: {},
Legs: {},
Hand: {},
Feet: {},
Ring: {}
};

Function createShortName (name) {
return name.toLowerCase (). replace (/  s / g, & # 39; & # 39;);
}

function addItem (slot, name, cost, image, income = 0, atk_bonus = 0, str_bonus = 0, def_bonus = 0, rngd_bonus = 0, mage_bonus = 0) {

let newItem = {
Slot: slot,
Name Name,
Cost costs,
img: img,
Income: income,
atk_bonus: atk_bonus,
str_bonus: str_bonus,
def_bonus: def_bonus,
rngd_bonus: rngd_bonus,
mage_bonus: mage_bonus
}

equipment[slot][createShortName(name)]    = newItem;
}

let currentSlot = & # 39; head & # 39 ;;
addItem (currentSlot, # head_item_1 #, 100, # img #);
addItem (currentSlot, # head_item_2 #, 200, # img #);

currentSlot = & 39; cape & # 39 ;;
addItem (currentSlot, & 39; cape_item_1 & # 39;, 100, & gt; img & # 39;);
addItem (currentSlot, & 39; cape_item_2 & nb ;, 200, & gt; img & nbsp;);

currentSlot = & # 39; neck & # 39 ;;
addItem (currentSlot, & # 39; neck_item_1 & # 39 ;, 100, & gt; img & # 39;);
addItem (currentSlot, neck neck_item_2 #, 200, im img));

// etc. etc. etc.

As you can see, I add items to it equipment Object at the bottom of the code. Is there a better approach?

Validation – Is it wrong to save events with the status "Invalid operation" in an event store when Event Sourcing is executed?

I have a simple toy project dealing with banking (cash deposit, withdrawal, transfer, opening and closing of accounts).

I'm wondering if something is wrong when saving invalid operations.

Suppose the command sent to the event sourcing system is faulty. For example, the cash withdrawal account does not have enough funds or the account ID is incorrect / does not exist.

The result of a validation is stored in the event log as well as in some way Invalid operation tried?

My point is that we can imagine that these events can have a business value (can create and count a projection, how many invalid operations have occurred and what not), so that they can be stored and not just part of the log?

html – Why can the class be intercepted by the javascript, even if it is executed afterwards, the id not?

I have done some tests with JavaScript and have encountered an interesting "phenomenon", but could not find a good explanation for my searches on the internet.

Here is the code:



    
        
        document
        
    
    
        

title

Paragraph 1

Paragraph 2

Paragraph 3

When you try to pay the paragraph (

) with the id = "dot" and the following javascript.

let p1 = document.getElementById ("dot")
console.log (p1);

We did not achieve that, the final result will be zero because Javascript is loaded before the paragraph is created (

) with id = "dot", because in this case Javascript is loaded in the head and the paragraph in the body

NOTE: I know how to solve this by using certain functions like window.onload or DOMContentLoaded, but that's not the case right now!

The question here, why we could not get the ID, but we managed to get the class.

Yes, if you use the code .:

let para = document.getElementsByClassName ("Paragraph")
console.log (to)

The javascript returns the class, even if it was called before, ie when the javascript was executed, the class did not exist exactly like the id. So how can Javascript return the class?

That's my doubt.

OBS: I'm new to this sand and started learning programming for three months. Forgive me if the questions are a kind of beast.

sublimetext – How is the Python Launcher icon removed each time a script is executed?

If you use Sublime Text 2 or Atom (and possibly other editors) and run a simple plot script in Python, the Python Launcher icon (the rocket) will be displayed every time I execute the code image) and I need it close individually. Is there a configuration to avoid this behavior?

Edit: For Sublime Text, for example, cmd-B is the default link that I use to run a script. I did not find this problem in the documentation for Atom or ST (not in stackexchange either).

8 – How can you find out in which module your code is executed?

I often face the problem of having module metadata (such as the relative path), and in the standard Drupal way, I am forced to hard-code the module name as follows:

 Drupal :: moduleHandler () -> getModule (& # 39; my_module & # 39;) -> ...

Is there any official way or workaround to recognize anywhere in your code (not just .module) which module you're in (if it's even a module)?