Inside the Omron D2FC-F-7N microswitch

When my ancient Logitech G500 mouse stopped working properly, I followed these helpful instructions to bring it back to life. Now I know more than I ever wanted to know about the mechanics inside the Omron D2FC-F-7N microswitch.

Here’s a short video I made showing how it should work:

Inside the Omron D2FC-F-7N Microswitch
“10M” stands for 10 million operations. There’s apparently also a 20M version.

This is a photo of a working switch:

Working Omron D2FC-F-7N microswitch
The purple arrow points at the contact area that may require cleaning (opposite side as well). You do not necessarily have to remove the leaf spring to do this (I recommend leaving it in place). The green arrows point at the notches mentioned in the article linked above.

The following switches will not work as the leaf spring is not positioned correctly in one of the notches:

Omron DSFC-F-7N defective microswitch
Omron DSFC-F-7N defective microswitch
This one is particularly tricky as it is impossible to see the problem with the naked eye (it looks fine but should be in the notch above).

I recommend opening the switch from this side (compare label on your switch for orientation):

Opening Omron DSFC-F-7N microswitch
Just like me, you will most likely bend and dislocate the spring if you open the switch from the other end.

Finally, a photo with my finger shows why these are called microswitches (actually Omron uses the term “Ultra Sub Miniature Basic Switch”):

Omron DSFC-F-7N microswitch size
If you don’t like working with tiny parts you might be better off getting a new mouse.

Disclaimer: If your mouse has been in use for several years, you should seriously consider buying a replacement switch. I believe you could desolder the switch from the top by cutting it into pieces first (the plastic is rather soft). Replacements don’t seem to be available from electronic components distributors but are sold on Amazon.com (affiliate link).

I was only able to repair my mouse because I had another broken one from which I stole a leaf spring (from the less-used right switch). The original spring of the left switch in my mouse was badly deformed. Unfortunately I can’t show you any pictures because it flew away when I tried to bend it.

Driver for LogiLink AU0033 USB 2.0 to 8x Serial Adapter

You can download it here.

How I found it

I went to the product page on the LogiLink website, clicked on “Downloads”, then on the link to the driver which sent me to a 404 page on 2direct.de.

I then searched for the product directly on the 2direct.de website, found it here, clicked on “Downloads”, then on “Treiber AU0033” (Treiber is German for driver), which led to a PDF document that in turn contained the link to the actual driver ZIP file (which is hosted on the LogiLink website where I started).

Note if you’re reinstalling the driver

You can find an uninstaller under “Logilink AU0033 8x seriell\CD\Driver\Windows\64X\9710_7840_QUADPORT_MSUninst.exe”, running this before the installer fixed a problem on my system where only half of the ports would appear.

DeepL translator now available as desktop app

DeepL.com is currently the best AI translator* and is now available as an app for Windows and macOS. This means that users will no longer have to copy text back and forth between their application and the DeepL website:

DeepL for Windows welcome screen

Just like the website, the app is able to provide alternatives to the suggested translations and adapts the rest of the sentence, if necessary:

DeepL app for windows screenshot

The limit of 5000 characters per translation can be lifted by signing up for a DeepL Pro plan.

Wondering why the download for Windows has an impressive size of 135 MB? This is mainly due to the use of the Chromium Embedded Framework, which is included both in a 32 bit and 64 bit version.

*Is the Deepl.com the best AI translator? I think so. Like everything on this blog, this is just my opinion. However, as someone living and working in Luxembourg, a country with three official languages, I sure appreciate DeepL.com a lot.

Alternative apps

QTranslate has been around for several years, is also available for free and integrates several different translation services (including DeepL):

QTranslate screenshot

It has additional features like image text recognition, text to speech synthesis and searching in online and offline dictionaries. However, it seems that it can only provide alternative translations for single words. The size of the download is less than 1 MB.

Reading the version from a ClickOnce .application file

ClickOnce .application files contain an assemblyIdentity element with a version attribute:

<?xml version="1.0" encoding="utf-8"?>
...
  <assemblyIdentity name="Simple Data Logger.application" version="1.1.2.1" publicKeyToken="0c3a74e9157b5601" language="en" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />

An easy way to read this version string is:

var assembly = XElement.Load(uri);
XNamespace ns = "urn:schemas-microsoft-com:asm.v1";
remoteVersionString = assembly.Element(ns + "assemblyIdentity").Attribute("version").Value;

You can use this to create a Version object:

var version = new Version(remoteVersionString);

Note: The code above runs synchronously and blocks your application. To avoid this, you could run it in as a task on the thread pool with Task.Run() or you could use XElement.LoadAsync instead of XElement.Load(), if available.

WordPress: Prevent access to wp-login.php when the wp-admin directory has already been protected

The problem: You’ve used .htaccess / .htpasswd to restrict access to the wp-admin directory of your WordPress installation. However, when someone accesses wp-login.php, they can simply click “cancel” or press the escape key in the authentication dialog to reach the WordPress login page:

Click on “Cancel” here…
…and you still reach the WordPress login page (doesn’t look great, but works).

The solution

You also have to explicitly protect the wp-login.php file. Open the .htaccess file in the root directory (not in the wp-admin directory) and add something like this1:

AuthType Basic
AuthUserFile "path/to/.htpasswd"
require valid-user

You’ll have to replace path/to/.htpasswd with the path to your .htpasswd file (which should exist if you’ve already restricted access to your wp-admin directory).

Now, if someone cancels the authentication dialog, they’ll be directed to the default “Error 401” page:

Detailed information on authentication on Apache servers can be found in the official documentation. While there are lots of terrible articles out there which only regurgitate incomplete information for SEO purposes, I did find a comprehensive tutorial on how to protect wp-login.php and the wp-admin directory here.

Note: You may still want to install a WordPress security plugin like Cerber. This is how I discovered that I had forgotten to protect wp-login.php on one of my websites.


1 Wondering why I didn’t include the AuthName directive? The text is not shown in Chromium-based browsers.