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.]