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

 

 

Installing Ubuntu 20.04 on Lenovo X1 Carbon (6th gen) with UEFI Secure Boot

Installing Ubuntu 20.04 on a Lenovo X1 Carbon (6th gen) with UEFI Secure boot can be a relatively painless process (If you are using one of the default install options).

When the Ubuntu 20.04 install DVD ISO image detects that your computer booted using UEFI (Secure Boot) it will ask you to provide a password that you can use to install the Ubuntu signed secure boot version of the grub bootloader and authorize it to your BIOS.

After the first reboot, the X1 BIOS brings up a window where instead of booting, you need to move down one menu option and view the new certificate, and then accept/install it. At this point it will ask you to type the password you earlier provided to Ubuntu, and if you are able to do so, it will accept the Ubuntu installed grub bootloader as valid and boot with it.   [If you DON’T do this, but try and just boot immediately, it obviously won’t work, and the easiest thing to do is re-do the entire install process, although I’m sure there is some magic you can type with efi tools to give yourself another chance….]

Full Disk Encryption

Continue reading

It’s June 1st 2021, how is Orange County Florida doing with COVID-19?

Cases
Continuing vaccination efforts have continued the decline in cases since the mid-April mini-spike.   The 7-day average of new cases (145 per day) has reached the level achieved in Aug/Sep of 2020, which was our previous low point.   These new cases are primarily occurring within the remaining unvaccinated population.

Median Age of the infected

At the end of April, the median age of those infected   was   32.7 years old. Over the last seven days the average age has risen slightly to 33.8, and I expect this average age to increase as more children in the 12-16 age group are vaccinated.

Deaths
The number of deaths per day has held relatively steady at a reported 1.93 per day, (60 total) in May. (Compared to 2 per day in April.)   The summer peak (June 22nd 2020 to July 22nd, 2020)   had 6.97 average deaths per day (223 total deaths), so the number of deaths is around 25% of our worst month. Total reported COVID-19 deaths overall in Orange County   Florida is at 1309 as of June 1st 2021.

Percent Positivity
These numbers are significantly better than in April, with every day out of the last 14 under 5%, and 13 days under 4%.     Community spread is starting to be under control.

This is a significant improvement over the end of last month:

How many people have been vaccinated

The Florida department of health reports that as of May 27th 2021, 510,582 Orange County residents   (36.6% of the total population) have been fully vaccinated. Children under the age of 12 are not yet eligible for vaccination, but also have minimal direct health risks from catching covid-19 (other than the risk of transmission to others.)

The rate of vaccination uptake has slowed, large community vaccination sites are being shuttered and replaced by smaller pop-up clinics at targeted sites as well as distribution via local pharmacy’s.

Predictions for June:

I expect that daily case numbers will decline in June, hopefully going below 100-per day by the end of the month. Deaths are also likely to slowly reduce over time. My prediction would be between 30-45 deaths in June (1-1.5 per day).

[Charts/Numbers used can be found in this open document spreadsheet: orange_county_florida.ods   ]

How to extract depth images from Pixel 4 / google camera Android phone Portrait images

I have a Pixel 4 android phone which can take “Portrait” images that use a depth map to “blur” the background, focusing on the foreground.

I also have a Looking Glass Factory Portrait holographic display which can display holographic images.

Currently, the HoloPlayStudio software (version 0.3.5 beta) that comes with it only natively supports iPhone portrait photos, but will import RGB+D photos, so I need to extract the depth image (and the original image without the blurred background)

I want to extract a depth map from my android photos so that I can (manually) create RGB+D photos (which have a regular jpeg image next to the corresponding depth map).

This website makes it easy to see/download the different layers embedded in the Pixel 4A “Portrait” mode jpeg image: https://www.photopea.com/

Download the original image and the depth map, glue them together with the depth map on the right and you have an RGB-D image suitable for HoloPlayStudio.

You can also extract the original and Depth Map images using the exiftool.

The command that I found worked was suggested by Phil here:
https://exiftool.org/forum/index.php?topic=11701.0

It extracts the 2nd trailer image, which is the depth image:

exiftool input.jpg -trailer -b | exiftool - -trailer -b > dept.jpg

Incidentally, the FIRST trailer image is the non-blurred original image…

exiftool input.jpg -trailer -b > original_image.jpg

So if you extract the trailer from the original image, it will be the depth map, and you won’t have to chain exiftool together on the command line as above…

exiftool original_image.jpg -trailer -b > depth.jpg

Completely unrelated to extracting depth images, but possibly needed to create holograms from a linear slide movie is the following ffmpeg command that will extract 3 seconds of a video starting at the 2 second mark into PNG image frames:

ffmpeg -ss 00:02 -i <input> -t 00:03 filename%05d.png

Right Wheel Locking on Ego 21″ Self Propel unit

My 21 inch Ego mower with the updated self propel unit has developed an annoying quirk. Some of the time when I try to move it, or make a turn at the end of a row, the right wheel “locks”. This isn’t an issue when making right pivoting turns, but when you are trying to pivot around the left wheel and the right wheel locks up, it stops the turn.

It appears to happen both with or without the mower motor engaged. It sort of acts like the “anti-roll-back” feature, except that I’m not trying to make the mower go backwards, and it’s always the right wheel that locks up, never the left.

I had never noticed this behavior before a month ago, so it appears to be a newly developed issue. So far the self propel unit is working fine when engaged, but given my history of self propel unit failures, I’m concerned that this quirk may indicate something in the motor control unit is having issues…

June 2021 Update:

The issue shown in the above video kept getting worse until I called Ego support and described it to them. They immediately sent me to the local Ego certified repair place who fixed the issue in about a week. The issue was that the nylon gears at both ends of the drive shaft (as well as the plastic gears inside the wheels) were worn down and slipping/jamming. The shop tech said that he replaced both the motor/drive unit and both wheels. Here is a photo comparing what the nylon gears are supposed to look like with what the actually looked like.

It’s May 1st, how is Orange County Florida doing with COVID-19?

Cases
Despite continued vaccination efforts, the small spike in cases in March continued into April, most likely due to new more contagious variants of the virus (B.1.1.7) and relaxing of social distancing by the population. It appears we reached the top of this peak mid-April as the the 7-day average of new cases (355 per day) is below the peak.   The number of new cases per day is still higher than Aug/Sep of 2020, which was our previous low point.

Continue reading

Lenovo X220 full speed fan in Ubuntu

The Lenovo X220 laptop firmware automatically adjusts fan speed based upon CPU temperature. But in some situations under heavy load (video encoding for example) the CPU will still throttle based upon temperature, as the X220 firmware will only ramp the fan up to a maximum RPM of around 4,400.   However, under linux you CAN put it in “full-speed” or “disengaged” mode, where the PWM controller just turns the power all the way up and lets the fan run as fast as it can (around 6,600 rpm on my machine, which is quite noisy.)

The magic command is:
echo level full-speed | sudo tee /proc/acpi/ibm/fan

To go back to “automatic” (quiet) mode use:

echo level auto | sudo tee /proc/acpi/ibm/fan

If you just want to know what mode you are currently operating under, which commands are available, or view the fan RPM, you can type:

cat /proc/acpi/ibm/fan

Replacement / Teardown of Intermatic AG3000 Surge Protective Device

The Intermatic AG3000 Surge Arrestor / Surge Suppressor device wired into my main breaker panel had a green indicator light that indicates correct operation. But the green light disappeared, indicating that the device was no longer providing protection, so I replaced it.

Afterwards, I opened up the failed device to see if there was any evidence of a surge (all the electronics in my house still appeared to be working) and to see what was inside it.


The surge suppression functionality is provided entirely by a pair of Mersen 150TPMOVSL (150 volt thermally protected MOV with “short leads” for the internal micro-switch) They are in series between the two 240v hot leads, with the neutral lead in the middle. (You can also use this device on a 120v circuit by connecting both black wires to the single live/hot wire, putting both MOV’s in parallel).

The microswitches are normally open, and the spec sheet says they close when the metal oxide disk inside fails. [This particular model does not include a visual pop-out indicator.]   The indicator circuit board (normally soldered to the top of the MOV’s) is extremely simple, and is powered from neutral and one of the hot lines (120v AC) via two large ohm value resistors (I measured 63 VAC after the resistors) through a single diode.   The microswitches are placed in parallel to the indicator light (which may be a LED of some type, it used a LED symbol next to a 93V-0 marking on the PCB) so that they short it out if they close.

Once I removed the indicator circuit board, the MOV micro-switches were open (non-conducting), so it is possible that the indicator light failed shorted and the MOV’s are still providing proper protection.