Monday, January 20, 2020

Disable Laptop Keyboard

My laptop keyboard is having issues where a shift key stopped working and now (after I tried messing with it) is in a perpetual state of shift. At first, plugging in a USB keyboard mitigated the issue, except during boot where I had to hit my caps lock in order to type in my luks passphrase, but now it starts acting up within a few minutes of actually trying to use it.

While repairing the keyboard, or getting a new laptop 😀, is the ideal solution, I needed a quicker and cheaper option. After doing some searching, I found this askUbuntu post explaining how to disable the laptop keyboard so I could just use my USB keyboard.

I am running Pop!_OS now. I have a System76 laptop, which is about 5 years old (so they keyboard thing isn't an immediate failure), and wanted to give it shot while updating my firmware. I have been pretty happy with it, but that also means I am using systemd-boot to boot my laptop.

For anyone using Pop!_OS, the way to make this change is to run:

sudo vi /boot/efi/loader/entries/Pop_OS-current.conf

At the end of the options line I added the i8042.nokbd that is mentioned in the post I referenced.

The 8042 is an Intel microcontroller. One of its functions is to handle the standard keyboard interface. Adding that option to the kernel disables the keyboard interface. The USB keyboard I am using is unaffected because it is a USB keyboard. The nokbd option is handled by the i8042.c driver.

All you have to do is reboot after making the change, nothing else is needed. If you are concerned about your old kernel boot config, you can also modify the Pop_OS-oldkern.conf in the same location.


Wednesday, March 22, 2017

Firefox and Netflix

Netflix announced playback is now available (but not supported) in Firefox on Linux. This uses the optional EME module that can be installed in Firefox 47 or newer. Controversy about DRM aside, it is nice that they are doing this.

However, the blog post doesn't mention one important fact. I tried watching a video in Firefox running on Fedora. I got the unsupported page. I know the EME module is working because I can watch Amazon Prime videos on this same browser.

I got to looking at their system requirements page that I kept getting sent to. Apparently, it only works with official builds of Firefox from Mozilla; it will not work with non-Mozilla builds. So I downloaded Firefox directly from Mozilla to try it out. And sure enough, it did work (I ran it under the same Firefox user profile for consistency between the tests). Tried again with the Fedora build and no luck.

So either they are checking to see if it is an official Mozilla build or there is something disabled in Fedora's Firefox build. And it isn't the EME module as that is downloaded from Google if you check the box in the preferences to play DRM content.

I guess this is one step forward and half a step back. I prefer to just let Fedora (or whatever distro I am using at the time) update my Firefox versions, I am not interested in using or maintaining a downloaded copy.

Sigh.

UPDATE:

When I originally tried this out I did look at the user agent strings between the two browser instances and thought they were the same. However, after a suggestion to look at them again I noticed one minor difference:

Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

Changing my general.useragent.override in the about:config to the second one got things to work. So not as dreadful as I originally though, just a minor annoyance. I can live with my user agent being changed permanently to leave off the "Fedora" :)

Sunday, February 12, 2017

Simple Scan Slackbuild

The simple-scan package on SlackBuilds.org lists two dependencies: vala and libgusb. If you look at the README via sbopkg, it lists them as libgusb and vala. Order is important in this case. vala has to be installed first for simple-scan to compile properly as libgusb apparently has some vala hooks that simple-scan relies upon. If you build libgusb first and then vala, simple-scan's build will report an error (I didn't keep track of the exact error message, but it amounted to libgusb not having some sort of vala reference). Re-building libgusb resolved the issue for me.

Friday, January 27, 2017

Facebook GPG

This news is almost 2 years old now but I just got back onto Facebook a few months ago and found this to be interesting.

Facebook allows you to upload your public key so you have have all of your notifications encrypted.

I haven't fully enable it yet, I've just sent the test email to my account and it worked just fine. I haven't enabled it yet because right now I using Gmail's web interface as my mail "client" as a test (more on that later). And the last time I checked (plus a real quick search right now) doesn't show any sort of GPG integration with Gmail. But I may yet switch after I am done (if I am done) with the Gmail web interface.

Saturday, January 14, 2017

Algorithmic Bias

Two days ago the ACM published a press release on algorithmic bias. Included in there is a PDF listing 7 principles for developers and organizations to consider when developing their algorithms. Computing automates many things and discrimination is unfortunately one of them.

Facebook has had a question come up with their ethnic affinity feature for ads. NOTE: I am not saying Facebook is engaging in discrimination with their ads. I haven't done any further research into this particular story to determine how the ethnic affinity actually works. I am merely posting it as an example of a question that has come up about an algorithm that a prominent company uses. If interested, please do additional research before making any judgments.

I don't know how much impact the ACM's statement will have on the developer community. But I do salute them for at least publishing this out there for awareness.

Friday, January 13, 2017

Sorting Algorithms

I just want to call out a nice site that has a visual representation of various sorting algorithms.

http://www.sorting-algorithms.com

They have eight different sorts offered, with different data sizes, and with data in various starting configurations (random, neatly sorted, reversed, few unique). Having the different input configurations is really nice as it will visually show you the strengths and weaknesses of the various sorts. It also includes a short discussion of the algorithms and lists their properies.

Wednesday, January 11, 2017

Laptop Hibernation

I enabled hibernation on my laptop where I am using LUKS + LVM on Fedora 25.

  1. Edit /etc/default/grub to add resume=swapdevice to GRUB_CMDLINE_LINUX (my device was /dev/fedora/swap since "fedora" is my volume group and "swap" is my logical volume for swap).
  2. sudo dracut -f
While I did install the hibernate status button extension, I was also able to test things out with 'sudo systemctl hibernate'. The laptop went into hibernation and I was able to boot back up picking up where I left off.

And the nice thing, my swap is on the encrypted volume so my save image is therefore encrypted as well.