Category Archives: Troubleshooting

NVIDIA on Fedora 27: Bad Resolution & Painful Mouse Lag (Fixed)

I’ve been using an older NVIDIA graphics card in my Fedora Linux workstation for a long time. I finally decided to upgrade to a newer one, which meant uninstalling the legacy drivers, then installing the current NVIDIA drivers.

Using the RPMFusion packages simplified it, because I only had to do the following to uninstall the old nvidia-340xx driver and install the new one:

dnf remove xorg-x11-drv-nvidia\*
dnf install xorg-x11-drv-nvidia akmod-nvidia
reboot

(Of course, I still had to hit ESC during boot, CTRL+ALT+2 to get to a text console, and log in without access to copy/paste or windowing.)

But it didn’t work. Oh, it brought up the GDM login screen, sure, but the mouse cursor and keyboard response were so slow I could barely even click on the form. It would move normally for about a second, then simply stop for five seconds. You can’t use a computer like that. Even if it had let me log in — it didn’t — there wouldn’t have been any point.

Additionally, the resolution was slightly off, with the aspect ratio on everything stretched vertically.

And of course I couldn’t use any of the graphical utilities to adjust settings, because I couldn’t run anything graphical.

I tried all kinds of things to fix it:

  • Creating an xorg.conf file with nvidia-xconfig. (no change)
  • Manually adding an xorg.conf section setting the resolution to the monitor’s native resolution. (no change)
  • Completely reverting to Linux’s built-in nouveau drivers, uninstalling all traces of nvidia and reinstalling Xorg and mesa as suggested at RPMFusion. That made the computer work again, but 3D graphics were slow. Reinstalling the nvidia packages fresh took me back to square one.

Nothing I could find online was remotely helpful. It was all about making sure the drivers were installed correctly, which I’d done, or configuring X.org, which (a) I’d done, and (b) hadn’t made any difference. (Fortunately I had another device I could look this stuff up on!)

Finally, just as I decided to revert to nouveau again just to have a working system and table the question of 3D acceleration until later, I hit upon an idea.

Wayland, the new display framework, isn’t compatible with the official NVIDIA drivers. I hadn’t had any problems with nvidia-340xx, so I figured I’d long since disabled Wayland and forgotten, but just for kicks, I switched over to the text console and tried

ps -ef | grep -i wayland

…and found that Wayland was running!

But Fedora’s GDM is supposed to fall back to X.org when it’s not able to run (the nvidia drivers are mentioned specifically). Maybe it recognized the old driver as incompatible, but thought (wrongly) that the new one could handle it?

Fortunately, that page also offered the solution:

Edit /etc/gdm/custom.conf, and put the following line in the [daemon] section:

WaylandEnable=false

The line’s actually in there already, commented out.

Literally, the solution to the problem that had me tearing my hair out for an hour was to delete a single #.

GDM displayed correctly, mouse and keyboard responded smoothly, and I was able to log in just fine…and 3D was much faster than my old card.

Problem solved!

But only because I finally realized I needed to look for Wayland.

Android Oreo Won’t Stop Vibrating

I finally discovered why my phone has been vibrating on most incoming messages since upgrading to Android Oreo, even when sound is on: It’s now a per-conversation setting, so even though I have Messenger set to sound only, that only applies to new senders. I had to go through my saved text messages and turn vibrate off in every. single. saved. conversation.

Deleting a conversation also makes it use the default setting the next time that person sends a message, so if you don’t want to save the existing texts, deleting them is faster.

Not terribly convenient, Google.

Of course, that only fixes it for Messenger.

Notification settings are per-app now, and it seems Oreo assumes you want it to vibrate along with the ringtone unless the app turns it off. And of course not all of them let you turn off vibration independently from sound. They haven’t needed to until now, after all.

Ironically, this includes Chrome. I’m trying out Mastodon (find me at @kelsonv@mastodon.social for general conversation and @kelsonv@photog.social for photos), and for now I’m using the embedded Chrome app. And I can’t fine-tune the notifications because Google’s own flagship browser doesn’t include the options it needs on the new version of their OS! 🤦

How to Forget Out-of-Range WiFi Networks on a Samsung Galaxy Phone

Samsung’s Android skin won’t let you tell it to forget a saved WiFi network unless it can see it right now. If it’s present, sure. If it’s out of range, it won’t let you tell it that no, you really don’t want it to automatically connect the next time you’re in range.

This is both annoying (your Galaxy S7 or Note 5 is going to keep looking for those networks all. the. time.) and a security risk (imagine someone sets up a rogue hotspot called “Starbucks WiFi” and you happen to park your car* or sit on a bench within range of it).

Note that the stock Android settings do allow you to fix this, with a Saved Networks section in the WiFi config. Samsung deliberately removed the feature** for some reason.

Apparently it used to be possible to remove saved networks using a third-party app, but new security protections in Marshmallow prevent that. (Ironic, that.)

Workaround (source):

  1. List all saved networks by going to Settings → Data Usage → More → Restrict networks. (This doesn’t let you remove them, just limit background transfers on them.) Take a screenshot if you have to.
  2. Remove the ones you don’t want anymore by tediously renaming your own WiFi hotspot to match each in turn [edit: you also need to match the security type (open vs WPA2)], removing them one by one in the regular WiFi settings, then renaming your hotspot back to its normal SSID.

It’s a pain, but at least it’s possible.

Update May 2017: The Android 7 update finally restores this capability directly in the Settings app, at least on the Galaxy Tab S2. You can now go to

Settings → Connections → Wi-Fi → Advanced → Manage networks

to remove saved networks of just turn off auto-reconnect on a case-by-case basis (so you can keep saved passwords). But for older Android versions, we’re still stuck doing it the long way.

*I once stopped at a Coffee Bean and left my tablet in the car. I don’t remember why I pulled it out when I got back in the car, but it had connected to the WiFi while I was grabbing my coffee. It couldn’t actually load anything but the login page because it was the real hotspot…but if it had been a fake hotspot, they could have intercepted or modified any non-encrypted traffic going on in the background.

**At best, Samsung forgot to include it when they wrote their own settings app years ago.

Using WP-CLI with WordPress 4.6 on DreamHost

I use WP-CLI from time to time to do maintenance on my WordPress sites that I host on a DreamHost VPS. But today I tried to run the search-replace function and found that wp wouldn’t run. Instead I got this error:

Fatal error: Call to undefined function apply_filters() in /path/to/wp-includes/load.php on line 317

It didn’t take long to confirm that WordPress 4.6 had changed things around, breaking the version of WP-CLI on my server. As it turns out, WP CLI 0.24 fixes this, but DreamHost is running 0.24-alpha.

So I tried installing the current version locally on my account, only to get a different error:

Fatal error: Class 'Phar' not found in /path/to/wp-cli.phar on line 3

I found this article very helpful for enabling PHAR support on a DreamHost VPS. I went into ~/.php/5.6/phprc (create this file for your version of PHP if you don’t have it) and added:

extension=phar.so
phar.readonly = Off
phar.require_hash = Off
suhosin.executor.include.whitelist = phar

Once I verified that it would work by running /usr/local/bin/php-5.6 wp-cli.phar --info, I took the opportunity to (a) override the wp command with the local one and (b) make sure it used php 5.6 by adding the following alias to my .bash_profile:

alias wp='/usr/local/bin/php-5.6 ~/bin/wp-cli.phar'

This won’t be needed once DreamHost updates their WP-CLI package, but for now, it solves my problem faster than waiting for a response from tech support.

Redirecting HTTPS with Let’s Encrypt and Apache

The free TLS certificate provider Let’s Encrypt automates the request-and-setup process using the ACME protocol to verify domain ownership. Software on your server creates a file in a known location, based on your request. The certificate authority checks that location, and if it finds a match to your request, it will grant the certificate. (You can also validate it using a DNS record, but not all implementations provide that. DreamHost, for instance, only uses the file-on-your-server method.)

That makes it really simple for a site that you want to run over HTTPS.

Redirected sites are trickier. If you redirect all traffic from Site A to Site B, Let’s Encrypt won’t find A’s keys on B, so it won’t issue (or renew!) the cert. You need to make an exception for that path.

On the Let’s Encrypt forums, jmorahan suggests this for Apache:


RedirectMatch 301 ^(?!/\.well-known/acme-challenge/).* https://example.com$0

That didn’t quite work for me since I wanted a bit more customization. So I used mod_rewrite instead. My rules are a little more complicated (see below), but the relevant part boils down to this:


RewriteEngine On
RewriteBase /

# Redirect all hits except for Let's Encrypt's ACME Challenge verification to example.com
RewriteCond %{REQUEST_URI} !^.well-known/acme-challenge
RewriteRule ^(.*) https://example.com/$1 [R=301,L]

These rules can go in your server config file if you run your own server, or the .htaccess for the domain if you don’t.

Continue reading