Thursday, December 16, 2021

Update icon in Firefox Mozilla build from Ubuntuzilla

In a previous post I wrote about how to get the latest version of Firefox in Debian using Ubuntuzilla. The only disadvantage with this method I have found is that the Firefox icon is seriously out of date. There is a bug report for this at Ubuntuzilla, but as it has been open for almost eight years, the chances of seeing it fixed are slim.

A user has posted a fix there.

Go to

/usr/share/pixmaps

in a terminal and do

# ln -sfn /opt/firefox/browser/chrome/icons/default/default128.png firefox-mozilla-build.png

This needs to be repeated after an update apparently.



Saturday, December 11, 2021

New Firefox ESR is late in Debian

Firefox 78 ESR reached its end of life on 2 November - five weeks ago - but the new version, Firefox 91 ESR has not arrived in Debian Stable (or indeed testing, which I am using now). That means that a number of issues that are fixed in 91 ESR will not be fixed in Firefox 78 ESR, leaving users exposed to vulnerabilities until 91 ESR arrives.

Although none of these vulnerabilities has been exploited to expose users to attack, being weeks overdue for security updates is not a good place to be.

If this makes you nervous, I will detail how to update to the latest version below.

The story has gone round the internet with an added does of FUD. It is an example of how one web site runs a story they read on another web site which read the story on a blog somewhere and nobody bothers to fact check it.

The story first appeared on BaronHK's Rants, a blog by... somebody. techrights.org reprinted it, and then Phoronix and The Register covered it.

The story notes the open vulnerabilities (which is true), but the blog and the re-runs all claim that Debian won't be able to push Firefox 91 ESR to Stable because Stable isn't up to date enough. This claim comes from a bug report linked to in the blog where a post on 8 November says:

Firefox-ESR 91.3 doesn't use OpenGL GLX anymore. Instead it uses EGL by default. EGL requires at least mesa version 21.x. Debian stable (bullseye) ships with mesa version 20.3.5 For the nvidia users the following bug report might be important...

Nobody at Phoronix or The Register thought to check the progress of the bug report before running the story. If they had, they would have noticed that the bug was closed on 7 December and the problem was nothing to do with the above and was in fact in Cubed (an audio component, apparently).

So, baseless FUD from a random blog gets spread around the internet.

Debian of course has to make sure that the new Firefox ESR release doesn't have bugs. If you are nervous about using Firefox 78 ESR in Debian, here is one way to get the latest version (there are other ways).

Add the Ubuntuzilla repository and key to your Debian sources, update and install either the latest ESR, or the latest Mozilla build, Firefox 95, which is what I did (I am running Testing after all). 

Note that you will have to uninstall firefox-esr first (which will automatically install the Epiphany browser). You can then install from Ubuntuzilla. If you don't, you will get this error message:

dpkg-divert: error: 'diversion of /usr/bin/firefox to /usr/bin/firefox.ubuntu by
 firefox-mozilla-build' clashes with 'diversion of /usr/bin/firefox to /usr/bin/
firefox.real by firefox-esr'
dpkg: error processing archive /var/cache/apt/archives/firefox-mozilla-build_95.
0-0ubuntu1_amd64.deb (--unpack):
 new firefox-mozilla-build package pre-installation script subprocess returned e
rror exit status 2
dpkg-divert: error: mismatch on divert-to
  when removing 'diversion of /usr/bin/firefox to /usr/bin/firefox.ubuntu by fir
efox-mozilla-build'
  found 'diversion of /usr/bin/firefox to /usr/bin/firefox.real by firefox-esr'
dpkg: error while cleaning up:
 new firefox-mozilla-build package post-removal script subprocess returned error
 exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/firefox-mozilla-build_95.0-0ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Installing anything from Ubuntu on Debian is normally a bad idea, as it can cause instabilities, but in this case it is fine, because the repository is just for the latest Firefox builds from Mozilla.

Update: some information from a Debian developer about the delay.

Work on this is nearing completion.

Please note that Mozilla is constantly updating to newer rustc and LLVM versions. That means that preparing a new major ESR release for Debian requires not just the packaging of the firefox-esr and thunderbird updates, but also some very complex toolchain components. Those components are usually already in unstable/testing, but for stable, oldstable, and LTS, the toolchain must be backported first.

lists.debian.org

Debian also supports additional hardware architectures and the toolchain components sometimes require specific work in order to support those additional architectures. In fact, that was the case with this current update that is underway. 

...

It is lamentable that it has taken this long, but that is not an indication of a lack of effort on the part of the people in Debian working on this.

lists.debian.org

From Piorunz at the mailing lists, here is an alternative method to update Firefox ESR, preserving the user profile until Firefox ESR is updated in Debian.

lists.debian,org

Piorunz also points out that Mesa is not the problem in a post on Phoronix:

Works perfectly fine with Debian Stable and Mesa 20.3.5, because Firefox 91 ESR detects Mesa version and adjust acelleration settings accordingly: 

Code: X11_EGL available by default

blocklisted by env: 

Blocklisted by gfxInfo

Phoronix




 












Thursday, December 2, 2021

Fix - Mouse Scroll Wheel stops working

My mouse scroll wheel has been stopping working intermittently for a while. I decided to open it up to see if I could get it working again. I suspected that the mouse has an optical movement detection system for the scroll wheel (as for the mouse itself) because the wheel action is so light it can only be rotating on a shaft, and that dirt might be preventing the detector form working.

Removing the battery revealed a catch which when moved over with a screw driver allowed the top panel of the mouse (the flexible bifurcated ends of which flex to activate the mouse buttons) to be removed.

The scroll wheel (remarkably car wheel like) has spokes. I am guessing* that at the bottom a beam of IR light (because there is no visible light) passes through the spokes to a detector on the other side, and the interruption of the beam is used to detect motion of the mouse wheel.

The wheel was indeed quite dirty, and I noticed a foreign object, a thin strand of unidentifiable material at the side of the wheel which could indeed have blocked light from passing through the spokes of the wheel. An examination of the spokes with a magnifying glass showed they were dusty.

I gave the wheel a clean with a soft artist's paint brush, including the spokes, a wipe with an alcohol impregnated lens cloth and a blast with an air cleaner, through the spokes and underneath and to the sides.

The scroll wheel is now functioning normally.

So don't bin that mouse when the scroll wheel stops working - give it a clean!

* I was right: superuser.com, has the details, including how the detector knows which direction the wheel is turning.






 

Tuesday, November 16, 2021

Error updating Debian Testing

I got the following error messages while updating Debian Testing this morning:

E: initramfs-tools: installed initramfs-tools package post-installation script subprocess returned error exit status 1


gzip: stdout: No space left on device
E: mkinitramfs failure gzip 1
update-initramfs: failed for /boot/initrd.img-5.14.0-4-amd64 with 1.
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 initramfs-tools

Say What? This is a 500G HD and it's only 7% full!

Turns out /boot is on its own 500MB partition and its full.

I had too many old kernels installed, and the solution was to get rid of most of them (keeping one known good backup kernel).

I searched for "linux-image" in Synaptic, but this can be done from a command line too obviously.

When I had finished I ran

# update-initramfs -u

Which is the part of the update precess that had failed.

I will have to pay more attention to housekeeping from now on.


Sunday, October 24, 2021

Systemd messages after suspend in Debian Testing -fixed

Update 19/12/21 Fixed - see below

I've been seeing some Systemd messages after this laptop comes out of suspend - but they only appear for a fraction of a second. I tried filming the screen as the laptop came out of suspend but only managed to get a blurry still by freezing the video.


How to read the error messages? I found I could read Systemd messages in real time, suspend and wake up the laptop and see the messages in the output. 

The command is

# journalctl -f

And the error messages were

Oct 24 19:21:38 Toshiba-laptop kernel: debugfs: File 'radeon_ring_gfx' in directory '0' already present! 

Oct 24 19:21:38 Toshiba-laptop kernel: debugfs: File 'radeon_ring_cp1' in directory '0' already present! 

Oct 24 19:21:38 Toshiba-laptop kernel: debugfs: File 'radeon_ring_cp2' in directory '0' already present! 

Oct 24 19:21:38 Toshiba-laptop kernel: debugfs: File 'radeon_ring_dma1' in directory '0' already present! 

Oct 24 19:21:38 Toshiba-laptop kernel: debugfs: File 'radeon_ring_dma2' in directory '0' already present! 

Seems to be a kernel bug (Arch Linux Forums).

Update - fix found

It seems the AMD driver packages in Debian contain both amdgpu and radeon drivers; the radeon driver is used by default on my hardware, but kernel modules for both amdgpu and radeon are loaded, and both try to create the same directory. 

The solution was to use the amdgpu driver as documented at the Debian Wiki. The amdgpu driver supports modern GPUs. Mine is older, and radeon is used by default because it's more stable, but it's also possible to use the amdgpu driver experimentally. For some reason, although both modules are still loaded, the error messages do not appear when using the amdgpu driver.

[More information on amdgpu on older chips in this article:

The Current State Of Older AMD Graphics Hardware On Linux: What Driver To Use And What To Expect (Linux Reviews)]

The following command got me the name of the GPU card:

# lspci -nnk | grep -i vga -A3 

00:01.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Mullins [Radeon R2 Graphics] [1002:9853] 

Subsystem: Toshiba Corporation Mullins [Radeon R2 Graphics] [1179:f910] 

Kernel driver in use: amdgpu 

Kernel modules: radeon, amdgpu

(When I first ran the command, radeon was the driver in use.)

I found that Mullins belongs to the Sea Island family at the Gentoo Wiki.

To enable amdgpu on an older Sea Island card, I followed the advice at the Debian Wiki and edited etc/default/grub:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash radeon.cik_support=0 amdgpu.cik_support=1"

Update grub afterwards with 

# update-grub2.

For my GPU, the E1-6010, amdgpu apparently breaks hibernate to disk, but it does fix the Systemd messages as posters have noted at the Arch Linux Forum thread linked to in the original post. It also enables Vulkan, a replacement for OpenGL rendering with better performance.

Although I no longer get the original errors messages, I noticed a new one:

 [6.710082] kfd kfd: amdgpu: MULLINS  not supported in kfd

As far as I can work out, this relates to use of the GPU to assist with mathematical computations by some applications, which doesn't affect me, so I'm calling this one fixed.




Saturday, October 23, 2021

Gnome music is irredeemably ...

Update: I have discovered that music appears after a reboot. I haven't found a "search/refresh library" option in Gnome Music. Does it exist? IMHO it probably needs one.

5 years ago:

Gnome Music doesn't find any titles in my music collection - again...

 


Image source

Today:

Currently listening to:

From my music folder. On Gnome. Which I like.

Gotta agree with tiberiousr from reddit (link at top) on this one: "...shit".




Wednesday, October 6, 2021

XFCE and Gnome memory usage compared

In a previous post I asked how much memory my laptop needed, and found the answer was more than ii had, so I added some

At the time I was using XFCE, but now the same laptop is running Gnome 3, so decided to compare memory usage.

XFCE used 912MB of memory when it had loaded (converted from 870MiB in the screenshot below).

Gnome uses 1.3GB when it has loaded.

With Firefox open, XFCE used 2.68GB (converted from GiB).
Gnome used 2.3GB with Firefox open.

In both cases, there were multiple active tabs open, although different web sites with different content. I didn't attempt to use the same web sites, and I am assuming that the different memory usage by Firefox was down to the different websites open in tabs at the time. Memory usage by browsers does vary wildly according to the number of tabs open and the content of those tabs.

On a computer with limited memory, XFCE can be a good option, although the memory saved can be eaten up quickly by modern web pages with their scripts, videos and images.

Both XFCE and Gnome are perfectly usable on this very low spec computer (with XFCE having a slight edge in snappiness on occasion), but adding the extra 4GB of memory has made both much more usable with a modern bowser with a dozen or more tabs open.


Tuesday, October 5, 2021

Evolution Calendar - Syncing and adding reminders

Adding events to the Evolution calendar is intuitive, so I won't go into details: click on a day, add a time and a description and the basic event entry is done.

After that I had a couple of issues that took me some time to work out.

The first was that as Gnome is integrated with my Google account, I expected the event to appear in my Android phone's calendar, but it didn't. I couldn't work out how to sync the evolution calendar with my Google account.

The answer is to select the Google calendar as the default calendar, because the local calendar (On This Computer) is set as the default.

Select your Google calendar account, right click and select Properties, then tick Mark as default calendar.

The next issue was setting reminders. As I usually forget upcoming events, I like to get plenty of reminders from my computer and phone, so I clicked on the Reminders tab and selected 15 minutes before from the drop down menu.

Gnome applications are usually intuitive to use, but I have to say this window was not. There are to my mind several problems that actually make it counter intuitive.

First of all is the infinitive in Pop up and alert: The infinitive in computer GUIs usually presents an opportunity to give a command: Play, Pause, Stop, for example. Yes, I want to Pop up and alert, what do I do about it? I expected an OK or Confirm option here. I think Alert 15 minutes before the start, or Alert set for 15 minutes before the start would be clearer. Maybe it's just me.

The second problem I had was that I like to set more than one reminder, and the Add button was greyed out. It wasn't just me here as someone else had the same problem. I wrote "was" because Evolution was updated overnight and the Add button is no longer greyed out, as you will see in the screenshot above: it sets the Custom option, which allows more than one reminder. The solution if you have a version of Evolution with the greyed out button is to choose Custom from the drop down list.


 


Monday, October 4, 2021

How to pixelate text in the Gimp

There are times when I want to post a screenshot, but need to obscure personal information, as in the screenshot above from my previous post. Pixelating the text is a good solution because it can make the text unreadable whilst still leaving an impression of the text. I did this some time before for a previous post, and needed to do it again today for another post, but had forgotten how to do it. This time I am going to write a quick tutorial to remind me how to do it next time, and to help anybody who might want to do the same thing.

First, open the image in the Gimp:

Then select the text you want to pixelate with the Rectangle Select Tool:

Next, cut the selection:

And paste as a new layer:

Go to Filters > Blur > Pixelise and reduce the size of your pixel blocks until the text is unreadable but still gives the impression of text. Be careful that it is not possible to still read the text if you squint - in this image I need to go one step further:

When you are happy that the text is unreadable, go to Image  > Flatten image:

And here is the final result:








Filter emails in Evolution

Here is a quick tutorial on how to filter emails in Evolution. It took me a while to work out how to do it, so I thought I'd make a note of what I did to remind myself when I inevitably forget later on, and to help anybody who wants to do the same thing.

First, right click on the folder where you want to create a new folder to put your filtered emails in. Click on (you guessed it) New Folder. I put mine in Google Mail > All Mail.

To filter emails by sender, right click on an email you want to create a filter for and select Create > Create a Filter Rule for Sender.

In the dialogue that appears, select the folder you created in the first step.

Click on Add Condition if the sender uses more than one address to send emails from. (My daughter's school has used four different domains to send emails, so I had to add four conditions.)

To apply the filter, click on Message > Apply Filter.

To filter all existing emails, select you inbox and click on Edit > Select All then  Message > Apply Filters.




Saturday, October 2, 2021

Boot message - Failed to start

Update: solved (see below).

Booting up my installation of Debian Testing (Bookworm) I noticed this message:

 
 
[FAILED] Failed to start: Raise network interfaces.

See 'systemctl status networking.service' for detials.

Was this something bad? I hadn't noticed anything like it before. The word 'FAILED' in capital letters and red made me worried.

Systemd does not apparently keep a log of these boot messages. To find a failed command, issue the following command:

# systemctl --failed

  UNIT               LOAD   ACTIVE SUB    DESCRIPTION
● networking.service loaded failed failed Raise network interfaces

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.
1 loaded units listed.

To see networking.service messages, issue this command:

# journalctl -u networking.service --no-pager
-- Boot e29338dc96c041638d5b465983e41817 --
Oct 02 18:35:32 Toshiba-laptop ifup[618]: Cannot find device "eth0"
Oct 02 18:35:32 Toshiba-laptop ifup[552]: ifup: failed to bring up eth0
Oct 02 18:35:27 Toshiba-laptop systemd[1]: Starting Raise network interfaces...
Oct 02 18:35:29 Toshiba-laptop systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
Oct 02 18:35:29 Toshiba-laptop systemd[1]: networking.service: Failed with result 'exit-code'.
Oct 02 18:35:29 Toshiba-laptop systemd[1]: Failed to start Raise network interfaces.


Well, that clears that up: there's no Ethernet cable plugged into this computer. 

 

Update: I found the source of this issue (Debian User Forums). It is not the system looking for an Ethernet connection that happens to be unplugged, but the system looking for an Ethernet connection that does not exist, due to some unexplained entries in a configuration file, namely:

/etc/network/interfaces.d/setup

The entries below were causing the system to try to bring up network interfaces at boot time. Commenting them out got rid of the "Failed" message.

auto lo 

iface lo inet loopback 

auto eth0 

iface eth0 inet dhcp/

The  only mystery now is what added those lines when they shouldn't be there? Suspicion at the moment falls on the Debian Live Non-Free installation media, which I used to install Debian Bullseye.

Monday, September 27, 2021

Installing Brother HL-1212 W-Fi Mono Laser Printer in Debian Bookworm/Bullseye (Gnome)

[Update 2: The latest version of printer-driver-brlaser works without issue now in Bookworm post release and Trixie (Testing), which both at version 6.3 at the time of writing. Bullseye still has 6.1, so the issue may remain.]

[Update: Unfortunately printer-driver-brlaser is affected by a bug that means documents with images sometimes fail to print with no error message at all. Gnome says the document has printed successfully, CUPS says the document has printed successfully, but nothing appears from the printer, not even blank pages, and the printer records no error.

Back to the driver from the Brother web site then.

See Google Groups, and Github. The driver is patched on Github but it seems there is no Debian maintainer for the package, so no hope for the moment that the Debian package affected (6.2) will be fixed any time soon.]


The Brother HL-1212 WiFi printer does not do driverless printing. See previous post. "Modern" printers don't need drivers, but budget printers like this one (still on sale at the time of writing) seem to date back a decade or two and need drivers.

Previously, I downloaded a driver installation tool from Brother (which worked very well). I am now using Debian Bookworm (Testing), and found today that Debian has included a driver for this printer it its repositories in Bullseye, namely in:

printer-driver-brlaser

Adding the printer was a very easy process. In the printer dialogue click "Add". The printer dialogue found the printer without adding the network address, although there is an option to search by IP address. Three options came up - the printer name, the printer name with some sort of address I didn't recognise appended to it, and a CUPS reference. I chose the first one and the printer entry that came up printed a test page straight away. (Gnome Software said it needed to look for additional things to install, went away and did so, and came back to say it couldn't find anything, but the printer worked anyway.) 

The printer entry contained fields for driver and address, so I selected/entered those, even though the printer seemed to work OK already.

The HL-1212W is available in the UK from Argos with four additional toner cartridges for £159.99, which is quite a good deal if you do a lot of printing.



Tuesday, June 15, 2021

Things that are broken in Debian Bullseye - Thunderbird

An update of Thunderbird (1:78.10.0-1) to 1:78.11.0-1 yesterday seems to have broken it. It says:

Authentication failure while connecting to server imap.gmail.com

I though maybe that Google's strict security didn't recognise the new version so I tried resetting third party app access, but that just got me an error message:

NS-ERROR-NET-INADEQUATE-SECURITY

Thunderbird seems to have had this issue before and a previous fix worked for me.

There are bug reports already here and here and here. The same fix has been noted here.

I am not sure if the fix:

network.http.spdy.enabled.http2 = false

introduces any security risk.

Saturday, May 15, 2021

Blogger deleting posts in error

I woke up this morning to find five emails from Google Blogger telling me that posts had been deleted because they violated Google's terms on Viruses and Malware. What? A weather script for Conky? A post describing how I added memory to my laptop? Either somebody is injecting malicious code into Blogger posts, or this is an error, I thought. My best guess is it's a false positive detection of malicious content by Google. A quick Google found several people who had experienced the same issue on Blogger Help.

I got an email this morning that one of my blog posts was deleted for going against community guidelines.

I literally post about nail polish and using all my own images so there is no way it breaks any rules, so I’m confused and a little annoyed that it’s been totally deleted not just turned to draft so I can’t recover any of what I had written. Is there anything I can do about this or stop it happening again?!
 
And
 
I had written a blog yesterday about my son's battle with cancer and somehow received a phishing warning on my blog site. 

I'm not even entirely sure what happened or how this happened, but my Thursday, May 13th post was deleted by blogger saying I had violated their malware and viruses policy. 

I'm so confused by all of this and not sure if it was a link to a resource or what exactly was the cause of this - I link many medical terms regarding his diagnosis so people can learn more about them. But since this was completely deleted I don't have a way of recovering this blog (which is basically a journal of my son's cancer battle). 

Is there a way I can obtain this basic text from blogger or even from cached files on my local computer? I seem to be at my wit's end.
 
All seem to be getting the same stock answer:
 
Hi:  your posts may have been removed in error. 
Blogger is aware of the issue and working on a fix.
Looks like Google Blogger is going to owe a lot of people a serious apology. It seems no actual human being looked at the posts before they were deleted to see if they actually contained anything malicious. Deleting posts without human supervision, explanation or opportunity for appeal or review? Pretty bad look if it turns out to be an error.

UPDATE: I received emails to say that my posts have been reinstated (without explanation or apology), but the posts seem to have been reinstated as drafts. I hit the Publish button for all of them, so hopefully they are up again.

Monday, April 12, 2021

An update on Debian updates

I recently wrote several posts on updates in Debian, on XFCE and Gnome, Bullseye and Buster.

The default, I wrote, was no notifications of updates by default on XFCE in Bullseye, and no automatic updates, and notification of updates and automatic installation of security updates in Gnome on Buster.

However, after applying the same default to XFCE, I noticed that I was actually getting automatic updates to all packages.

Sure enough, Gnome on Buster was also getting more than security updates.

It turns out that unattended-upgrades (the package which installs automatic updates in Debian,  actually updates all packages by default in Debian Buster and later. (The default in previous version of Debian was security updates only.)

I discovered this in a post on the Debian User Forum, which linked to the Debian Buster release information page. I found the NEWS.Debian file thanks to Debian documentation

It reads: 

Unattended-upgrades in previous versions defaulted to install security updates only on Debian by using the label=Debian-Security origin pattern. Now it is changed to allow updates with label=Debian, which allows applying stable updates in stable releases and following all package updates in testing and unstable. 

In stable releases this unlocks installation of security updates depending on package versions present only in stable updates. 

Note that testing and unstable can often contain packages for which installation or upgrade performed by unattended-upgrades fails and requires the administrator to fix the system later.

My fault then for not reading the release information when I upgraded from Stretch.

The Debian Wiki page says:

The purpose of unattended-upgrades is to keep the computer current with the latest security (and other) updates automatically.

Which to me implies that other updates are optional, but obviously not.

I have updated the post on automatic updates in XFCE.  As I am currently using XFCE on Debian Testing, I have disabled updates to all packages by commenting out the line:

//      "origin=Debian,codename=${distro_codename},label=Debian";

I have checked my Gnome installation on Debian Buster, and it also contains the line above, which means that "stable updates" are applied automatically. I've also updated my post on automatic updates in Gnome.

Interestingly, the Gnome Blog states that Gnome will not install updates automatically. unattended-upgrades is a system package and overrides Gnome in Debian, which explains why Gnome notifies me of available updates, but they often disappear before I can install them, with the exception of Chrome, whose repository is not included in unattended-upgrades. NB unattended-upgrades is triggered to run within a randomised period, so the time that update notifications, whether those displayed by default in Gnome, or by the options I described in XFCE (Conky, Genmon), may appear for a few minutes or a few hours before disappearing if you have unattended-upgrades installed.

I hope this post helps anybody struggling, like me, to work out how automatic updates happen in Debian. Apologies for any confusion caused previously.


 


 



Tuesday, March 23, 2021

Update notifications in Conky

 

An improved Conky system updates notification for Debian (The first version and information on how to enable package list update if you are not using Gnome, which I assume you're not, as Gnome already has update notifications.). This one includes the time of the last package list update so you can see that the system is actually checking for updates, and tells you if there are any security updates (it should list package names to if there are security updates, but I haven't been able to test this yet.) The script requires aptitude.

I used the following code:

Linux - display or upgrade security updates only using apt

How to know last time `apt-get update` was executed?

if_match in Conky

DevHumor

Here's the code:

${if_match ${execi 1800 aptitude search "~U" | wc -l}==0}\ ${alignr}No updates available ${alignr}${color grey}Last check:${color} ${execi 1800 ls -l /var/cache/apt/pkgcache.bin | awk '{print $6,$7,$8}'} ${else}${alignr}Updates available: ${execi 1800 aptitude search "~U" | wc -l} ${alignr}Security: ${execi 1800 aptitude search '~U ~ODebian' -F "%p %O"|awk '/Debian-Security/' | wc -l}  ${execi 1800 aptitude search '~U ~ODebian' -F "%p %O"|awk '/Debian-Security/ {print $1}'} ${endif}

EDIT:

Replaced

${execi 1800 ls -l /var/cache/apt/pkgcache.bin | cut -d' ' -f6,7,8}

with

${execi 1800 ls -l /var/cache/apt/pkgcache.bin | awk '{print $6,$7,$8}'}

The first command would only output the date when the date was one digit only.

[Edit 24/8/21: Bullseye is now released and the first security updates have arrived, allowing me to test the script. I have corrected a typo which meant number of security updates was not displayed.]




Thursday, March 18, 2021

Configure automatic updates Gnome

If you search for "configure automatic updates gnome" (without the quotes), the third result will be from help.gnome.org, which you'd think might be useful, but isn't. The Gnome Help site is rubbish, not by virtue of being badly written or designed, but by virtue of being thirteen years out of date. It refers to Gnome 2 (does anybody use Gnome 2 in 2021) and is not relevant today.

The Gnome Blog states that Gnome allows the automatic installation of updates, with configuration options in Gnome Software for installation and notification of installation, for but this turns out to be for Flatpacks only.

So here is a quick guide to configuring automatic updates in Gnome - in this case on Debian Buster.

The Gnome Help page refers to PackageKit being updated by a cron-job. (PackageKit being an update system that works in different distributions and cron being a job-scheduler.)

This was true in 2007, but today it's the Systemd scheduler that triggers updates, as I wrote about here. In XFCE this is not enabled by default, but in Gnome it is, because the package unattended-upgrades is installed, which sets a configuration file which tells APT (the Debian package manager) to check for updates and automatically install security updates when it is triggered by the Systemd timer.

Configuration is done via launching Software & Updates, or  Synaptic > Settings > Repositories (it's the same window).

We can confirm that configuration settings are set in the unattended-upgrades configuration file 20auto-upgrades by watching it as we change the check interval.

 

You can of course change the configuration directly by editing the file in etc/apt/apt.conf.d if you wish. It's also possible to turn automatic installation of security updates off via the GUI or the configuration file.

If you look in that folder you will also notice a file called 20packagekit, which is there to make sure PackageKit knows about updates too.

I presume it is still PackageKit that Gnome Software uses to notify you of available updates. I will have to leave that for another investigation. I don't use Gnome Software because it always asks to restart the computer to install updates even through this is not necessary. Maybe it's possible to configure that too.

For now, I hope this post is useful to somebody like me who has observed updates in Gnome 3 and wondered what was happening.


[Edited for accuracy and clarity.]

[Corrected to reflect the fact that Unattended Upgrades actually installs all packages by default in Debian Buster and later.

The default setting for Unattended Upgrades was changed in Buster. The previous default was to apply security updates, but the default now is to update all packages.

I found a note in the "News" file (found in /usr/share/doc/unattended-upgrades) which states:

Unattended-upgrades in previous versions defaulted to install security updates only on Debian by using the label=Debian-Security origin pattern. Now it is changed to allow updates with label=Debian, which allows applying stable updates in stable releases and following all package updates in testing and unstable. 

In stable releases this unlocks installation of security updates depending on package versions present only in stable updates.]






Friday, March 12, 2021

XFCE Genmon weather script - New & Improved

Update: A commentor has pointed out that the output of ansiweather has changed since this post, adding an extra space which means all the printed outputs are wrong, because they are done according to position in the output. I had already corrected the script for myself but hadn't got round to editing the post. I can't remember if I have corrected all the "print" commands to reflect the line space change, or just the ones I use. If any output is garbled, please post a comment and I'll look at the script again.

The corrected script is here: GenMon weather script at PasteBin.

Thanks to Anonymous for pointing this out.

I tidied up the old script and added new information available from ansiweather (which the script requires). I made it easy to choose which information to display and the units of measurement by commenting out lines.

And added a notification icon if there is no internet.

The script only requires you to add a city and country once at the top. There are various options for what happens when you click the temperature- go to the website, refresh, or show ansiweather in a terminal. Make sure only the one you want is uncommented. If you choose the refresh option, you will need to find the Genmon ID in your panel, as this varies. Hover over Genmon in Panel Preferences>Items.

As before, save the script in a suitable location and make it executable. Add an instance of Genmon in the panel, enter the path to the script and choose a suitable refresh time in seconds.

 

#!/bin/bash
#dontsurfinthenude.blogspot.com/

location=paris,fr
#try city,country code or look up at openweathermap.org
data_metric=$(ansiweather -l $location -u metric -s true -a false -d true)
data_imperial=$(ansiweather -l $location -u imperial -s true -a false -d true)
#comment out one if you want only metric or only imperial
data7day=$(ansiweather -l $location -u metric -s true -a false -f 7) #centigrade
#data7day=$(ansiweather -l $location -u imperial -s true -a false -f 7) #fahrenheit

city=$(echo "$data_metric" | awk '{print $3}')
temp=$(echo "$data_metric" | awk '{print $5$6}') #city,temp,°C
#temp=$(echo "$data_imperial" | awk '{print $5$6}') #city,temp,°F
symbol=$(echo "$data_metric" | awk '{print $7}')
#wind=$(echo "$data_metric" | awk '{print $9,$11,$12,$13}') #wind,m/s
wind=$(echo "$data_imperial" | awk '{print $9,$11,$12,$13}') #wind,mph
humidity=$(echo "$data_imperial" | awk '{print $15,$17$18}') #humidity
pressure=$(echo "$data_metric" | awk '{print $20,$22,$23}') #pressure,hPa
#pressure=$(echo "$data_imperial" | awk '{print $20,$22,$23}') #pressure,inHg
sunrise=$(echo "$data_metric" | awk '{printf "%7s %.5s %s\n", $25,$29,$30}') #sunrise
sunset=$(echo "$data_metric" | awk '{printf "%-7s %.5s %s\n", $32,$36,$37}') #sunset

forecast=$(echo "$data7day" | awk 'BEGIN {format="%s %7s%s  %s\n"} #7-day-forcast
            {printf format, $4,$7,$8,$9}
            {printf format, $11,$14,$15,$16}
            {printf format, $18,$21,$22,$23}
            {printf format, $25,$28,$29,$30}
            {printf format, $32,$35,$36,$37}
            {printf format, $39,$42,$43,$44}
            {printf format, $46,$49,$50,$51}')


PANEL="<txt>$temp</txt>"
PANEL+="<txtclick>firefox --new-tab --url https://openweathermap.org/city/$location[city code number]</txtclick>"
#PANEL+="<txtclick>xfce4-panel --plugin-event=genmon-*:refresh:bool:true</txtclick>"
#Replace "*" with the ID number from the XFCE panel - Preferences>Items (Hover)
#PANEL+="<txtclick>xterm -hold -e  ansiweather -l $location -s true -f 7</txtclick>"

TOOLTIP="<tool>"
TOOLTIP+="<span weight='bold' font='sans regular'>W E A T H E R</span>\n\n"
TOOLTIP+="<span font= 'sans regular'>$city</span>\n"
TOOLTIP+="Now: $temp $symbol\n\n"
#TOOLTIP+="<span font= 'sans regular'>$wind</span>\n"
#TOOLTIP+="<span font= 'sans regular'>$humidity</span>\n"
#TOOLTIP+="<span font= 'sans regular'>$pressure</span>\n\n"
TOOLTIP+="<span font= 'monospace regular'>$forecast</span>\n\n"
TOOLTIP+="<span font= 'sans regular'>$sunrise</span>\n"
TOOLTIP+="<span font= 'sans regular'>$sunset</span>\n\n"
#TOOLTIP+="<span weight='bold' font='sans regular'>Click to update</span>"
TOOLTIP+="<span weight='bold' font='sans regular'>OpenWeather</span>"
TOOLTIP+="</tool>"


if [[ -z "$data7day" || "$data7day" == "ERROR: Cannot fetch weather data" ]]; then

echo "<icon>network-offline</icon>"
echo "<tool>No Internet</tool>"
else
  echo -e "${PANEL}"
  echo -e "${TOOLTIP}"
fi

[Edit: you will have to go to openweather.org and search for the city code number for your town if you want to open the web page on clicking the icon. The script passed the town and city details to the browser, but my browser was opening the correct location because I'd used the page before.]



Monday, March 8, 2021

Things that are fixed in Debian Bullseye

A kernel and lots of firmware updates and Bluetooth is working!

This fixes the issue of the kernel not recognising the Bluetooth adapter because the vendor had reused the chip identifier, with the following message in dmesg.

Bluetooth: hci0: don't support firmware rome 0x31010100

A simple Conky weather script

The script requires ansiweather. It's pretty much self explanatory. Add your town and country code, comment out items you don't want, or double up for extra locations.

#!/bin/bash
#dontsurfinthenude.blogspot.com/

location=london,GB
#try city,country code or look up at openweathermap.org
data_metric=$(ansiweather -l $location -u metric -s true -a false -d true)
data_imperial=$(ansiweather -l $location -u imperial -s true -a false -d true)
#comment out one if you want only metric or only imperial
forecast=$(ansiweather -l $location -u metric -s true -a false -f 7)

echo "W E A T H E R"
echo ""
echo "$data_metric" | awk '{print $3,$5$6,$7}'#city,temp,°C
#echo "$data_imperial" | awk '{print $3,$5$6,$7}'#city,temp,°F
echo ""
echo "$data_imperial" | awk '{print $9,$11,$12,$13}'#wind,mph
#echo "$data_metric" | awk '{print $9,$11,$12,$13}'#wind,m/s
echo "$data_metric" | awk '{print $15,$17$18}'#humidity
echo "$data_metric" | awk '{print $20,$22,$23}'#pressure,hPa
#echo "$data_imperial" | awk '{print $20,$22,$23}'#pressure,inHg
echo ""
echo "$data_metric" | awk '{printf "%7s %.5s %s\n", $25,$29,$30}'#sunrise
echo "$data_metric" | awk '{printf "%-7s %.5s %s\n", $32,$36,$37}'#sunset 
echo ""
echo "Forecast"
echo ""
echo "$forecast" | awk 'BEGIN {format="%s %7s%s  %s\n"}
            {printf format, $4,$7,$8,$9}
            {printf format, $11,$14,$15,$16}
            {printf format, $18,$21,$22,$23}
            {printf format, $25,$28,$29,$30}
            {printf format, $32,$35,$36,$37}
            {printf format, $39,$42,$43,$44}
            {printf format, $46,$49,$50,$51}'
echo ""
echo openweather.org



Sunday, March 7, 2021

Toshiba laptop gets a memory upgrade

Previously on this blog I described how my laptop was using 93% of its available RAM and 69% of available swap memory after a few hours use, largely due to having a dozen or more browser tabs open. Not an ideal situation. That doesn't leave any memory available to open up a word processing application or an image editor without the computer slowing down as Firefox is forced to cache tab content to disk. I have noticed that with several memory-intensive programs running, background programs are very slow to reopen, presumable because they have cached content to the disk. And of course with both RAM and swap (virtual memory) almost full, it leaves the computer likely to experience thrashing and crashing, if a program uses too much memory, whether due to me asking it to work on a large file, or some sort of bug causing excessive memory use.

So, time for some new memory. I found an identical card to the existing 4GB card in the laptop on eBay and popped it in the empty slot.

I didn't take a picture, but I have one from when I cleaned the fan (hence the very dusty fan in the corner). The procedure is very simple. Pull out the metal cover between the two sockets, put in the new card pins into socket at a 45 degree angle, push it down till it clicks, and replace the metal cover. Be careful because it has a lug on one side that goes into a hole in the board. Don't forget to earth yourself. I put my naked toe on the copper radiator pipe - only issue in the winter, it's hot, ouch!

A useful command to check memory is:

dmidecode --type memory | less

Which tells you about the cards installed, including manufacturer, part number and specification, all of which matched for my eBay card, although the label was different - something I will have to investigate later.

Here is a comparison shot of Task Manager with 43(!) tabs open in Firefox.

Swap memory has also increased since my previous post, when the laptop had 975MB of swap. The default installation of Debian Bullseye created this much swap. Supposedly this is done automatically according to memory and hard disk space available, but my other computer has the same amount of memory and the same hard disk size, and yet it has four times as much swap.

There are a lot of different recommendations for swap size on the internet, but 975MB certainly seems too small a size - it certainly isn't big enough to hibernate the computer because that involves writing the entire memory to disk, and 4GB won't fit in 975MB. Swap memory was at 69% as mentioned before, which doesn't allow much room for manoeuvrer. 

Increasing the size of swap memory was actually fairly easy, but it does involve booting into a GParted live CD or USB. Once I had done so I could shrink the main partition to make room for the swap partition to expand. The swap partition is found inside an extended partition, at the "end" of the main partition, so it's necessary to move the extended partition to the left before expanding the swap partition.

Grab the arrows at the ends of the partition to resize because the buttons take forever.

I gave the extended swap partition 9542MB, a fairly arbitrary figure, but as I actually did this before adding the extra RAM, it meant I had over twice as much swap as RAM. Surely enough to hibernate?

I tried hibernating the computer, but unfortunately ran into a video driver bug that means the screen remains blank after coming out of hibernation.

kernel: [drm:radeon_dp_link_train [radeon]] *ERROR* displayport link status failed
kernel: [drm:radeon_dp_link_train [radeon]] *ERROR* clock recovery failed
kernel: [drm:radeon_dp_link_train [radeon]] *ERROR* displayport link status failed
kernel: [drm:radeon_dp_link_train [radeon]] *ERROR* clock recovery failed
Oh, well. On a 500GB disk, I'm not really missing 9.5GB. The computer hasn't touched available swap space since I installed the new memory, but maybe the video bug will get fixed and allow hibernation at some point.




 



Thursday, March 4, 2021

People also search for...

I noticed an annoying feature of the Google search page recently. If you do a search, click a link, look at the page and click back, just as you are about to click on the next link, a Google pop-up entitled "People also search for" displaces the link you were about to click so you click on a link you don't want, and have to go back again, whereupon the same thing happens again. Ad infinitum.

I think this is called recursion in computing.

The Gif above (I used ezgif.com) when searched Google for information about the pop-up.

The link I was about to click would have taken me to the answer to this stupidity: the excellent uBlock Origin, which I had been using until a few weeks ago, probably why I hadn't observed it before. For the last few weeks I've been using Bluhell Firewall, another excellent ad-blocker. I used this previously until it stopped working, but it has recently been updated to work with Firefox WebExtensions. It blocks most of the nonsense on the net, but obviously not this bit. It is a bit lighter than uBlock.

Another possible solution, if this feature of Google search annoys you as much as it does me is Startpage, a search page that gets its results from Google but without the tracking. By default the first three links it shows are search suggestions, but you can turn that off in settings (or leave it on to give them some ad revenue - unfortunately I found it meant I didn't see the results I wanted without scrolling down the page, which is a bit self-defeating, sorry Startpage). You can also change the default setting for search results to open in a new tab (window in settings).

Doh! More recursion.












Tuesday, March 2, 2021

How much memory does a laptop need?

I bought a laptop in 2003 which had a single core CPU, a 30GB hard disc, and 256MB of RAM. It used to grind to a halt if I opened too many programs.

This laptop was a cheap, low-end laptop, bought in 2015. It has a dual core CPU, a 500GB hard drive, and 4GB of RAM. (And was a sixth of the price of the previous one.)

That is sixteen times as much memory.

But it still sometimes grinds to a halt if I have a lot of programs open. The program I'm working in works OK, but switching to another program can take a long time. Why? Because the memory is full and background programs have been moved to swap, or virtual memory as it's called in Windows. (I'm using XFCE.)

How come a computer with sixteen times as much memory as my 2003 laptop still doesn't have enough? Let's have a look.

The graphics card takes a 700MB bite out of memory before the OS (Debian Linux) loads. XFCE is a light desktop, but even then, the OS and desktop alone takes up almost 870MB of memory.

Let's open up Firefox.

Memory usage jumps to 1.5GB, 47%, with a dozen or more tabs open from yesterday. But those tabs are blank, with the contents cached to the hard drive. Let's look at each tab so the contents are in memory.

78% memory usage, 2.5GB. Now let's open another program.

86% memory usage, 2.8GB, and the computer is starting to use swap memory - writing memory to the hard disc. Swap memory is 9% full.

Later in the day, after several hours use:

93% memory use, 3GB, with swap 69% full, 675MB. Switching between programs and tabs is now going to be slow, as the computer has to retrieve memory from the hard disc.

Time to close a few tabs in Firefox:

The biggest memory hog is obviously Firefox, but at least part of the reason for this is that web pages are now huge. Back in 2003 I was using dial-up, and web pages weren't full of images and videos and scripts because it would have taken a day to load one of today's pages.

It seems the answer to the question in the title is: more than 4GB.

The good news is my laptop has a free memory slot, and I found an identical memory card to the one installed for a reasonable price on ebay. 

In a few days the laptop will have 8GB, which seems to be the recommended minimum these days. I will post again on how much of an improvement in performance I see.