How to set correctly a big title which works on desktop and mobile as well?

I’m working on webpage main title. I want to set a 100% height background image and a big title on the front of it. This is how I did:

In the CSS file:

body, html {   height: 100%; }  .bg {   background-image: url("../img/image.JPG");   height: 100%;    background-position: center;   background-repeat: no-repeat;   background-size: cover;     }  .bigtitle {      /**    padding-left:15%;***/          padding-top: 20%;      color: white;      font-family: 'Trocchi', serif;      font-size: 1500%;      font-weight: normal;      margin: 0;      /*line-height: 1.0em;*/ } 

In HTML file:

<div class="bg">     <center><h1 class="bigtitle">My title</h1></center> </div> 

This is good on the desktop but completely fail on mobile or small screen size. How can do to work on mobile and on desktop as well?

How to correctly install scanner driver for Brother MFC-L2700DW on ubuntu 18.04

I have a all-in one printer/scanner Brother MFC-2700DW I can download and even install the DEB package from the Linux drivers on the producer’s page. However, when i try to scan with simple scan I am getting errors. If i run simple scan as root

sudo simple-scan  

Then it is able to scan. It seems to be an issue with the driver that wrongly assumes the wrong permissions.

To make it cleaner I am trying to install the drivers on a live-usb ubuntu:

ubuntu@ubuntu:~$   lsusb Bus 002 Device 004: ID 04f9:0331 Brother Industries, Ltd  Bus 002 Device 003: ID 1c4f:0034 SiGma Micro  Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 004: ID 05e3:0732 Genesys Logic, Inc. All-in-One Cardreader Bus 001 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003 Device 002: ID 0781:5530 SanDisk Corp. Cruzer Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 

If I run it as non-root I am getting either core dumps or “unable to connect to scanner”. However, if I start it as sudo everything works

Here are the debug logs when i start non-root simple-scan -d

[+6.46s] DEBUG: scanner.vala:341: sane_get_devices () -> SANE_STATUS_GOOD [+6.46s] DEBUG: scanner.vala:353: Device: name="brother4:bus2;dev6" vendor="Brother" model="MFC-L2700DW" type="USB scanner" [+6.56s] DEBUG: app-window.vala:1775: Saving state to /home/ubuntu/.cache/simple-scan/state [+18.04s] DEBUG: app-window.vala:1775: Saving state to /home/ubuntu/.cache/simple-scan/state ... [+24.53s] DEBUG: simple-scan.vala:454: Requesting scan at 300 dpi from device 'brother4:bus2;dev6' [+24.53s] DEBUG: scanner.vala:1569: Scanner.scan ("brother4:bus2;dev6", dpi=300, scan_mode=ScanMode.COLOR, depth=8, type=ScanType.SINGLE, paper_width=0, paper_height=0, brightness=0, contrast=0, delay=10000ms) [+24.53s] DEBUG: scanner.vala:806: Processing request [+24.53s] DEBUG: scanner.vala:867: sane_open ("brother4:bus2;dev6") -> SANE_STATUS_IO_ERROR [+24.53s] WARNING: scanner.vala:871: Unable to get open device: Error during device I/O [+24.63s] DEBUG: app-window.vala:1775: Saving state to /home/ubuntu/.cache/simple-scan/state   ... 

The program error seems to be : sane_open (“brother4:bus2;dev6”) -> SANE_STATUS_IO_ERROR Unable to get open device: Error during device I/O

How to correctly set up AspNet Core 2 authentication behind a load balancer?

I’ve set up AspNet Core 2 authentication successfully, but now would like to get it working behind a load balancer.

Because the load balancer address is different from my app address I’m changing the redirect Uri in my startup.cs ConfigureServices like this…

options.Events.OnRedirectToIdentityProvider = async n =>      {                                 n.ProtocolMessage.RedirectUri = "";         await Task.FromResult(0);      }; 

This works fine and I successfully authenticate and the callback from the identity server calls That is correctly handled and handling OnTokenResponseReceived shows that I successfully recieve the token.

The problem is: it is then making another call to the identity server but this time to the app’s actual (not load balancing) address. When that comes back it gives an error of: AspNetCore.Correlation.OpenIdConnect cookie not found.

So the Fiddler trace looks like this:

302 HTTPS   /account/signin 200 HTTPS /connect/authorize/callback etc... 302 HTTPS   /signin-oidc -- this is where I successfully receive the code, but then: 302 HTTPS     /account/signin 200 HTTPS /connect/authorize/callback etc... 400 HTTPS   /signin-oidc -- this is the 400 cookie not found error 

Why, after successfully authenticating, is it then firing again from the actual address and failing?

Am I correctly interpreting how the Blood Intensity bloodline mutation works?

I just want to make sure I understand Blood Intensity correctly.

The Blood Intensity bloodline mutation says:

Whenever you cast a bloodrager or sorcerer spell that deals damage, you can increase its maximum number of damage dice by an amount equal to your Strength or Charisma modifier, whichever is higher.

So if my Charisma modifier is 5 and I cast Ear-Piercing Scream (1d6 damage) using Blood Intensity, it would now deal 6d6 damage, correct?

Ubuntu only boots correctly one out of four times

I have a Lenovo W530 Thinkpad (with an nVidia k2000 GPU). I recently dual booted Windows 10 and Ubuntu 18.04.

Every time I restart I see the GRUB menu as expected. However, I am only able to boot into Ubuntu one out of about four times. The other 3/4 of the time it just freezes (very annoying).

After pressing enter on Ubuntu one of the following will happen:

  • It freezes on a purple screen (see picture) (this lasts indefinitely) enter image description here

  • It freezes with a cursor blinking very fast in the upper left corner (this lasts indefinitely, happens the most often and sometimes the screen backlight turns off and the cursor still blinks): enter image description here

  • Gibberish about a kernel panic is printed to the screen (this lasts indefinitely, happens least often): enter image description here

In all of these situations pressing ctl + alt + (f1-f12) does nothing.

Because I know nVidia drivers sometimes cause this, here is my graphics drivers setup: enter image description here

I have tried using boot-repair (this makes no difference) and I have tried reinstalling Ubuntu twice (this makes no difference).

Please help this is so annoying.

Thank you

Correctly configuring load balancing for TLS session resumption

Consider the following network topology:

Load balancer topology

  1. There are exactly two HTTPS servers, S1 and S2.
  2. There are exactly two HTTPS clients, C1 and C2. Notice this, as there are often many more clients for two servers. But in this case, there are only two clients. (You may ask why? Because C1 and C2 are also servers, serving many clients while being served by S1 and S2 as well.)
  3. There is a load balancer between the clients and server, LB. Here, LB performs load balancing in a round-robin fashion at transport layer (TCP). Therefore, LB does not perform SSL-offloading or anything related to application layer.
  4. The clients request something like The DNS resolves to the IP address of LB, which in turn forwards the packet to either S1 or S2.
  5. LB is configured to route packets in one TCP session (same src port, src address, dest port, dest address) to either S1 or S2, not both. Therefore, S1 and S2 need not be aware of the session information on the other server.
  6. For performance reasons, S1 and S2 can be configured to use TLS session resumption based on either session IDs or session tickets.

The following scenario shows the problem:

  1. C1 connects to, and LB sends its traffic to S1. A TLS session is established (full handshake), with sessionID = 123456. After a while, C1 closes the connection.
  2. Some time passes, and C1 connects to again. This time, LB sends its traffic to S2. C1 offers to use sessionID = 123456, but S2 does not know this sessionID. So, S2 asks to set sessionID to something different, say sessionID = 789abc (full handshake). After a while, C1 closes the connection.
  3. Some time passes, and C1 connects to yet another time. This time, LB sends its traffic to S1, which does not know sessionID = 789abc. You get the idea: another full handshake occurs.

So, as a client goes back-and-forth between the servers, a full handshake occurs every time, and the performance is impacted.

What is the correct way to handle this scenario, so that the clients do not perform a full handshake in every new connection?

PS: If I had many clients, I’d configure LB to stick one client to one server for some amount of time. However, since there are only two clients, that would impact performance as well.

Edit: The link I cited above explains this, which I don’t fully understand:

In practice, deploying session tickets across a set of load-balanced servers also requires some careful thinking and systems architecture: all servers must be initialized with the same session key, and an additional mechanism is required to periodically and securely rotate the shared key across all servers.

I need assistance creating a proper localstorage to correctly remember fairly complex toggle state

I have a multilevel toggle code that I need to have remembered when a user refreshes the page. I have read others here but unfortunately they are all single level toggles and they do not help me. The toggle works perfect without any of my localstorage code added. However, when I add the localstorage code the original code goes haywire. Can anyone guide me to the correct way to set up my localstorage?

I have tried several methods and I am unable to get any to work. I will attach a jsfiddle.

enter code here <form method="post" autocomplete="on">   <fieldset>     <div>   <p><label class="yes_text">Yes</label><span><input type="radio"      id="dog" name="answer_name" value="yes"></span></p>   <p><label>No</label><span><input type="radio"  name="answer_name"                         checked="checked"></span></p> </div> </fieldset> <fieldset class="include_other_levels"> <div class="red">   <div>     <p>Include Red Dogs&#58;</p>   </div>   <div>     <p><label class="yes_text_include">select to include</label><span>                                                           <input type="checkbox" id="cat" class="red" name="red_name" value=""></span></p>   </div> </div> <div class="green">   <div>     <p>Include Green Dogs&#58;</p>   </div>   <div>     <p><label>select to include</label><span><input type="checkbox"                              name="green_name" value=""></span></p>    </div>  </div> </fieldset> </form>  $  (document).ready(function() {  $  (this).find('input[type=radio]').change(function() { $  (this).closest('form').find('label'); if (this.value == "yes") {   $  (this).closest('form').find(".include_other_levels").toggle(200);   localStorage.setItem("toggleState", "d"); } else {   $  (this).closest('form').find(".include_other_levels").toggle(200);   $  ("").hide();   localStorage.setItem("toggleState", "g"); } }); var state = localStorage.getItem("toggleState"); if (state == "d") { $  (".yes_text").addClass("toggle"); $  ("#dog").prop("checked", true); $  (".include_other_levels").show() } else { $  (".yes_text").addClass("goggle"); $  ("#dog").prop("checked", false); }  $  ('input[type="checkbox"]').click(function() {  if ($  ("").is(':checked')) {   $  ('').show(300); } else {   $  ('').hide(300); } });  });    fieldset.include_other_levels {  display: none;  clear: both;   transition: visibility 0s 2s, opacity 2s linear; } 

The code has an initial radio button. If user selects “yes” they get a dropdown checkbox. If the user checks that checkbox another checkbox dropsdown. Each state needs to have storage so the user can return after a page refresh and the same state appears.

Price filter not working correctly in magento 2.3

In below Screenshot. Sorting Price low to high but wrong result set is displayed.Sorting not work correctly !. enter image description here

I’m Creating a module for this sorting . Please check my code


<?php namespace Vendor\Module\Plugin\Catalog\Block;  class Toolbar {      /**     * Plugin     *     * @param \Magento\Catalog\Block\Product\ProductList\Toolbar $  subject     * @param \Closure $  proceed     * @param \Magento\Framework\Data\Collection $  collection     * @return \Magento\Catalog\Block\Product\ProductList\Toolbar     */     public function aroundSetCollection(     \Magento\Catalog\Block\Product\ProductList\Toolbar $  subject,     \Closure $  proceed,     $  collection     ) {     $  currentOrder = $  subject->getCurrentOrder();     $  result = $  proceed($  collection);      if ($  currentOrder) {         if ($  currentOrder == 'high_to_low') {             $  subject->getCollection()->setOrder('price', 'desc');         } elseif ($  currentOrder == 'low_to_high') {             $  subject->getCollection()->setOrder('price', 'asc');         }     }      return $  result;     }  } 


<?php  namespace Vendor\Module\Plugin\Catalog\Model;  class Config {     public function afterGetAttributeUsedForSortByArray(     \Magento\Catalog\Model\Config $  catalogConfig,     $  options     ) {          $  options['low_to_high'] = __('Price - Low To High');         $  options['high_to_low'] = __('Price - High To Low');         return $  options;      }  } 

Please Correct if any errors !

cron seems to be set up correctly but doesn’t work

I read this post and checked everything, it still doesn’t work. I’m trying to set a new wallpaper every few minutes:

  • crontab -e, then line before empty last line */5 * * * * /home/me/.bin/ranbg
  • the script in /home/me/.bin has the following
    #!/bin/bash     DISPLAY=:0     f=$  (ls -d /home/me/.bin/mutables/bg/* | shuf -n1)     feh --bg-max $  f     /home/me/.fehbg 

That last line isn’t actually necessary because the script just has the exact same as the second last line. I could have forbidden the creation of it by adding --no-fehbg to the call of feh.

I think:

  • The ranbg script has ogu=777 so it shouldn’t be because of rights.
  • The background is set by the call to feh so it shouldn’t be because of a missing DISPLAY, so the DISPLAY=:0 in the script is cosmetics