Generic WiFi Adapter (SDHC) using the WIFI@SDCF app [Dxingtek/Keytech]

I purchased this (very) generic “WiFi adapter”. (Model AD_wifi_SD) It accepts a Micro SD card, and when powered by a host, generates a wifi network (Default SSID: WiFi@SD, default password: 99999999 [eight nines] ).  I was hopeful that it would expose a webserver that I could access from my linux desktop to download files from the camera’s SD card, but no such luck.

The server resides at 192.168.100.1, and assigns IP addresses starting at 192.168.100.100, however it uses a proprietary (UDP packet) protocol that only works with the provided android or iOS app (Called WiFi@SDCF on the Google Play Store com.keytech.wifisd).

Although it may be technically possible to run this app in an emulated android environment on Linux, I didn’t want to put in that much effort. Especially as it appears that the android app (and likely the SD card server) are buggy, and the protocol does not support error detection or correction.  See the class project paper here in the wifi-sdcf repo by David Buchanan for more details.

In short, unless you only want to transfer files to a phone/tablet and are willing to run the provided app (which is of questionable quality) on your device, probably steer clear of this device. [For Sale: One at the cost of shipping….comment if interested.]

How to access your Ubuntu partition if Windows BitLocker has overwritten your GRUB boot loader

If you dual boot a Linux install alongside Windows 10, you may run into an issue where the Windows 10 BitLocker (full disk encryption) panics and refuses to boot your computer. (For example, if you make a change to the BIOS setting, and BitLocker thinks the hard drive has been moved to a different computer.)

The downside to this is that when BitLocker Panics, it may do so before loading the GRUB 2 bootloader, instead popping up a screen asking for your bitlocker “key”. [You DID save that key file in a safe place, right?]

However, even if you do not have access to your BitLocker key, it is usually possible to access (boot into) your Ubuntu partition (If you have a modern UFEI computer) . There are two possible ways to do this. The first is directly from the BitLocker key recovery screen. You can pick to “skip” this drive, and pick an alternate boot option, and one of the options will likely be your Linux/Ubuntu partition (because the UFEI system still knows about the Ubuntu boot system, even if the Windows Bit Locker has over written the Grub master boot record.

Alternatively, on my laptop at least, you could also interrupt the normal boot sequence and pick the “f12 – pick boot device” menu and the Ubuntu/Linux partition was one of the options (along with booting from a USB drive, etc…)

Once you have Ubuntu booted up, a simple:

sudo grub-install

in a terminal should get the GRUB MBR back where it belongs.

Geeqie image viewer showing only white squares in Ubuntu 21.04

Ubuntu 21.04 uses Wayland (vs X11) and packages a version of the geeqie image viewer that has a bug where this results in displaying white squares instead of images.

https://github.com/BestImageViewer/geeqie/issues/539

The workaround until Ubuntu updates their geeqie package is to go to Edit->Preferences in GeeQie and in the “Image” area enable the option “Use GPU acceleration via the Clutter library (requires restart)”. Once you close and re-start Geeqie, it works! (Assuming your graphics card supports GPU acceleration).

Enabling a maximum battery charge amount (charge threshold) on Lenovo X1 in Ubuntu

Most of the time when using my laptop I am plugged into it’s AC charger. But, I don’t want my lithium-ion battery charged to 100% all of the time, as that is unhealthy for the battery and will lead to it prematurely losing capacity.

My Lenovo X1 Carbon allows you to set a value less than 100 in the:
/sys/class/power_supply/BAT0/charge_control_end_threshold
field and will stop charging your battery if it goes above that amount.

So you can issue a command like the following to prevent your laptop from charging your battery above 80%:

echo "80" | sudo tee /sys/class/power_supply/BAT0/charge_control_end_threshold

(and if you wanted to get fancy, you could tell it to not start charging the battery until it fell below 70% with a command like the following)

echo "70" | sudo tee /sys/class/power_supply/BAT0/charge_control_start_threshold

Then, you would have to unplug the laptop to discharge the battery below 80, and it would just stay there.   If you were planning on taking your laptop somewhere without a power cord, you would want to reset this to 100 and fully charge it before you left.

On the X1 carbon with Ubuntu 21.04, I got some “/sys/class/power_supply/BAT0/charge_control_end_threshold: Invalid argument” type errors when trying to set the end amount to a value lower than the current start amount (or the start amount to a value higher than the current end amount). So if you are messing with one, you should probably set the other appropriately before-hand. For example, I use the following commands, in this specific order to limit to 80 (start charging below 70):

echo "70" | sudo tee /sys/class/power_supply/BAT0/charge_control_start_threshold
echo "80" | sudo tee /sys/class/power_supply/BAT0/charge_control_end_threshold

 

And then to reset to 100 (start charging below 99 or less) I use the commands in this order:

echo "100" | sudo tee /sys/class/power_supply/BAT0/charge_control_end_threshold
echo "99" | sudo tee /sys/class/power_supply/BAT0/charge_control_start_threshold

 

Using this ordering prevents the Invalid argument errors for me.

The above commands reset the default values, and will not survive a reboot. So if you want them to always be active, you can set up a system service which will fire every time your computer reboots by creating a file in /etc/systemd/system/   called charge-threshold.service that looks like the following:

[Unit]
Description=Set the battery charge threshold
After=multi-user.target
StartLimitBurst=0

[Service]
Type=oneshot
Restart=on-failure
ExecStart=/bin/bash -c 'echo 70 | tee /sys/class/power_supply/BAT0/charge_control_start_threshold; echo 80 | tee /sys/class/power_supply/BAT0/charge_control_end_threshold'

[Install]
WantedBy=multi-user.target

Then enable the service with the following:

X1:/etc/systemd/system$ sudo systemctl enable charge-threshold.service
X1:/etc/systemd/system$ sudo systemctl start charge-threshold.service

Making bc use scale=8 (or any other configuration) every time you start it.

If you use bc (a command line calculator) frequently, you probably want floating point division by default. You can type “scale=8” every time you open it, or you can set up some environment arguments to have that be your default every time you open it.

Create a .bc file in your home directory that includes:

scale=8

Edit a file that is executed every time you log in (such as .bashrc) to include the line:

export BC_ENV_ARGS=~/.bc

 

 

Giving away public Wifi with DD-WRT and VPN

Cliff Notes for setting up a public (unencrypted) wifi hotspot to give free internet to guests with minimal risk to “your” network.

Sometimes it’s nice to give people free wifi, especially if you have more bandwidth than you normally use. However, you don’t want random people being able to access your network (or their random network activity to be traced TO your network….)   This is my set of notes for how to set up a 2nd wifi router (which must support the DD-WRT firmware) to act as a free wifi hotspot to untrusted guests.
Continue reading

Wifi Printing to HP Envy 4500 printer chops off top of page

If you are printing from Ubuntu Linux to an HP Envy 4500 printer and try to print a document with a very small top border, you may find that the printer chops off the very top quarter inch of the page.

The fix I found was to change the paper size from “US Letter (11 x 8.5)” to US Letter Borderless (11.14 x 8.72)” in the print drivers.

I have read several places online where other users with Mac’s and Windows machines have the same issue when printing over wifi, so I feel the issue is with the printer itself (and it’s wifi to printing bridge) as opposed to the Linux drivers.

30 second delays in internet on AT&T U-verse 5268AC FXN modem

My wife and I were running into inexplicable “delays” in our AT&T internet service over WiFi. The speed of the internet would be fine when it worked (speedtests showed good lag/upload/download, etc…) but sometimes the entire internet would “pause” and not respond for 20-30 seconds at a time. Usually not enough time for a connection to time out, but websites would be stuck loading for a long time, or Google Web Apps wold have a “loading….” message for half a minute before recovering (or failing to recover, making us try again with an edit to a document or calendar item…).

After much gnashing of teeth, network profiling, and dark vodoo, we traced the problem down to our devices auto-switching between the 2.4 Ghz and 5 Ghz wifi networks from the router [a Pace DSL modem Model 5268AC FXN ].   The problems happened most frequently when we had about 50% wifi signal strength to the 5G radio, and apparently our devices would see the stronger signal strength on the 2.4 router and switch over to it, then decide to switch back, and so forth.

The root cause of the problem is that the AT&T Uverse DSL gateway / wifi router has both networks with the same SSID (Name) and password, so our devices felt that they were “the same” network, just on different frequencies, and would switch between them frequently.   I have no idea why this would cause a delay of TCP/IP traffic, as a change in the physical/data link layer shouldn’t affect the Network/Transport layers (at least, not for 30 seconds).   Perhaps when using a different brand/model of Wifi Router devices can auto-switch between 2.4 and 5g seamlessly. ( Or perhaps not, our previous cable modem from Spectrum / BrightHouse named the two networks differently (with a 2 and 5 suffix) so that once you connected to a particular network frequency, you stuck with it, but at least we didn’t see this type of issue. )

In any case, the solution was simple. For testing purposes, we fixed the BSSID (mac address of the router) in our client devices to the 2.4 Ghz network, so it would not switch to the 5 Ghz radio. This fixed the problem.   Renaming the 5 Ghz network name to something different from the 2.4 Ghz network on the router would also have the same effect for all devices (for example, using myNetwork2.4 and myNetwork5 as the names).

Installing an Encrypted Partition with LVM dual boot on Ubuntu 16.04

The Ubuntu 16.04 installer has the option to install full disk encryption using LVM if you are erasing everything on the hard drive. However, if you want to dual boot (use some of the hard drive for Windows, and the rest for Linux) the automated installer won’t allow you to automagically use full disk encryption.

You can still make it work, but have to do a lot of manual work using a terminal from the Live CD environment.   Here is a log of what I had to do to get it working for me.

Continue reading

Firefox scrollbars “Jumping” or “Warping” instead of scrolling when clicked

Recently, the scrollbar behavior of my Firefox web browser changed.   The “old” (and expected/desired) behavior is that if you click in the scrollbar area anywhere below the thumb, the thumb moves down one page.

However, the new behavior is that a normal click will “Warp” the thumb directly to the clicked location, scrolling the webpage a whole lot farther than desired.   (it used to be that a right-click would do the “warp”, which is a useful feature, not not necessarily one I want to be the default).

I found the answer here: https://support.mozilla.org/en-US/questions/1120904

The change in behavior is caused by gtk 3.0 and to fix it on Ubuntu Linux, I had to:

create ~/.config/gtk-3.0/settings.ini

with contents:

[Settings]

gtk-primary-button-warps-slider = false