Re: moving some packages back to bookworm stable

2024-05-27 Thread Max Nikulin

On 27/05/2024 21:28, Michael Grant wrote:

What I want to do is get the system back to just using the packages
from stable rather than testing.


I have never tried the following, so it is better to test it in a 
virtual machine or inside a container. I would try to set priority of 
bookworm release high enough to allow downgrade. See apt_preferences(5) 
for details concerning pinning. However downgrade of libc makes "apt 
upgrade" really risky.


Do not forget to remove configuration with excessive priority afterwards.



Re: Markup in mail messages

2024-05-18 Thread Max Nikulin

On 17/05/2024 18:10, Greg Wooledge wrote:

On 17/05/2024 10:16, Karl Vogel wrote:

https://github.com/aaronsw/html2text/ might interest you.  It converts
(relatively) sane HTML into Markdown.

I put html2text.py into $HOME/lib and use this to call it:

  #!/bin/sh
  #
[...]

https://mywiki.wooledge.org/WrapperScript

Short version: "$@" is good enough if your /bin/sh isn't museum-era.
${1+"$@"} works around a bug in some very old shells.


Thanks. I am unsure if a python2 script from 2011 is consistent with a 
sh expanding "$@" to empty string, but the reason of the construct might 
be just muscle memory or some guide.


The wiki article considers a symlink that was my original idea. It seems 
"exit 1" can not ensure certain exit code even if exec fails (at least 
with current versions of dash and bash). In addition I see no value of 
/usr/bin/env in shell script. It is appropriate for the python script 
shebang "#!/usr/bin/env python" (present since its initial commit).


P.S.
Portable shell section in autoconf manual mentions "${1+"$@"}" issues 
with zsh (the script above requires /bin/sh explicitly):

https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/autoconf.html#index-_0022_0024_0040_0022




Re: Markup in mail messages

2024-05-17 Thread Max Nikulin

On 18/05/2024 02:25, Stefan Monnier wrote:

Actually I've been tempted to teach my mail reader to transform HTML
into some lightweight markup (yeah, you need a bit of heuristics for
that ;-) -- say Org, but why not its poor sister Markdown.

Please don't settle for markdown. I would love a org filter!
org-mode just handles tabular data admirably 


Just beware that Org's code is generally written under the implicit
assumption that the Org document is trusted, so if you try to reuse
parts of Org's code to do the rendering be extra mindful of the
potential for security holes.


Leaving aside that in bookworm emacs has not got an update fixing a 
serious security issue, do you have an example of HTML to Org converter 
that may generate unsafe markup?


Specifically to tables, I do not like that arbitrary code may be 
executed in response to TAB or C-c C-c. However I am unsure if formulas 
may appear in an Org file converted from HTML.


emacs-orgmode. Re: [BUG][Security] begin_src :var evaluated before the 
prompt to confirm execution. Fri, 28 Oct 2022 11:11:18 +0700.

https://list.orgmode.org/tjfkp7$ggm$1...@ciao.gmane.io


[ This applies to many other ELisp packages, of course; it's not
   exclusive to Org.  ]


Yesterday reading bug reports and emacs-devel threads related to 
emacsclient-mail.desktop, I noticed the following:

IMHO we should stop kow-towing to the information security people who
make a huge fuss over every single bug, especially bugs like this one
which only show up when you specifically try to trigger them.






Re: Onboard not showing up in the XFCE system tray | Partial Solution

2024-05-17 Thread Max Nikulin

On 18/05/2024 08:15, Charles Curley wrote:

charles 2913  0.0  0.9 545852 36740 ?Sl   May12   0:26
/usr/bin/python3 /usr/bin/onboard
--not-show-in=GNOME,GNOME-Classic:GNOME --startup-delay=3.0


Perhaps it starts through /etc/xdg/autostart/onboard-autostart.desktop

I have no idea if --not-show-in=GNOME,GNOME-Classic:GNOME may affect XFCE.



Re: Bookworm's /etc/mailcap seems to break s-nail

2024-05-17 Thread Max Nikulin

On 16/05/2024 14:48, Jonathan Dowland wrote:

On Wed May 15, 2024 at 4:51 PM BST, Max Nikulin wrote:

https://bugs.debian.org/1071036
update-mime does not escape semicolon in .desktop Exec entries


Re-reading your bug report I'm struck by how hard to reason about
(and test) the emacs .desktop Exec= line is. Personally I'd break
that out to a separate wrapper script, which wouldn't fix the root
issue you've identified, but wouldn't trigger it.


You may file an issue to the emacs bug tracker. I agree that more simple 
Exec entries in .desktop files will be easier to maintain.


However at least one developer was against wrappers:
https://debbugs.gnu.org/57752#8
Lars Ingebrigtsen, Tue, 13 Sep 2022 14:19:47 +0200

I'd prefer to have a .desktop file that works without any helper
scripts.


Later CVE-2023-27985 and CVE-2023-27986 were assigned for quoting in 
emacsclient .desktop files and there was an intermediate step:

https://debbugs.gnu.org/60204

Actually a feature that allows to simplify .desktop files was added to 
the development branch despite strong opposition:

https://debbugs.gnu.org/65902

-Exec=sh -c "u=\\$(echo \\"\\$1\\" | sed 's/[\\"]/&/g'); exec emacsclient --alternate-editor= 
--display=\\"\\$DISPLAY\\" --eval \\"(message-mailto \\"\\$u\\")\\"" sh %u
+Exec=emacsclient --alternate-editor= --eval "(message-mailto (pop 
server-eval-args-left))" %u


From my point of view, the following stance is spectacular:
https://debbugs.gnu.org/65902#79
Eli Zaretskii, Thu, 14 Sep 2023 16:36:06 +0300

Emacs developers make mistakes even in the simple regexps we have in
our code.  That doesn't mean we should abandon regexps.  The solution
for sending Lisp forms to the server exists, and the quoting, although
tricky in some cases, is not rocket science to get right.


emacsclient.desktop still has a complex shell command.

By the way, I have not noticed handling of %f substitutions in Emacs 
code for handling .desktop files, not to mention \n, \t, \s

https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/dired-aux.el#n1364
shell-command-guess-xdg function

Finally, I think that s-nail should ignore malformed mailcap entries.

On 16/05/2024 14:48, Jonathan Dowland wrote:

Please do not CC me for listmail.


You still decided to add my address to CC despite I joined to the 
thread, not started it. I expect it is enough to guess that I am able to 
follow the discussion even not being subscribed.





Re: Markup in mail messages

2024-05-16 Thread Max Nikulin

On 17/05/2024 10:16, Karl Vogel wrote:

   https://github.com/aaronsw/html2text/ might interest you.  It converts
   (relatively) sane HTML into Markdown.

   I put html2text.py into $HOME/lib and use this to call it:

 #!/bin/sh
 #

I am puzzled by this wrapper. I expect that "$@" is enough here and 
namely {1+"$@"} is redundant. Am I wrong?


Another question is what is advantage of a decade old Python-2 script 
over the python3-html2text Debian package built (almost certainly) from 
its successor:






Re: Regression in Radeon driver in latest Debian Stable kernel

2024-05-16 Thread Max Nikulin

On 16/05/2024 22:53, piorunz wrote:

https://bugzilla.kernel.org/ will they be interested in Debian specific
error? I don't use vanilla kernel so maybe it's Debian only problem.


If you *find* a similar report there then it is likely an upstream 
issue. (Developers of specific driver may use another bug tracker.)


Do you have a recipe how to trigger the bug? Otherwise it may be much 
harder to fix it.


Be realistic, to get the bug fixed, there should be affected persons 
motivated enough to try vanilla kernel or even to build custom kernels 
with provided patches. Developers time is limited and expensive 
resource. It may be directed to fixing other bugs. If you can compare 
Debian and upstream kernels you may get the issue fixed quicker. Direct 
communication with driver developers may be more effective.




Re: Markup in mail messages

2024-05-16 Thread Max Nikulin

On 16/05/2024 20:47, to...@tuxteam.de wrote:


Actually I've been tempted to teach my mail reader to transform HTML
into some lightweight markup (yeah, you need a bit of heuristics for
that ;-) -- say Org, but why not its poor sister Markdown.


I am not familiar with pandoc features enough to reason if it is safe 
from security point of view.


for i in org markdown commonmark gfm ; do
printf 'Bold %s' "$i" | pandoc -f html -t "$i" ;
done

*Bold org*
**Bold markdown**
**Bold commonmark**
**Bold gfm**

I believed that some text browser should render HTML well enough to make 
messages readable in terminal.




Re: Regression in Radeon driver in latest Debian Stable kernel

2024-05-16 Thread Max Nikulin

On 16/05/2024 17:35, piorunz wrote:


As much as I would like to try vanilla kernel, I don't want to break my
system. I use Debian Stable, don't know if things would just work with
vanilla kernel.


You may try bookworm-backports kernel 6.6.13+bpo-amd64

You may check https://bugzilla.kernel.org/ for reports similar to your one.



Re: Bookworm's /etc/mailcap seems to break s-nail

2024-05-15 Thread Max Nikulin

On 07/05/2024 23:24, Max Nikulin wrote:

On 2024-05-06 17:04, Max Nikulin wrote:

So doubled backslashes (as in .desktop files) are correct.

What is wrong is lack of backslashes added before ";" and it is a bug.


I have filed
https://bugs.debian.org/1071036
update-mime does not escape semicolon in .desktop Exec entries

This particular bug almost certainly may be fixed by adding an extra 
line of perl code.


However 2 layer of quoting in .desktop files: special rules for Exec and 
general for any strings require more work to get entries properly 
escaped for mailcap in general case.


In the meanwhile I have realized that BASH implementation of parsing 
Exec entries in xdg-open fallback function search_desktop_file is really 
ugly:

https://gitlab.freedesktop.org/xdg/xdg-utils/-/blob/master/scripts/xdg-open.in?ref_type=heads#L312

I am unsure if it is possible to implement double quotes rule
https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s07.html

Since xdg-open usually delegates handling of URIs to the desktop 
environment, this code is active only for those who avoid any DE.




Markup in mail messages (was: Re: OT: Top Posting)

2024-05-14 Thread Max Nikulin

On 15/05/2024 02:32, Greg Wooledge wrote:

On Tue, May 14, 2024 at 08:16:20PM +0200, Nicolas George wrote:

Messages in Markdown in the Windows world? I have never seen it.

[...]

The only sensible interpretation I can
come up with for why these asterisks were added is that they're being
placed around text that's supposed to be emphasized/italicized.


*Bold*, /italics/, and _underlined_ markup is supported by various
mailers, e.g. Thunderbird and Gnus. Some render superscripts^1 and
subscripts_2 as well.

Backticks (`echo $PATH`) are more specific to markdown. However
sometimes I use them not expecting that the message will be rendered as
markdown. Just to avoid ambiguity where a piece of code starts and ends.




Re: Wifi getting disconnected randomly

2024-05-11 Thread Max Nikulin

On 11/05/2024 10:09, Jeffrey Walton wrote:

On Fri, May 10, 2024 at 11:18 AM Max Nikulin wrote:

I am not trying to dispute your suggestion, I had a hope to get a data
point with a success story.

In 2006 I was doing sysadmin work for the Nuclear Energy Institute. NEI 
performed a hardware refresh, and supplied ~50 employees with new Dell 
laptops. I don't recall the model, but they had integrated Intel wifi. 
The laptops would connect via wifi, and disconnect after about 10 
minutes. Dell support told us we needed to update the BiOS or UEFI. It 
fixed the problem.


So the data point is unrelated to 72.daa05125.0 cc-a0-72.ucode or to 
some other recent intel wifi card. It was my fault that I was not clear 
enough asking for details.


I think, 2 decades ago balance between platform firmware and per-device 
firmware loaded by drivers was different. A few years ago I have seen 
recommendations of intel wifi cards as reliable ones.


In bookworm, driver spits a warning that it can not find a firmware 
file. Actually it is not available and it is impossible to just download 
the "missed" file. It is intended for debugging and one has to request 
it and then has to send gathered data to intel developers. It is 
discouraging from my point of view.





Re: Wifi getting disconnected randomly

2024-05-10 Thread Max Nikulin

On 10/05/2024 22:09, Jeffrey Walton wrote:

On Fri, May 10, 2024 at 11:05 AM Max Nikulin wrote:
On 10/05/2024 06:07, Jeffrey Walton wrote:
 > On Thu, May 9, 2024 at 5:44 PM Unni wrote:
 >     [  278.360447] iwlwifi :09:00.0: Microcode SW error detected.
 >     Restarting 0x0.
 >     [  278.360571] iwlwifi :09:00.0: Loaded firmware version:
 >     72.daa05125.0 cc-a0-72.ucode
[...]
 > Install the latest UEFI firmware for the machine, and then re-run
the tests.

I do not mind that it is a useful suggestion in general and should be
followed, but I am curious if it has ever helped you in specific cases
of intel wifi cards.

My bad. I was talking about the manufacturer's UEFI firmware; not a 
linux-firmware package.


I am not trying to dispute your suggestion, I had a hope to get a data 
point with a success story.


To be precise concerning packages, it is firmware-iwlwifi 
(src:firmware-nonfree). Even unstable currently have a year old package, 
so for experiments it is better to take files from an upstream git 
repository. It requires kernel upgrade since the range of supported 
firmware versions is hardcoded.





Re: Wifi getting disconnected randomly

2024-05-10 Thread Max Nikulin

On 10/05/2024 06:07, Jeffrey Walton wrote:

On Thu, May 9, 2024 at 5:44 PM Unni wrote:
[  278.360447] iwlwifi :09:00.0: Microcode SW error detected.
Restarting 0x0.
[  278.360571] iwlwifi :09:00.0: Loaded firmware version:
72.daa05125.0 cc-a0-72.ucode

[...]

Install the latest UEFI firmware for the machine, and then re-run the tests.


I do not mind that it is a useful suggestion in general and should be 
followed, but I am curious if it has ever helped you in specific cases 
of intel wifi cards.


My experience with it is far from being positive. Some days firmware 
crashes are rare, some periods of time they happen every minute. I have 
not identified reasons, so results of debugging attempts would be 
unreliable. Sometimes restarting of the router helps. That is why I 
suspect that access points around may affect my connection.


My impression is that version of driver in backports kernel is more 
stable, however in addition I downloaded firmware newer than 72.


There are enough discussions, bugs, various suggestions concerning 
parameters of kernel modules. Downgrading firmware did not helped me. I 
have not noticed any improvements from disabling power save mode.


Some links:
https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi#about_platform_noise
https://bugzilla.kernel.org/show_bug.cgi?id=205123
https://bugs.debian.org/1026906
https://wiki.debian.org/iwlwifi

The relevant line from

lspci -nn

output should help to identify wifi adapter model.



Re: Bookworm's /etc/mailcap seems to break s-nail

2024-05-07 Thread Max Nikulin

On 07/05/2024 18:40, Jesper Dybdal wrote:

On 2024-05-06 16:24, Max Nikulin wrote:
2. It does not skip x-scheme-handler/* entries. Are there applications 
that may use such entries?


https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=291015
mime-support: run‐mailcap to understand URL notation and start 
sensible-browser if required.


A kind of proposal to support x-scheme-handler entries.


On 2024-05-06 17:04, Max Nikulin wrote:

So doubled backslashes (as in .desktop files) are correct.

What is wrong is lack of backslashes added before ";" and it is a bug.


I have now removed the "x-scheme-handler/mailto" entry


I do not think they really hurt, however they are most complex entries, 
so chance that some parser would be confused is higher.



and added backslashes in all the
emacsclient entries in mailcap, and the error messages are gone.


If these edits are outside of user section then entries may be 
regenerated to original form during installing of some package. Please, 
consider filing a bug report.




Re: Bookworm's /etc/mailcap seems to break s-nail

2024-05-06 Thread Max Nikulin

On 06/05/2024 21:24, Max Nikulin wrote:

It seems there are a couple of bugs in update-mime:

1. It does not perform an unquote pass that should retain only a half of 
backslashes from Exec field of .desktop file.


I was wrong here. mailcap(5):

(In fact, the backslash can be used to quote any character, including itself.)


So doubled backslashes (as in .desktop files) are correct.

What is wrong is lack of backslashes added before ";" and it is a bug.

grep Exec /usr/share/applications/emacsclient.desktop
Exec=sh -c "if [ -n \\"\\$*\\" ]; then exec emacsclient 
--alternate-editor= --display=\\"\\$DISPLAY\\" \\"\\$@\\"; else exec 
emacsclient --alternate-editor= --create-frame; fi" sh %F


should be converted to /etc/mailcap entry

application/x-shellscript; sh -c "if [ -n \\"\\$*\\" ]\; then exec 
emacsclient --alternate-editor= --display=\\"\\$DISPLAY\\" \\"\\$@\\"\; 
else exec emacsclient --alternate-editor= --create-frame\; fi" sh %s; 
test=test -n "$DISPLAY"





Re: Bookworm's /etc/mailcap seems to break s-nail

2024-05-06 Thread Max Nikulin

On 06/05/2024 21:41, David Wright wrote:

On Mon 06 May 2024 at 14:53:10 (+0200), Jesper Dybdal wrote:

* In Bookworm:
    mailcap/stable,now 3.70+nmu1 all [installed,automatic]
    j-nail/stable,now 14.9.24-2 amd64 [installed]


  ↑


Has anyone else seen this?


Do you have emacs installed? Rare .desktop files have complex shell 
commands inside. emacsclient treats --display option in a quite specific 
way, so it needs --display="$DISPLAY". Moreover, there is no way to pass 
to emacs "server" arguments like URIs using something similar to argv. 
That is why it is necessary to escape arguments used in lisp expressions


emacsclient --eval "(FUNCTION \"ARGUMENT\")"

Emacs developers are against helper scrips as dedicated files, so there 
are inline script in Exec filed of .desktop files.




Re: Bookworm's /etc/mailcap seems to break s-nail

2024-05-06 Thread Max Nikulin

On 06/05/2024 20:27, Greg Wooledge wrote:

On Mon, May 06, 2024 at 02:53:10PM +0200, Jesper Dybdal wrote:

s-nail: $MAILCAPS: /etc/mailcap: text/english: ignored unknown
string/command: then exec emacsclient --alternate-editor =
--display=\\"\\$DISPLAY\\" \\"\\$@\\"


The question (one of the questions) is what's putting them there, and I
would guess one of the emacs packages is doing it.


update-mime(8) § DESKTOP ENTRIES

  In addition to the abovementioned mechanism update-mime also
  parses desktop entries in  /usr/share/applications/
  to  generate  mailcap  entries.  These entries are given
  a lower priority than those in /usr/lib/mime/packages.

It seems there are a couple of bugs in update-mime:

1. It does not perform an unquote pass that should retain only a half of 
backslashes from Exec field of .desktop file.
2. It does not skip x-scheme-handler/* entries. Are there applications 
that may use such entries?


Perhaps there is a bug in s-nail as well.



Re: Zutty fonts - zutty always uses the same font and fontsize

2024-05-04 Thread Max Nikulin

On 02/05/2024 15:17, Richmond wrote:


It understands the font names from xfontsel which is a major improvement
on zutty.


I have nothing against raster fonts for terminal applications, but I am 
surprised that support of X Logical Font Description may be considered 
as an improvement in comparison with an application relying on fontconfig.


I have never tried zutty, but I would expect something like (assuming 
fonts-liberation2 installed)


zutty -font LiberationMono -fontsize 24

However applications are usually more liberal concerning specifying 
vector fonts and use various fallbacks and substitutions.




Re: Installing testing on Acer Aspire 315

2024-05-04 Thread Max Nikulin

On 03/05/2024 12:16, Paul Scott wrote:
I don't have linux on the machine for which I want the information.  I 
now have the driver name from Windows/Settings.


Booting a live image may help to evaluate if hardware is supported and 
to get lspci output.


Even when windows is booted, it should be possible to find 
VendorID-ProductID pairs in device properties and search on 
https://linux-hardware.org/ and other sources.




Re: Installing testing on Acer Aspire 315

2024-05-04 Thread Max Nikulin

On 04/05/2024 13:52, Paul Scott wrote:

On 5/3/2024 11:25 PM, Max Nikulin wrote:


It may happen that F4 is not F4 unless you press and hold Fn first. It 
is default on some laptops and may be changed in firmware setup.
Inst all docs say Left Alt F4 but no combination of other keys with F4 
worked.


On my laptop F4 worked as increase screen brightness 
(XF86MonBrightnessUp) out of the box. I have not tried it with Alt. That 
is why [Fn+Alt+F4] was necessary to get the action described for [Alt+F4].


Have you tried [Alt+F1] ([Fn+Alt+F1]), F2, and other F-digit keys 
instead of F4?



Obviously vt with log is not available on the stage of grub boot menu.


I don't understand that for this install case,


Due to lack of details, I am unsure at which installation stage you 
faced issues. That is why I decided to rule out the case that you stuck 
when grub boot menu appeared.





Re: Installing testing on Acer Aspire 315

2024-05-04 Thread Max Nikulin

On 03/05/2024 13:27, Paul Scott wrote:
In the mean time, an install seemed to be working but gave an failure 
error which said it would be in the log and visible on virtual terminal 
4, I didn't know how to get to a virtual in the installer.  Various 
combinations with F4 didn't seem to work.


It may happen that F4 is not F4 unless you press and hold Fn first. It 
is default on some laptops and may be changed in firmware setup.


Obviously vt with log is not available on the stage of grub boot menu.



Re: realpath quoting

2024-05-03 Thread Max Nikulin

On 03/05/2024 11:31, jeremy ardley wrote:
My use case is very simple. Give an argument to a program that expects a 
single filename/path.


Role of realpath in your workflow is not clear for me yet.

If you need to copy its result to clipboard then you may use xsel, 
xclip, etc.


realpath --zero "$file" |
{ IFS= read -r -d '' path ; printf '%q' "$path" ; } | xsel -bi

You may bind some key sequence to paste PRIMARY or CLIPBOARD content to 
BASH prompt quoted


_bind_x_yank() {
local buffer head tail
if [ -z "$READLINE_ARGUMENT" ]
then
buffer="$(xsel --output "${1:---primary}")"
else
buffer="$(xsel --output "${1:---primary}" |
xargs --null printf '%q')"
fi
[ -n "$buffer" ] || return
head="${READLINE_LINE:0:$READLINE_POINT}${buffer}"
tail="${READLINE_LINE:$READLINE_POINT}"
READLINE_LINE="${head}${tail}"
READLINE_POINT="${#head}"
}
bind -x emacs -x '"\C-xY": _bind_x_yank'
bind -x emacs -x '"\C-xy": _bind_x_yank --clipboard'

[Esc] [1] [Ctrl+x] [y]
from clipboard or last [Y] from PRIMARY selection.

You even may define a desktop-wide shortcut that replaces selection 
content with its quoted variant. Neither task requires quoted output 
from realpath directly.


I am unsure what kind of debugger you use and what kind of escaping it 
needs.


P.S.
A corner case is a file path having trailing newlines
https://mywiki.wooledge.org/BashPitfalls#content.3D.24.28.3Cfile.29



Re: Installing testing on Acer Aspire 315

2024-05-02 Thread Max Nikulin

On 02/05/2024 12:19, Sirius wrote:

If your wifi is also the AX200 (maybe a different revision), it *should*
work.


lspci -nn

may help with more precise identification.

It requires firmware-iwlwifi from non-free-firmware, so check that 
install image contains firmware.


I would avoid installing testing for several weeks. Maybe a huge change 
with 64 bit time_t has not settled yet.


My experience with

02:00.0 Network controller [0280]: Intel Corporation Wi-Fi 6 AX200 
[8086:2723] (rev 1a)


is far from being positive. Firmware crashes are not infrequent. Not all 
applications handle lost packets and disabling/enabling network adapter 
gracefully. It might depend on the WiFi router (and others around).




Re: realpath quoting

2024-05-02 Thread Max Nikulin

On 03/05/2024 09:19, Greg Wooledge wrote:

I still insist that this is a workaround that should *not*  be used
to try to cancel out quoting bugs in one's shell scripts.


There are still specific cases when quoting is necessary, e.g. ssh 
remote command (however you have to be sure concerning shell on the 
remote host).


In BASH printf has %q format. GNU coreutils supports it as well, but 
dash does not, so be careful.


Likely Jeremy's case does not really require this kind of quoting.

While "ls -l" output is for humans, realpath is often used in scripts. 
Certainly it should nor return quoted output by default. I am in doubts 
if a dedicated option should be added to realpath.




Re: Zutty fonts - zutty always uses the same font and fontsize

2024-05-01 Thread Max Nikulin

On 02/05/2024 10:11, Greg Wooledge wrote:

On Thu, May 02, 2024 at 09:34:13AM +0700, Max Nikulin wrote:

On 01/05/2024 21:58, Sirius wrote:


I was right about .Xresources that it is one of the files used for loading
settings into the X server, but urxvt looks at .Xdefaults instead.


It is a bit strange. Applications should not read these files directly.
Content should be loaded during X session startup, see
/etc/X11/Xsession.d/30x11-common_xresources

After modification of .Xresources it is necessary to invoke xrdb(1).


I'm not sure about rxvt-unicode, but the original rxvt definitely
worked that way.


Almost certainly I was wrong. .Xresources should be read by xrdb, while 
.Xdefaults (older method) is read by applications.

https://superuser.com/questions/243914/what-is-the-difference-between-xresources-and-xdefaults


  1. app-defaults file in $XAPPLRESDIR
  2. $HOME/.Xdefaults
  3. RESOURCE_MANAGER property on root-window of screen 0
  4. SCREEN_RESOURCES property on root-window of the current screen
  5. $XENVIRONMENT file OR $HOME/.Xdefaults-
  6. resources specified via -xrm on the commandline

It says you can use xrdb, but then lists the places it looks, and that
list does not include xrdb(?).  I don't understand what this means.


Items 3 and 4 in this list are places where xrdb stores properties.




Re: Zutty fonts - zutty always uses the same font and fontsize

2024-05-01 Thread Max Nikulin

On 01/05/2024 21:58, Sirius wrote:


I was right about .Xresources that it is one of the files used for loading
settings into the X server, but urxvt looks at .Xdefaults instead.


It is a bit strange. Applications should not read these files directly. 
Content should be loaded during X session startup, see 
/etc/X11/Xsession.d/30x11-common_xresources


After modification of .Xresources it is necessary to invoke xrdb(1).

Per-application files are in /etc/X11/app-defaults/


Good old urxvt is quite lightweight compared to kitty.


I am unsure concerning real degree of danger, just a warning:

https://dgl.cx/2023/09/ansi-terminal-security

Additionally some terminals support C1 controls in UTF-8 encoded text,
which per this 2015 posting to oss-security is problematic. Some
terminals have the ability to turn this off, if they do not such as
Kitty I cannot recommend their use.





Last line [was: Re: [SOLVED] Trouble/bug with initramfs-tools adding encrypted swap partition]

2024-04-26 Thread Max Nikulin

On 26/04/2024 10:56, David Wright wrote:

Editor examples: a windowed emacs buffer has a ≣ decoration at the
extreme left edge after the last line of text, so that you can
distinguish an absence of lines from empty lines.


Perhaps that decoration should be explicitly enabled. However it 
reminded me the following:


(info "(elisp) Library-Headers")
https://www.gnu.org/software/emacs/manual/html_node/elisp/Library-Headers.html
"D.8 Conventional Headers for Emacs Libraries"

‘;;; filename ends here’

This is the footer line; it appears at the very end of the file.
Its purpose is to enable people to detect truncated versions of the file
from the lack of a footer line.


As to some ignored line at the end of a file:
https://mywiki.wooledge.org/BashFAQ/005#Handling_newlines_.28or_lack_thereof.29_at_the_end_of_a_file
"2.1.1. Handling newlines (or lack thereof) at the end of a file"
in BASH FAQ "How can I use array variables?"


`read` returns false when it reads the last line of a file. This
presents a problem: if the file contains a trailing newline, then
read will be false when reading/assigning that final line, otherwise,
it will be false when reading/assigning the last line of data.
Without a special check for these cases, no matter what logic is
used, you will always end up either with an extra blank element in
the resulting array, or a missing final element.





Re: bootable pendrive from zip file

2024-04-25 Thread Max Nikulin

On 25/04/2024 13:51, Thomas Schmitt wrote:

Max Nikulin wrote:

"12.3.3 Number and Location of System Partitions
... Further, UEFI implementations may allow the use of conforming FAT
partitions which do not use the ESP GUID."


Another problem with the statement is that it only talks of GUID and
thus of GPT partitioning, while the specs allow MBR partitioning too.


I agree. I have not tried to find anything similar for MBR.

For images provided by distributions, it is important to follow specs to 
minimize chance of failure. For users balance may be different.


I prefer non-destructive approach for making bootable images. It allows 
to add some files. It is even possible to remount media as read-writable 
while a live image is booted. I was not aware that partition type might 
be an issue.


I consider direct byte to byte copy of an image (instead of putting 
files to an earlier formatted drive) as the last resort. A decade ago I 
had to use it when I messed up something with syslinux configuration.



USB pen drive is not a diskette, but it increases probability that
superfloppy formatting style is supported. Of course, singe FAT partition is
more portable.


If that's a quote from the specs,


Sorry for confusion, certainly this paragraph is my comment.

As to the "debian" symlink, it might be either for apt-cdrom or for 
those who mounts images as local repository. It is just a guess, I have 
no example of a tool that needs the symlink.




Re: bootable pendrive from zip file

2024-04-24 Thread Max Nikulin

On 23/04/2024 13:21, Thomas Schmitt wrote:


Max Nikulin wrote:

Out of curiosity, does the requirement of specific GUID exist for removable
drives?


It is disputed, whether the specs say that the partitions must be marked
by 0xEF in legacy MBR tables and by C12A7328-F81F-11D2-BA4B-00A0C93EC93B
in GPT.


It happened so that I had locally a file with UEFI spec Version 2.3.1, 
Errata C June 27, 2012. I tried to search it for "removable" and for 
"0xef". Since I am not familiar with context of the following snippets, 
my interpretation may be wrong. Later versions may have some updates.


12.3.3 Number and Location of System Partitions
... Further, UEFI implementations may allow the use of conforming FAT 
partitions which do not use the ESP GUID. Partition creators may prevent 
UEFI firmware from examining and using a specific partition by setting 
bit 1 of the Partition Attributes (see 5.3.3) which will exclude the 
partition as a potential ESP.


From my point of view it is opposed to "must be" for strict partition 
type checks.


I have noticed that FAT12 and FAT16 are allowed for removable media. The 
restriction is that while a fixed media may have multiple ESP, a 
removable one must have single EFI partition.



A USB drive may be formatted without partition table.


The specs only talk of partitions.


12.3.1 System Partition
... For a diskette (floppy) drive, a partition is defined to be the 
entire media.


Some details are in 12.3.4.2 Diskette

USB pen drive is not a diskette, but it increases probability that 
superfloppy formatting style is supported. Of course, singe FAT 
partition is more portable.



7z and bsdtar can extract content of ISO files without mounting images.


But mounting needs no special software and gives you the opportunity
to use many different ways of copying, which may be decisive when the
target is a heavily restricted filesystem like FAT.


I usually have p7zip-full installed to be able to extract files from 
various archives, so I do not consider it as a too special. I did not 
need extra flexibility, with 7z there was no need for extra mount/umount 
commands, just extracting as a regular user was enough. So in some cases 
it is more convenient.





Re: bootable pendrive from zip file

2024-04-22 Thread Max Nikulin

On 23/04/2024 00:49, Thomas Schmitt wrote:

This aims at an undocumented habit of EFI implementations to look in
any FAT filesystem for a \EFI\BOOT directory with a suitable BOOT*.EFI
file and to start it, if found.
(Officially documented is to look in FAT filesystems of partitions with
MBR type 0xEF or GPT type GUID C12A7328-F81F-11D2-BA4B-00A0C93EC93B.)


Out of curiosity, does the requirement of specific GUID exist for 
removable drives? A USB drive may be formatted without partition table.


I am in doubts if any user will really benefit from UEFI implementations 
strictly following the spec. Making a bootable media is harder for 
regular users, chance of unintentional action is low, it is unlikely an 
obstacle for attackers trying to force users to boot a compromised image.



So just mount the ISO:
and copy its content to the mounted USB stick.


7z and bsdtar can extract content of ISO files without mounting images.



Re: Fwd: Debian 11 Xfce panel Network Manager applet has disappeared

2024-04-18 Thread Max Nikulin

On 18/04/2024 17:05, David Christensen wrote:

$ mv .config/xfce4-20240418-180045/ .config/xfce4

Restart -- back to Xfce panel with no Network Manager.


Try to create a new system user and log in. Is nm-applet present?



Re: tbird troubles

2024-04-17 Thread Max Nikulin

On 16/04/2024 23:11, to...@tuxteam.de wrote:

Makes sense, TB seems to remember its window configuration [1]

[...]

[1] Can't they just let the window manager do its job?


I am in doubts if saving list of windows and list of folders and 
messages opened in all tabs of each window could and should be delegated 
to the window manager.




Re: Automatic reboot on kernel crash in Debian 12 - how?

2024-04-16 Thread Max Nikulin

On 16/04/2024 16:17, Michael Kjörling wrote:

I have a handful of Debian 12 systems that I want to configure such
that they reboot automatically in case of a problem.

[...]

That leaves kernel-level issues.


I have not tried it, but I have seen some systemd options related to 
configuration of hardware watchdog: systemd.directives(7) and 
systemd-system.conf(5)





Re: Debian 12.5 up-to-date Xfce, Firefox clings to USB stick

2024-04-15 Thread Max Nikulin

On 16/04/2024 01:52, Curt wrote:

On 2024-04-15, David Wright wrote:

On Sun 14 Apr 2024 at 14:24:29 (-), Curt wrote:

On 2024-04-04, Max Nikulin wrote:


If you do not trust Gmail as a web application, use a mail application
that supports IMAP.


Gmail supports IMAP since more or less forever.


AIUI the OP's problem was not when reading mail, but with mail
submission of attachments.


And in what way does that affect a true statement and a phraseology that
clearly implies an nonexistent incompatibility?


I am completely lost. Mail messages (with attachments) may be submitted 
to gmail using SMTP. Certainly it is possible to use different 
applications to read and to send mails, but by default I assume that 
users seek for a complete solution. I had a hope that my suggestion to 
use some mail user agent that support IMAP was clear enough. I expect 
that most of them (at least wide spread) support submission of mail as well.


Use code you trust and protocols having specifications available.

I admit that some users have troubles with OAuth2 authentication in 
various MUAs or with enabling application-specific passwords for their 
google account.





Re: Internet Access Problem

2024-04-12 Thread Max Nikulin



On 11/04/2024 20:53, Stephen P. Molnar wrote:
I am running Bullseye and attempting to use QEMU/KVM virt-manager, on 
the computers on my LAN rather than Oracle VM VirtualBox.

[...]

However, when I pinged yahoo.com. I got the result:

Reply from 169.234.75.136: Destination host unreachable.


If the VM for some reason is configured with "user" network instead of 
vibr0 then it is expected:


https://wiki.qemu.org/Documentation/Networking

Note - if you are using the (default) SLiRP user networking, then ping
(ICMP) will not work, though TCP and UDP will. Don't try to use ping to
test your QEMU network configuration!


Regular user running VM does not have enough privileges to send ICMP 
packets.




Re: network-priority?

2024-04-04 Thread Max Nikulin

On 05/04/2024 04:29, David Wright wrote:

autoconnect-priorityint32   0 [...]
from
https://developer-old.gnome.org/NetworkManager/stable/settings-connection.html

(I don't know the significance of -old.)


It is documented in nm-settings-nmcli(5)




Re: Debian 12.5 up-to-date Xfce, Firefox clings to USB stick

2024-04-03 Thread Max Nikulin

On 31/03/2024 22:35, David Wright wrote:

On Sun 31 Mar 2024 at 09:42:37 (+0300), Antti-Pekka Känsälä wrote:

But I'm worried my Gmail in Firefox is capable of stealing
files off my USB stick.


I've no answer for that, particularly in view of Max's reply
to my previous post.

I've always copied files to and from USB sticks, floppy disks, CDs,
etc), using the hard disk as a staging area.


I think, it is a reasonable approach when combined with other measures.

Frankly speaking, I am not convinced that there is something weird with 
Gmail and Firefox.


If you do not trust Gmail as a web application, use a mail application 
that supports IMAP.


Isolate applications you do not trust and do not expose your private 
files to them. There is a number of possibilities, but neither is perfect:

- multiple system users and file permissions combined with ACLs
- virtual machines
- mount, user and other namespaces, e.g. the following options
- containers
- tools like firejail and bubblewrap
- flatpak and snap (designed for some kind of isolation, but I am unsure 
if it may be configured to specific needs)


Mount a USB drive to a trusted environment and copy specific files to a 
location available to a suspicious application.




Re: Debian 12.5 up-to-date Xfce, Firefox clings to USB stick

2024-03-31 Thread Max Nikulin

On 31/03/2024 11:46, David Wright wrote:

Double-clicking on the directory
mounts it and displays the files in it. Opening a text file
displays it. At least for a small file, FF does not hold the
file open, so I can immediately unmount the stick.


Gmail may do something more fancy
- https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file
- https://developer.mozilla.org/en-US/docs/Web/API/File_System_API

I am not surprised that the device is busy for some interval of time.



Re: Dependencies between components.

2024-03-30 Thread Max Nikulin

On 30/03/2024 22:54, Tim Woodall wrote:

I'm unclear whether backports is allowed to depend on -updates


You have not mentioned bookworm-security.


contrib  : non-free non-free-firmware main
non-free : non-free-firmware main
non-free-firmware    : main


https://www.debian.org/doc/debian-policy/ch-archive.html#archive-areas
2.2. Archive areas in Debian Policy Manual




Re: $USER vs. $LOGNAME and the EnvironmentVariables wiki page

2024-03-25 Thread Max Nikulin

On 26/03/2024 02:48, Patrice Duroux wrote:

1. Using CodeSearch, it is not clear to me when to use one or the other.


Some additions to Greg's answer.

From (info "(libc) Standard-Environment")
https://www.gnu.org/software/libc/manual/html_node/Standard-Environment.html
25.4.2 Standard Environment Variables
LOGNAME

This is the name that the user used to log in. Since the value in
the environment can be tweaked arbitrarily, this is not a reliable
way to identify the user who is running a program; a function like
getlogin (see Identifying Who Logged In) is better for that purpose.

For most purposes, it is better to use LOGNAME, precisely because
this lets the user specify the value.

The following man page is explicitly linked from the wiki page
environ(7) § NOTES:

The HOME, LOGNAME, SHELL, and USER variables are set when the user is
changed via a session management interface, typically by a program such
as login(1) from a user database (such as passwd(5)).  (Switching to the
root user using su(1) may result in a mixed environment where LOGNAME
and USER are retained from old user; see the su(1) manual page.)


2. Would it be nice if the EnvironmentVariables page were linked to a
new page named EnvironmentVariablesList (the same way as DotFiles and
DotFilesList)?


Do you think it would be a long and detailed enough list? At least some 
variables should be discussed in a more specific context, e.g. 
. 
For USER vs. LOGNAME I see nothing Debian-specific, but on the other 
hand I can not suggest a better site. (I have not tried to search on 
stackoverflow.)




Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-20 Thread Max Nikulin

On 20/03/2024 01:51, Thomas Schmitt wrote:

Max Nikulin wrote:

When vector graphics, that does not match device resolution, is rasterized,
the result is either non-even sizes of similar elements or fuzzy lines due
to dithering.


Nitpicking:

"Dithering" in raster graphics is emulation of color resolution at the
expense of space resolution.

[...]


The fuzzy lines are rather the opposite. They use surplus color
resolution to emulate ibetter spacial resolution. Over here the usual
term is "Anti-aliasing".


I admit "dithering" may be incorrect term, but I am in doubts if that 
printer (claimed to have 300dpi resolution, but not suitable for QR 
codes) has surplus color resolution. I do not mean anti-aliasing in the 
sense of adjusting pixels darkness (and color).


Consider 2 squares having size of 2.5×2.5 pixels. Non-even sizes and 
fuzzy lines variants:


█████
██████
████ ██
   ██ ██
   █████

Second variant might have sense if an image is treated as a photo 
unlikely having regular patterns with horizontal and vertical lines.




Re: Root password strength

2024-03-20 Thread Max Nikulin

On 20/03/2024 23:19, Jeffrey Walton wrote:

The network attacker cannot (yet) reach through a
monitor and read a sticky note.


It may be visible during a video call performed from a smartphone.



Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-19 Thread Max Nikulin

On 13/03/2024 12:25, hw wrote:

On Mon, 2024-03-11 at 23:45 +0700, Max Nikulin wrote:

It seems you expect some number that you can use for any QR code. There
is no size that fits for all codes.


It's because you said: "I believed that 300dpi is high enough
resolution for QR-codes of reasonable size if source image has proper
quality." that I keep asking what you consider a reasonable size.


QR codes with more modules must be printed at larger size. Isn't it obvious?

By the way, is 300dpi real resolution of your printer or it is 
over-resolution achieved with overstrike with some offset? If so, does 
the printer driver take it into account?



Out of curiosity I tried to scan a QR code printed on a thermal printer
(so likely having ~200dpi resolution) having size of approximately 0.8in
and 50 pixels (modules) per inch. It encodes a 69 bytes long link.


Did you successfully scan it?


Instantly, no trouble at all.


It limits amount of information you may put into QR codes. You can still
choose to use e.g. 4,5,6, etc. printer dots per QR code module.


How can I choose that?  I don't know that there would be an option
with pdflatex or pdf or the printer driver that would let me choose
how many dots per module the printer puts onto the label.


When a code is generated you can look at it and count its modules. The 
next step is simple math. You have resolution, dots per module and 
number of modules, so you can get size and rerun LaTeX.



When I zoom in on QR-codes in a PDF viewer, they don't get blurry.
Perhaps the pst-barcode package uses vector graphics?


Nice, however you have to adjust size to avoid blurring.


How do you mean?  I thought vector graphics don't blur when scaled.


When vector graphics, that does not match device resolution, is 
rasterized, the result is either non-even sizes of similar elements or 
fuzzy lines due to dithering.


If a few multiplications and divisions is so hard problem and each QR 
code module occupy at least 3x3=9 printer dots then I would try to 
rotate the code by e.g. 30 or 45 degrees before printing.





Re: After installing no access to the installed system.

2024-03-18 Thread Max Nikulin

On 18/03/2024 23:17, Thomas Schweikle wrote:

Maybe it fails installing grub?


Maybe /var/log/installer contains some logs?



Re: shellcheck, bashism's and one liners.

2024-03-17 Thread Max Nikulin

On 17/03/2024 23:56, Greg Wooledge wrote:

On Sun, Mar 17, 2024 at 11:14:56PM +0700, Max Nikulin wrote:


args() { printf '%s\0' a b c d; }
args | xargs -0 sh -c 'count() { echo $#; }; count "$@"' sh-count

It would be easier in the case of script file instead of shell function. An
assumption is that all arguments may be passed through command line.


Tim's assumption here is that he can write a function which emits a
stream of whitespace-separated words, and use this safely in an unquoted
command substitution.

 count $(args)

I'm guessing "count" is a stand-in for something more complex, but $(args)
is pretty much exactly what he wants to do in his real script.


A rudimentary variant of xargs may be implemented in shell. I have no 
idea how to get null-delimited list from apt-get.


sh-xargs() {
declare -a args
mapfile -t args
"$@" "${args[@]}"
}
count () {
echo $#
}
# shellcheck disable=SC2016
apt-get indextargets --format '$(FILENAME)' 'Identifier: Packages' |
sh-xargs count

I find it acceptable to suppress warnings from static code analyzers at 
specific lines. As to variables that sometimes expands to nothing, 
perhaps their values may be collected to arrays. However it is the point 
when a full-fledged programming language becomes a better alternative.




Re: shellcheck, bashism's and one liners.

2024-03-17 Thread Max Nikulin

On 17/03/2024 16:25, Tim Woodall wrote:

args() { echo a b c d; }
count() { echo $#; }
count $(args)


args() { printf '%s\0' a b c d; }
args | xargs -0 sh -c 'count() { echo $#; }; count "$@"' sh-count

It would be easier in the case of script file instead of shell function. 
An assumption is that all arguments may be passed through command line.






Re: Debugging an USB array issue

2024-03-16 Thread Max Nikulin

On 16/03/2024 00:45, Marc SCHAEFER wrote:

On Fri, Mar 15, 2024 at 01:30:08PM -0400, Dan Ritter wrote:

I have never had long-term happiness with multiple disks
connected via USB.


However: I have a similar disk array running 24h/24h for the last three years
on a Debian buster with no problem. I am going to upgrade this system soon, so
if there is something bad with bullseye's kernel I would love to learn about
it :)


You may search https://bugs.debian.org for known issues.

If it is really a software issue rather than a hardware one I would try 
at least bookworm-backports kernel package. Further steps may be git 
bisect game with custom builds of vanilla kernel. It would be tedious 
since 4 hours is required for each iteration.


From my point of view some failure of USB to SATA converter is more 
probable.





Re: Ethernet not working on a Dell notebook

2024-03-16 Thread Max Nikulin

On 16/03/2024 16:18, fran...@libero.it wrote:


root@debian:/home/frantal# networkctl
WARNING: systemd-networkd is not running, output will be incomplete.


OK, so all devices are under control of NetworkManager and there is no 
modification of its global configuration.



root@debian:/home/frantal# lspci
13:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. 
RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 03)


In https://lists.debian.org/msgid-search/uspugc$u42$1...@ciao.gmane.io I 
asked for


lspci -vnn -s 13:00.0

and if the "firmware-realtek" package is installed

https://lists.debian.org/msgid-search/ut0d7u$o4o$1...@ciao.gmane.io

What is the reason to install r8168 and what is its origin? r8168-dkms? 
From realtek site directly?


Have you tried kernel installed from bookworm-backports?

I hope the following should provide informative log for a suitable time 
frame.


- Unplug ethernet cable
- Start journalctl as root (e.g. "sudo -i" at first)
  journalctl -o short-precise -f | tee /tmp/cable.log
- Plug in the cable
- Wait ~15 seconds
- Kill the process by [Ctrl+C]

If unrelated system activity happened at this moment then it is better 
to repeat. The result should be saved to /tmp/cable.log (or another file 
you like).


P.S. The "reply to list" button on the mail list archive pages should 
properly set In-Reply-To message headers to keep discussion within a 
thread. Does your mailer support it?




Re: Ethernet not working on a Dell notebook

2024-03-14 Thread Max Nikulin

On 13/03/2024 23:53, Franco Martelli wrote:

On 13/03/24 at 16:06, Max Nikulin wrote:

On 13/03/2024 21:52, Franco Martelli wrote:

They can coexist. NetworkManager in default configuration ignores 
interfaces under control of ifupdown (/etc/network/interfaces).


Detailed messages from NetworkManager related to carrier change 
events are missed in the posted log file, so the interface is 
configured by ifupdown.



Sorry Max I always knew that they cannot, my mistake…


My fault was that I tried to find NetworkManager manager messages in 
dmesg log. I have never tried to enable control of ifupdown interfaces 
in NetworkManager. In my opinion, on laptops commenting out interface in 
/etc/network/interfaces and so delegating it to NetworkManager has a 
clear advantage. Plugged in cable is detected immediately. With dhclient 
running by ifupdown, it may take some minutes till next DHCP request is 
sent.


The system may have significant changes in respect to defaults. 
Concerning NetworkManager, the following commands might give some 
additional info


   networkctl
   nmcli device
   nmcli connection
   /usr/sbin/NetworkManager --print-config

I am unsure if the line in /etc/network/interfaces had some effect since 
device name is enp19s0 and the file contained eth0.


On 13/03/2024 16:52, fran...@libero.it wrote:

[2.771916] r8168: module verification failed: signature and/or required key 
missing - tainting kernel


tells that not r8169 from default kernel is used. What is the reason to 
install r8168 and what is its origin? r8168-dkms? From realtek site 
directly?


I asked concerning more detailed lspci output and firmware package, but 
I have got no response. If firmware is installed then I would try 
backports kernel.


If cabling issues have been ruled out then perhaps it is time to ask in 
a realtek-related mailing list/forum/bugtracker.



https://wiki.archlinux.org/title/Talk:Network_configuration/Ethernet

So after configured the interfaces, you could try to add "iommu=soft 
amd_iommu" to the kernel command-line


Even if it might help, do not forget to disable it if it has no effect. 
To verify


cat /proc/cmdline




Re: Bluetooth sound problems Debian 12 GNOME

2024-03-14 Thread Max Nikulin

On 14/03/2024 19:06, Jan Krapivin wrote:


What do you think about QUANT parameter in */pw-top/*? Can it influence 
sound quality? I wasn't able to change it with


pw-metadata -n settings 0 clock.force-quantum 2048


Sorry, my experience with tuning PipeWire is limited to switching audio 
profiles (A2DP codecs, HSF) from UI.


I think in you case it would be more productive to enable debug logs 
either in bluetoothd or PipeWire to find either the host or the device 
drops or lost connections causing pauses till reconnect.





Re: Bluetooth sound problems Debian 12 GNOME

2024-03-13 Thread Max Nikulin

On 13/03/2024 17:43, Jan Krapivin wrote:
While watching */pactl subscribe /*command output, i have noticed that 
there was a change from sink 414 to sink 213 when sound interrupt occurred


"Event 'change' on sink-input #414

Can this information be of any help?


It is expected due to


Mar 11 23:14:11 deb /usr/libexec/gdm-x-session[1449]: (II) event25 - Haylou W1 
(AVRCP): device removed
Mar 11 23:14:11 deb pipewire-pulse[1359]: mod.protocol-pulse: client 
0x58b39dbbea40 [GNOME Settings]: ERROR command:-1 (invalid) tag:358 error:25 
(Input/output error)
Mar 11 23:14:11 deb /usr/libexec/gdm-x-session[1449]: (II) config/udev: 
removing device Haylou W1 (AVRCP)


journalctl running with root privileges may provide more details.

You may try to discriminate hardware/software issues when you comparing 
different laptops by booting various live images (GNOME, xfce, etc.). I 
admit that it is inconvenient since it may require at least a half of an 
hour to test each variant and regular working environment is unavailable.




Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-13 Thread Max Nikulin

On 13/03/2024 02:50, jeremy ardley wrote:
Getting back to pixel registration, the latex CUPS route is very 
unlikely to work well.


TeX with MetaFont fonts worked well with low resolution dot matrix 
printers. Rasterized fonts may be generated for specified resolution. It 
should be still possible unless wide Unicode coverage is required.


I may be wrong, but I have impression that better support of modern 
vector fonts (TTF, OTF, etc.) in LuaTeX has other side. HurfBuz font 
library with priority to speed can not align characters to specified 
pixel grid. Likely nobody cares concerning font hints for low resolution 
devices.


Scale and position of images like QR codes should be adjusted to printer 
resolution.


More than a decade ago it was necessary to provide a document for 
archival purposes. I got a couple of complains: font with too thin lines 
and gray rather than black toner. The cartridge was refilled almost a 
dozen of times, but for routine documents quality was still good. 
CM-Super Type 1 font (converted from original Computer Modern with 
additions related to more scripts) really has hairlines. I configured 
metafont to increase minimal line width and generated a document with 
600dpi raster fonts using latex+dvips+ps2pdf instead of pdflatex. I went 
to a print shop nearby with hope to find there a printer filled with 
really black toner. The person there did not get the point why I was not 
satisfied looking into a test page from my document. It was blurry. 
Likely the page was scaled to printable area and dithering was applied. 
I preferred to go to another shop and got a stack of paper printed with 
proper quality. Either stuff there were a bit more experienced or 
default printer settings were more reasonable.


So it is not difficult to ruin efforts invested into print quality by 
inappropriate checkbox. The process is not fool-proof.




Re: Ethernet not working on a Dell notebook

2024-03-13 Thread Max Nikulin

On 13/03/2024 21:52, Franco Martelli wrote:
Do you have configured both NetworkManager and Debian 
/etc/network/interfaces? They cannot coexist,


They can coexist. NetworkManager in default configuration ignores 
interfaces under control of ifupdown (/etc/network/interfaces).


Detailed messages from NetworkManager related to carrier change events 
are missed in the posted log file, so the interface is configured by 
ifupdown.




Re: Bluetooth sound problems Debian 12 GNOME

2024-03-12 Thread Max Nikulin

On 12/03/2024 03:48, Jan Krapivin wrote:


"Mar 11 22:20:13 deb wireplumber[1357]: RFCOMM receive command but modem 
not available: AT+XIAOMI=1,1,102,85,88,27,174"


Just a wild guess, unlikely it is true. Headphones might report battery 
charge level using a vendor protocol extension. 85 and 88 are decreasing 
in later messages.


Sound stream may be interrupted when headphones decide to balance 
battery discharge by switching device that communicates with laptop.


Perhaps messages related to input devices are different because it is 
Wayland session while I use KDE with X11 session, so in my case 
messages are "Watching system buttons" instead of "KEYBOARD...".


You may use --since and --until journalctl options to get system logs 
for the same time intervals you posted.





Re: Ethernet not working on a Dell notebook

2024-03-12 Thread Max Nikulin

On 12/03/2024 15:11, fran...@libero.it wrote:

13:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 
PCI Express Gigabit Ethernet Controller (rev 03)


lspci -vnn -s 13:00.0

should give more detailed info concerning your network adapter.

Finally while trying to find the solution I tried this command and after 
some seconds I was online:


sudo mii-tool enp19s0 -F 10baseT-FD


Perhaps it is obvious, but do you have the firmware-realtek package 
installed?


Inspect journalctl output, NetworkManager should log negotiation failures.




Re: Bluetooth sound problems Debian 12 GNOME

2024-03-12 Thread Max Nikulin

On 12/03/2024 03:48, Jan Krapivin wrote:


As for journald i have a lot of such errors, but they don't influence 
the audio quality:


"Mar 11 22:20:13 deb wireplumber[1357]: RFCOMM receive command but modem 
not available: AT+XIAOMI=1,1,102,85,88,27,174"


Headphones might expect some response to some of these command and might 
drop connection otherwise.



journalctl -f
Hint: You are currently not seeing messages from other users and the system.
  Users in groups 'adm', 'systemd-journal' can see all messages.


Run the command as root, but you already have enough keywords to search 
in bug reports and discussions related to PipeWire and pulseaudio. The 
latter may have some workarounds for specific models of headphones.



Mar 11 23:14:11 deb gsd-media-keys[1744]: Unable to get default sink
Mar 11 23:14:11 deb /usr/libexec/gdm-x-session[1449]: (II) event25 - Haylou W1 
(AVRCP): device removed
Mar 11 23:14:11 deb gsd-media-keys[1744]: Unable to get default sink
Mar 11 23:14:11 deb /usr/libexec/gdm-x-session[1449]: (II) event25 - Haylou W1 
(AVRCP): device removed
Mar 11 23:14:11 deb /usr/libexec/gdm-x-session[1449]: (**) Option "fd" "78"
Mar 11 23:14:11 deb /usr/libexec/gdm-x-session[1449]: (II) UnloadModule: 
"libinput"
Mar 11 23:14:11 deb /usr/libexec/gdm-x-session[1449]: (II) systemd-logind: 
releasing fd for 13:89
Mar 11 23:14:11 deb /usr/libexec/gdm-x-session[1449]: (EE) systemd-logind: 
failed to release device: Device not taken
Mar 11 23:14:12 deb wireplumber[1357]: set volume 74 failed for transport 
/org/bluez/hci0/dev_9C_19_C2_1B_A7_25/sep4/fd1 (No such property 'Volume')
Mar 11 23:14:14 deb /usr/libexec/gdm-x-session[1449]: (II) config/udev: Adding 
input device Haylou W1 (AVRCP) (/dev/input/event25)
Mar 11 23:14:14 deb /usr/libexec/gdm-x-session[1449]: (**) Haylou W1 (AVRCP): Applying 
InputClass "libinput keyboard catchall"
Mar 11 23:14:14 deb /usr/libexec/gdm-x-session[1449]: (II) Using input driver 
'libinput' for 'Haylou W1 (AVRCP)'


So device disappears for some reason. Perhaps driver receives something 
unexpected, perhaps headphone do not receive something they expect.



Mar 11 23:24:28 deb /usr/libexec/gdm-x-session[1449]: (II) XINPUT: Adding extended input 
device "Haylou W1 (AVRCP)" (type: KEYBOARD, id 20)


Check if similar lines are logged on Mint. KEYBOARD looks a bit strange, 
but perhaps it is normal for GNOME.


PipeWire mailing list or forum may be a better place to discuss the issue.





Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-11 Thread Max Nikulin

On 11/03/2024 08:06, hw wrote:

On Sun, 2024-03-10 at 09:50 +0700, Max Nikulin wrote:

On 10/03/2024 04:41, hw wrote:

\psbarcode{textblah foo}{height=0.6 width=0.6 eclevel=L}{qrcode}

That works for 600dpi laser printers.  When you print the QR-code with
a 300dpi label printer you can't reliably scan it, not even when you
make the QR-code 1x1" in size.

Perhaps that's not a reasonable size?


Perhaps height and width are chosen improperly. An image some percents
smaller may be sharper.


What size do you consider reasonable?


It seems you expect some number that you can use for any QR code. There 
is no size that fits for all codes.


Out of curiosity I tried to scan a QR code printed on a thermal printer 
(so likely having ~200dpi resolution) having size of approximately 0.8in 
and 50 pixels (modules) per inch. It encodes a 69 bytes long link. 
Likely the same code scaled to 0.4in will still work, but I would prefer 
to avoid it, 0.6in should be more reliable. On your 300dpi printer this 
particular QR code may be printed e.g. at ~(0.8/1.5)in.


Fix size of QR code pixel (module), not size of whole QR code.


- Find number of pixels in QR code in QR specs (or just calculate them)


Calculate them how or find them where?  Pdflatex somehow does it and
the QR-codes are fine when printed on a laser printer and when shown
on a 4k display.


"Modules" in Florent's message is what I referred to as QR code "pixels" 
and their count depends on "version".



- Specify width and height so that the ration of 2 numbers above is a
whole number.

Image may become a bit larger or a bit smaller.


The QR-code must fit on the label, plus some text.  The labels are
50x35mm in size.


It limits amount of information you may put into QR codes. You can still 
choose to use e.g. 4,5,6, etc. printer dots per QR code module.



When I zoom in on QR-codes in a PDF viewer, they don't get blurry.
Perhaps the pst-barcode package uses vector graphics?


Nice, however you have to adjust size to avoid blurring.




Re: Bluetooth sound problems Debian 12 GNOME

2024-03-11 Thread Max Nikulin

Please, respond to the mailing list.

On 11/03/2024 11:50, Max Nikulin wrote:

https://wiki.debian.org/BluetoothUser/a2dp

Last resort might be dumping bluetooth traffic


The link above has an example

dumpcap -i bluetooth0

Another tool is

hcidump -w /tmp/bt.pcap

However at first I would check logs using journalctl. Maybe debug should 
be enabled for bluez and PipeWire.




Re: Bluetooth sound problems Debian 12 GNOME

2024-03-10 Thread Max Nikulin

On 10/03/2024 21:07, Jan Krapivin wrote:
Hello! I have a problem with sound quality when using bluetooth 
headphones on Debian 12 GNOME.


Every ~20 minutes, sometimes less, sometimes more, sound interrupts for 
a 1-5 seconds with complete silence.


Are there anything in journalctl output (executed as root) around these 
events?


At first I thought that problem can be in the headphones, though it have 
worked fine with Android phone and Linux Mint XFCE on a other laptop.


Is XFCE configured to use pulseaudio or PipeWire as GNOME?

So I bought another headphones with support of different codecs: SBC, 
AAC, and AptX.


Another option might be LC3 codec from Bluetooth LE (5.2 Basic Audio 
Profile) if it is supported by the headphones.


Though in mSBC there are no interruptions. I wonder why mSBC works fine 
and SBC no..?


Either a software/hardware bug or some piece of software disables power 
saving for handsfree/headset profiles to achieve low latency, but for 
A2DP device tries to sleep after some period of time. At least SBC 
allows to decrease bitrate if connection is unreliable. I have read 
somewhere that current drivers can not increase bitrate without 
reconnection. It is just speculations, do not take it too serious.


Arch Linux wiki pages have long troubleshooting sections. Debian ones 
are partially outdated:

https://wiki.debian.org/BluetoothUser
https://wiki.debian.org/BluetoothUser/a2dp

Last resort might be dumping bluetooth traffic, but perhaps it is better 
to ask in some mailing list or forum more close to Bluetooth stack 
developers.




Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-09 Thread Max Nikulin

On 10/03/2024 10:51, jeremy ardley wrote:


I have far less problems with the QR code (in my case data_matrix code) 
than with the barcode. The pixel elements of the QR code are much larger 
than the lines in a barcode so there is much less chance for pixel 
ambiguity.


From your earlier message I count approximately 1000px for 5in (125 mm) 
barcode. If it is 1:1 to ~200dpi then it is incompatible with 300dpi 
printers, so it may be a reason why your proposal to the post office was 
rejected. If it is 500 black or white lines and each one occupies 2 
printer dots then 300dpi image of the same size has 3 dots per line. 
(Sorry, I am unsure concerning "module" term.) You should be able to 
rasterize PDF files to 600dpi (2x factor) and downsample them by 1/3 
keeping lines sharp.


Certainly this simple trick would fail if QR in the same file requires 
3/4 scaling.



from pdf2image import convert_from_path


The pdfimage(1) tool may extract images in their original format, 
perhaps there is a similar python module.



     detected_codes = pyzbar.decode(img)


Each barcode and QR code may be resampled individually without 
recognizing it. If position of each image on the page is known,
resampled images may be put back to correct places in the document 
rasterized to your printer resolution.


P.S. Post office guys may believe that labels created using laser 
printers are more resistant to wearing during processing and delivery, 
so 300dpi resolution may be intentional to discourage usage of thermal 
printers.




Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-09 Thread Max Nikulin

On 10/03/2024 03:48, jeremy ardley wrote:


Standard thermal label printers are 203DPI (8 dots per mm).


Thanks, this number suits better to my expectation. I just trusted hw 
earlier.


I have asked the postal service to generate labels at 203dpi which will 
print just fine at 600 dpi and so work with laser and thermal printers, 
but they will not cooperate.


Is the QR image a raster one? I am unsure concerning its printer dots 
per QR pixel ratio. Let's take e.g. 4 as a value inconvenient for direct 
scaling from 300dpi to 203dpi. I expect that upscaling it by 3 and 
downscaling the result by 4 with disabled smoothing (e.g. using splines) 
should generate an image that is 1.5% larger than the one suitable for 
203dpi. So setting 98.5% scaling for printer should allow to achieve 
sharp QR image without re-encoding QR.


You may try to find rational approximation for (4*208)/300 better than 
4/3 (or for actual QR pixel size).





Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-09 Thread Max Nikulin

On 10/03/2024 04:41, hw wrote:

\psbarcode{textblah foo}{height=0.6 width=0.6 eclevel=L}{qrcode}

That works for 600dpi laser printers.  When you print the QR-code with
a 300dpi label printer you can't reliably scan it, not even when you
make the QR-code 1x1" in size.

Perhaps that's not a reasonable size?


Perhaps height and width are chosen improperly. An image some percents 
smaller may be sharper.


- Find the dpi value in the specs of your printer
- Find number of pixels in QR code in QR specs (or just calculate them)
- Specify width and height so that the ration of 2 numbers above is a 
whole number.


Image may become a bit larger or a bit smaller.



Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-09 Thread Max Nikulin

On 09/03/2024 19:08, hw wrote:

On Fri, 2024-03-08 at 23:21 +0700, Max Nikulin wrote:

On 08/03/2024 12:35, hw wrote:

On Thu, 2024-03-07 at 23:15 -0500, Jeffrey Walton wrote:


I have a USB thermal printer for the shipping labels,
<https://www.amazon.com/gp/product/B08V28J3JS>.


This printer has only 300dpi.  If you print QR-codes on it make sure
you can scan them: they have to be large enough or get you an
unscanable smear.


I believed that 300dpi is high enough resolution for QR-codes of
reasonable size if source image has proper quality. On the other hand,
if possible, it is better to scale QR-codes to match some whole factor
of printer pixel size.


What do you consider a 'reasonable size'?


Looking at a QR code likely having ~75 pixels per inch I find it 
unreasonably small for delivery labels. I am in doubts if its redundancy 
is high enough to reliably recognize it if it would be scratched during 
delivery. Another limitation may be stability of optics in scanners in 
respect to labels. This one is printed using a laser printer with 
resolution at least 600 dpi. Each QR code pixel has still 4x4 printer 
dots in the case of 300dpi, so when image is properly aligned, printer 
quality is not an issue.



There is no source image other than whatever LaTeX creates.  I can
specify the size of the QR-code.  Other than that, how do you apply
scaling?


I am unsure what particular QR code generator do you use and what is the 
format of QR codes. Is it raster or vector image? Specify size that 
makes QR code pixels having whole number of printer pixels.


"Fit to page" or "fit to printable area" in printer options may make an 
image blurry. In the case of low input image resolution, upscaling 
method suitable for photos may make QR code blurry. However consistent 
configuration should make QR codes sharp.





Re: libbusiness-us-usps-webtools-perl and USPS Ground Advantage shipping

2024-03-08 Thread Max Nikulin

On 08/03/2024 12:35, hw wrote:

On Thu, 2024-03-07 at 23:15 -0500, Jeffrey Walton wrote:


I have a USB thermal printer for the shipping labels,
.


This printer has only 300dpi.  If you print QR-codes on it make sure
you can scan them: they have to be large enough or get you an
unscanable smear.


I believed that 300dpi is high enough resolution for QR-codes of 
reasonable size if source image has proper quality. On the other hand, 
if possible, it is better to scale QR-codes to match some whole factor 
of printer pixel size.





Re: strange time problem with bullseye/buster

2024-03-08 Thread Max Nikulin

On 08/03/2024 07:17, gene heskett wrote:

I have NDI how to extract chrony's logs from journalctl.


- man journalctl,
- docs listed on the systemd web site.



Re: Encrypted home and pam_mount

2024-03-05 Thread Max Nikulin

On 05/03/2024 03:37, Andrey Dogadkin wrote:

On Sun, 2024-03-03 at 21:27 +0700, Max Nikulin wrote:


https://github.com/systemd/systemd/issues/8598#issuecomment-376845082
"systemd-user doesn't properly close its PAM session"


I saw that issue and it didn't strike me as related to my case,
pam_mount works fine as long as I allow it to shoot everything down.


It may be tricky to properly finish all user processes before closing 
PAM session. Examples what may go wrong:

- pam-sd (systemd) dropped privileges and unable to perform umount
- user@.service has not finished yet, so some processes from the systemd 
user service have files open
- The process that should close PAM session is killed by systemd when 
user@.service is stopped. Should not happen with defauld systemd-logind 
settings in Debian.



The thing is, even if I set absurdly big wait delay in pam_mount's
logout statement, I can still observe pulseaudio and dbus-daemon
running throughout the whole delay period. Systemd makes no attempt to
stop them before or while pam_mount is running, that's why it seems
like an ordering problem rather than just things being late.


I think, systemd-logind should initiate termination of systemd user 
session when UserStopDelaySec is elapsed after all processes that belong 
to current PAM session are finished. It may include the process that is 
waiting before locking (closing) the encrypted device. Sounds like a 
kind of deadlock.


If pam_mount allows it, I would try to not unmount the device in 
pam_close and instead ask user@.service to do it.





Re: bash parameter expansion "doesn't like" dots?

2024-03-05 Thread Max Nikulin

On Tue, 5 Mar 2024 at 02:59, Greg Wooledge wrote:


We might *guess* that this change was made to make dash more strict
about POSIX minimalism (removing extensions), but without documentation
we can't do more than guess about motives.


The motivation is to avoid difference in behavior when compiled with 
internal fnmatch implementation and with glibc


https://lore.kernel.org/dash/e341e41f-8c32-b6e4-8be3-8f94fae26...@gigawatt.nl/
Re: possible wrong behaviour with patterns using a quoted ^ at the start 
of a bracket expression. Wed, 12 Jan 2022 17:20:54 +
This bug (you're right that it's a bug) is specific to builds that use 
fnmatch(). In dash itself, ^ is always assumed as a literal. In builds 
with --disable-fnmatch you get correct results.


On 05/03/2024 12:22, David wrote:

A bit more info:
   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1028002


Unfortunately this bug has been left without a response from the 
maintainer. The release notes mentions the issue:


https://www.debian.org/releases/bookworm/amd64/release-notes/ch-information.en.html#dash-circumflex
https://bugs.debian.org/1034344




Re: bash parameter expansion "doesn't like" dots?

2024-03-04 Thread Max Nikulin

On 05/03/2024 09:02, Greg Wooledge wrote:

On Tue, Mar 05, 2024 at 10:49:34AM +0900, John Crawley wrote:


I think ^ has been deprecated recently. I failed to find a reference on the web 
just now though.


So, ^ isn't "deprecated".  It's just not portable to sh.


Running shellcheck on a *sh* script with a [^s] glob gives 
https://www.shellcheck.net/wiki/SC3026

"In POSIX sh, ^ in place of ! in glob bracket expressions is undefined."
with some links. There is no warning in the case of a #!/bin/bash script.




Re: Encrypted home and pam_mount

2024-03-03 Thread Max Nikulin

On 03/03/2024 02:46, Andrey Dogadkin wrote:

Automounting works fine, but I'm having trouble with auto-unmounting
when I log out. The partition stays mounted and I can see "target is
busy" errors from umount in the journal.


It is an issue with ecryptfs and fscrypt as well.

https://github.com/systemd/systemd/issues/8598#issuecomment-376845082
"systemd-user doesn't properly close its PAM session"

systemd-logind default settings have UserStopDelaySec=10 so some 
processes are still running after the session is finished.


Depending on desktop environment or window manager you may try

 systemctl --user start exit.target

during logout if the user has no other sessions (SSH, VT, etc.)

I have not tried systemd-homed
https://systemd.io/HOME_DIRECTORY/




Re: DNSSEC status of deb.debian.org

2024-03-03 Thread Max Nikulin

On 03/03/2024 16:39, Andre Rodier wrote:


Is there a stable domain we can use that doesn't rely on a CDN, please ?


https://www.debian.org/mirror/list

APT relies on GPG signed metadata, so DNSSEC is not necessary for 
repositories.




Re: where are the crontab files in Trixie?

2024-02-29 Thread Max Nikulin

On 29/02/2024 11:32, David Wright wrote:

On Wed 28 Feb 2024 at 22:32:57 (+0700), Max Nikulin wrote:

On 28/02/2024 10:35, David Wright wrote:

In which case, I'd write the remaining cron line as:

@reboot sleep 99 && echo 13b1 0bdc > /sys/bus/usb/drivers/brcmfmac/new_id


I am in doubts if it is a task for cron. Wouldn't udev rules be better?


Those are fair questions. If the appearance of the brcmfmac/ directory
is the sole precondition, then I would probably try udev. But I claim
no knowledge about the module or any device connected with it.


The /sys/bus/usb/drivers/brcmfmac directory should appear when the 
module is loaded. Likely there is no point to load the module if the 
device is not plugged, thus udev should be better than /etc/modprobe.d.



Where cron/sleep is useful is where some device has to settle, or
wait in some way, before the string is sent. One example I use is:

   @reboot sleep 15 && printf '\n' > /dev/tty1 && /usr/sbin/rfkill > /dev/tty1 && 
/usr/bin/ip a > /dev/tty1


I would consider a systemd single-shot service that runs after 
network.target. Instead of "sleep" I would try either nm-online or 
systemd-networkd-wait-online with timeout. I admit, in some cases they 
have no advantages over sleep.





Re: where are the crontab files in Trixie?

2024-02-28 Thread Max Nikulin

On 29/02/2024 00:00, Kamil Jońca wrote:

How precisely linger works? (what it starts? What not etc)
I read about lingering  some time ago, and I have had impression
(wrong?) that it  may conflict with my normal session.


Multiple sessions may be started for a user: DM, ssh, VT logins. I am 
unsure what one you consider as your normal session. These sessions run 
withing single systemd user service.




Re: where are the crontab files in Trixie?

2024-02-28 Thread Max Nikulin

On 28/02/2024 10:35, David Wright wrote:

In which case, I'd write the remaining cron line as:

   @reboot sleep 99 && echo 13b1 0bdc > /sys/bus/usb/drivers/brcmfmac/new_id


I am in doubts if it is a task for cron. Wouldn't udev rules be better?

https://stackoverflow.com/questions/442833/how-to-force-driver-to-device-match-in-linux/52943745#52943745
https://unix.stackexchange.com/questions/67936/attaching-usb-serial-device-with-custom-pid-to-ttyusb0-on-embedded/165845#165845

Moreover, to load and configure modules there are /etc/modprobe.d/ and 
/etc/modules.


If it is a weird device that may appear either as 13b1:0039 (supported 
by brcmfmac accordingly to modinfo) and 13b1:0bdc, may it happen that it 
is possible to use e.g. usb-modeswitch to adjust which way the device 
tries to present itself?






Re: running Jami in Trixie - possible locale issue

2024-02-27 Thread Max Nikulin

On 27/02/2024 20:59, Gary Dale wrote:


The en_GB seems to be coming from Plasma 5's Region & Language settings. 
However I see the message that it is "unsupported", which seems 
appropriate.


en_GB is missed in the output of "locale -a" you posted. I have no idea 
if it is intended or not. It can be generated from "dpkg-reconfigure 
locales".


Maybe you choose this locale earlier on the login screen, maybe selected 
in KDE system settings.


User-specific locale settings maybe saved in
- ~/.config/plasma-localerc
- ~/.dmrc
- I am unsure concerning ~/.config/locale.conf
- AccontsService

 busctl get-property org.freedesktop.Accounts \
 /org/freedesktop/Accounts/User1000 \
 org.freedesktop.Accounts.User Language

(with proper UID and in "id" output)

I expect that you should be able to configure locale in KDE regional 
settings.


My guess is that iu_CA.UTF-8 appeared due to click on a wrong option in 
a drop-down list.


To have spellcheck options you need to install dictionaries.



Re: running Jami in Trixie - possible locale issue

2024-02-26 Thread Max Nikulin

On 27/02/2024 08:28, Gary Dale wrote:

$locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory


What desktop environment do you use? Have you checked its settings? Did 
you choose locale in your display manager (in login dialog)?


Inspect actual environment

env | grep 'LC_\|LANG'
systemctl --user show-environment | grep 'LC_\|LANG'




Re: Q: Gnome network odd

2024-02-24 Thread Max Nikulin

On 05/02/2024 12:08, Byunghee HWANG (황병희) wrote:

On Sun, 2024-02-04 at 13:41 -0600, David Wright wrote:

So it would appear that your question is exactly as in the reference
you quoted, that ifupdown was configuring wlp4s0 when /w/n/i was
in place, resulting in NM displaying a question mark.


Thank you for confirming that this is not a bug.


I have no idea concerning GNOME in sid, but a KDE applet from nm-plasma 
in bookworm is able to react to commands


ip link set enp0s2 down
ip link set enp0s2 up

in a VM when the only interface (besides lo) is managed by ifupdown. 
When the interface is down, the icon changed to a dimmed one with a red "x".


I have not figured out how to determine state using nmcli or through 
various objects reported by


busctl tree org.freedesktop.NetworkManager

E.g. nm-online always reports success. It might be some fallback in the 
KDE applet. Depending on that it is either a bug or not in the GNOME applet.


P.S.

nmcli dev
DEVICE  TYPE  STATE   CONNECTION
lo  loopback  connected (externally)  lo
enp0s2  ethernet  unmanaged   --

nmcli con
NAME  UUID  TYPE  DEVICE
lo18c86315-d7f9-417e-ab2c-c131803b4c0b  loopback  lo

nm-online ; echo $?
Connecting...   30s [online]
0




Re: Selective rotation of journald logs

2024-02-24 Thread Max Nikulin

On 24/02/2024 21:09, Byunghee HWANG wrote:

When I read the question I decided that syslog for auth facility is a
kind of solution.


Really i would like to learn more. Can you show a more specific example?
Also i'm using Debian (sid).


Install rsyslog and logrotate and read their configuration files. 
/var/log/auth is configured by default. Journal contains more metadata 
than syslog text files however.





Re: Selective rotation of journald logs

2024-02-23 Thread Max Nikulin

On 23/02/2024 17:15, Nicolas George wrote:


How do I tell systemd's logging system to keep authentication logs for
one year and mail logs for one month?


I am realizing that the following is not an answer to the asked 
question. The thread is no more than useless arguing anyway.


Some ideas that might be useful in close cases:
- a bunch of filtering options and --output=export as a part of log 
rotation to have selective copy of the journal in an alternative directory

- systemd-journald.service(8) § JOURNAL NAMESPACES for some services.


P.S.
When I read the question I decided that syslog for auth facility is a 
kind of solution.




Re: Timer doing apt update

2024-02-20 Thread Max Nikulin

On 20/02/2024 14:48, Erwan David wrote:

Le 20/02/2024 à 03:20, Max Nikulin a écrit :


busctl get-property \
  org.freedesktop.NetworkManager \
  /org/freedesktop/NetworkManager \
  org.freedesktop.NetworkManager Metered

It would also require to configure NetworkManager to set this correctly. 
Eg When I use USB tethering. (same NetworkManager connexion may be used 
at different places, without any way to simply detect this, when you do 
not use Wifi)


I am unsure if the following would be convenient. You may create a 
couple of connections with and without connection.metered set. Default 
is metered, but when you know that currently traffic is not expensive, 
you may manually switch to one marked as non-metered.





Re: Timer doing apt update

2024-02-20 Thread Max Nikulin

On 20/02/2024 19:44, Greg Wooledge wrote:

1) This apt-daily.timer stuff is quite complex and difficult to discover
and understand.


I am sorry that I confused enough people by my statements. I believed 
that by default this timer runs "apt update" every day while upgrades 
are not enabled out of the box. Perhaps I saw active updates on an 
Ubuntu box and maybe desktop environment stuff was involved.


So the apt package just installs timers and services, but configuration 
files to enable update and upgrade come from unattended-upgrades and 
maybe some other packages.


Unfortunately ExecCondition is allowed only in the [Service] section, so 
it is not possible to avoid starting of timers basing on result of a 
helper script that queries apt configuration.


In the absence of systemd likely cron jobs may be configured (apticron?).



Re: Timer doing apt update

2024-02-19 Thread Max Nikulin

On 20/02/2024 02:35, Erwan David wrote:

Le 19/02/2024 à 18:00, Max Nikulin a écrit :

    systemctl disable --now apt-daily.timer apt-daily-upgrade.timer

Perhaps it is possible to write a script that will respect 
connection.metered property set by NetworkManager.


I disable the timers, thanks


To avoid confusion, these timers are from the apt package, not from 
unattended-upgrades. So they are active on most Debian hosts. Desktop 
environments may display notifications after actions initiated by these 
timers. Likely desktop environments may do more, e.g. to query GNOME 
application shop for updates and initiate more frequent updates.



I'll have a look at connection.metered


Out of curiosity I have queried https://codesearch.debian.net. It seems, 
apt has no notion of metered connection. Perhaps the effect can be 
achieved by adding to unit configuration some Condition* mentioned in 
systemd.directives(7)


https://stackoverflow.com/questions/43228973/detect-if-current-connection-is-metered-with-networkmanager

busctl get-property \
  org.freedesktop.NetworkManager \
  /org/freedesktop/NetworkManager \
  org.freedesktop.NetworkManager Metered



Re: Timer doing apt update

2024-02-19 Thread Max Nikulin

On 19/02/2024 14:35, Erwan David wrote:


After each boot, the equivalent of apt update is automatically done in 
background, through policykit (apt database is locked by policykitd). So 
I think there is a timer triggroing this. I'd like to disable this when 
my laptop is on expensive link (eg 4G link, or abroad). So I'd like to 
disable this timer, but I did not find it. If someone knws better than 
me...


Perhaps I missed something since I have no idea why policykit (or 
polkit?) is involved.


You may disable apt timers

systemctl disable --now apt-daily.timer apt-daily-upgrade.timer

Perhaps it is possible to write a script that will respect 
connection.metered property set by NetworkManager.




Re: sudo udisksctl

2024-02-19 Thread Max Nikulin
David, feel free to stop discussion if you find me annoying. My problem 
in some sense is close to your one and I am trying to figure out if 
missed some udisks feature and the result is some inconvenience.


On 19/02/2024 11:26, David Wright wrote:

On Sun 18 Feb 2024 at 12:41:29 (+0700), Max Nikulin wrote:

On 18/02/2024 11:40, David Wright wrote:

$ udisksctl unlock --block-device /dev/disk/by-partlabel/Nokia01



When sudo is
involved, I still do not see any advantage of udisk[s]ctl over
"cryptsetup open".


I'd be more worried about disadvantages. About the only difference
I see is that   cryptsetup open   requires a name.


I find it convenient to have a meaningful name in /dev/mapper in 
addition to /dev/dm-X. So I would not call it pure disadvantage.



As third option, if I remember it correctly, pmount


That would be pointless for me. After udev creates correctly-named
mountpoints using my rules, entries in fstab set the appropriate
flags for each individual device. That contradicts the expressed main
purpose of pmount: "permits normal users to mount removable devices
without a matching /etc/fstab entry." — precisely what I don't want.


I consider pmount as a tool does not need separate unlock and mount 
commands, so a shell function becomes unnecessary. In respect to 
permissions (for removable drives) it acts as a substitute for sudo.


I expected that you need to mount a partition under /media into the 
directory with name taken from filesystem LABEL. If so then udisksd can 
do it and /etc/fstab entry is unnecessary. You anyway added an udev 
rule. The following one should change mountpoint from 
/media/$USER/lulu01 to /media/lulu01


SUBSYSTEM=="block", ENV{ID_FS_LABEL}=="lulu01", 
ENV{UDISKS_FILESYSTEM_SHARED}="1"


It seems that mixing of udisksctl and non-udisksctl commands cat be avoided.



Re: partition reporting full, but not

2024-02-18 Thread Max Nikulin

On 19/02/2024 06:26, Keith Bainbridge wrote:


So later yesterday afternoon I created a new snapshot with no obvious 
change is free space.


Effect of snapshots is delayed. When you remove a file that does not 
belong to any snapshot, some disk space is reclaimed. However to restore 
a file (even a removed later) from a snapshot, it must be stored 
anywhere. That is why snapshots consume disk space.


Try to remove unnecessary snapshots. I have no idea if btrfs requires 
additional maintenance.




Re: sudo udisksctl

2024-02-17 Thread Max Nikulin

On 18/02/2024 11:40, David Wright wrote:

   $ ssh bhost
   $ udisksctl unlock --block-device /dev/disk/by-partlabel/Nokia01
   Passphrase:
    AUTHENTICATING FOR org.freedesktop.udisks2.encrypted-unlock ===
   Authentication is required to unlock the encrypted device Multiple Card  
Reader (/dev/sdc1)


It should be possible to modify policy to allow a specific user or a 
group to perform disk operations, see polkit(8). When sudo is involved, 
I still do not see any advantage of udiskctl over "cryptsetup open". As 
third option, if I remember it correctly, pmount relies on group 
membership, not on systemd-logind "uaccess", so local vs. remote user 
should not matter. This variant combines unlock and mount into a single 
command.




sudo udisksctl

2024-02-17 Thread Max Nikulin

I have decided to ask the following in a separate thread.

On 17/02/2024 02:59, David Wright wrote
(Re: f3tools vs Silicon Power 4T drive):
  lulu () 
  { 
sudo udisksctl unlock --block-device /dev/disk/by-partlabel/Lulu01 && mount /media/lulu01

  }


I am evaluating if udisks2 D-Bus API allows to create a tool as 
convenient as pmount(1) that is smart enough to unlock a device before 
mounting it (optionally with specified name of mountpoint)


pmount /dev/sda1 mybackup

I have puzzled by your function however. I believed that udisks was 
created to allow *regular* users to mount drives. If you are using sudo 
why do not you use "cryptsetup open" directly? Otherwise udisksctl can 
ask password if policy does not allow disk operations for the current user.


P.S. Unfortunately mount name is hardcoded in udisksd. It is either 
label or UUID, it can not be specified when a partition is mounted.




Re: partition reporting full, but not

2024-02-17 Thread Max Nikulin

On 17/02/2024 09:52, Greg Wooledge wrote:

If so, you *could*  have data inside the /home directory
of the root file system, which is hidden by the /home file system that's
mounted over it.  You'd need to unmount /home to check.


A less intrusive way to inspect shadowed directories is bind mounts.

mkdir /tmp/root
mount --bind / /tmp/root



Re: Does "LC_ALL=C" work on all shells?

2024-02-16 Thread Max Nikulin

On 16/02/2024 23:35, Franco Martelli wrote:

On 16/02/24 at 03:03, Max Nikulin wrote:

 LC_ALL=C.UTF-8 LANGUAGE=it aptitude why firefox-esr


here seems to override, tested twice with "it" and "it_IT.UTF-8":

~# env LC_ALL=C LANGUAGE=it script -T ~/test.time -a ~/test.script


You tested with LC_ALL=C, not with LC_ALL=C.UTF-8. It has been discussed 
that behavior of gettext in respect to LANGUAGE is different.


I am against "C" locale in Debian official docs since it may mangle 
output. I have posted it already:


LC_ALL=C ls /tmp/it/
''$'\303\250'

LC_ALL=C.UTF-8 ls /tmp/it/
è

root@itek:~# env LC_ALL=C LANGUAGE=it_IT.UTF-8 script -T ~/test.time -a 
~/test.script


Again, LANGUAGE value is a list of *languages*, not a locale like for 
LANG or LC_*. LANGUAGE can be it:en_US:en, while this value is invalid 
for LC_ALL. Do not confuse these variables.


Try to add "export LC_ALL=it_IT.UTF-8" to .bashrc and e.g."date" in 
the script session.


Yes, the messages are localized to it_IT.UTF-8 into the "script" 
session, however users that have set LC_ALL variable into .bashrc I 
suppose already know what are they doing.


They just noticed that such variable exists and added to their configs. 
My colleague was bitten by LC_ALL. Is was a surprise when a database 
started to use "," instead of "." as decimal separator and it took 
enough time to find what caused drastic lost of precision. LC_ALL was 
set by the system administrator in ~/.bashrc.


I like the idea to *suggest* people to use English locale for upgrades 
if they are comfortable with it. It will help for searching web and 
during discussions. However I believe that a UTF-8 locale is safer and 
better nowadays. I hope, there is no mistakes any more:


LC_ALL=C.UTF-8; LANGUAGE=; export LC_ALL LANGUAGE

or its equivalent for user shell executed inside "script" session. I am 
unsure if locale of "script" command can be an issue.




Re: Package Identification Assistance

2024-02-16 Thread Max Nikulin

On 16/02/2024 21:14, Greg Wooledge wrote:

On Fri, Feb 16, 2024 at 09:05:28PM +0700, Max Nikulin wrote:

I suspect that program name is the question. If "ps awf" gives no clue then
perhaps the following may help (untested):

https://unix.stackexchange.com/questions/362731/how-to-identify-window-by-clicking-in-wayland


I would also point out that this is a Debian mailing list, not an Ubuntu
mailing list, and therefore the people here don't know anything about
Ubuntu systems (generally).


https://codesearch.debian.net tells that "Ubuntu Software" occurs in 
translation files for gnome-software and software-properties packages.





Re: Package Identification Assistance

2024-02-16 Thread Max Nikulin

On 16/02/2024 12:16, Charles Curley wrote:

On Thu, 15 Feb 2024 20:33:16 -0500
Neal Heinecke wrote:


I need to identify the package responsible for creating the software
sources window. There is a minor bug/typo where the first tab reads
"Ubuntu Software"


I have no idea what a "software sources window" is. Do you know the
name of the program?
I suspect that program name is the question. If "ps awf" gives no clue 
then perhaps the following may help (untested):


https://unix.stackexchange.com/questions/362731/how-to-identify-window-by-clicking-in-wayland



Re: Issue with USB External Keyboard, External Mouse, and Screen Brightness on Dell Laptop

2024-02-15 Thread Max Nikulin

On 15/02/2024 12:39, David Wright wrote:


I would go further than tomas, and suggest that the battery might be
suspect, or the charging circuit of course. (None of my three laptops
works without AC power.) How old is it?


Battery health may be estimated from output of

 upower --dump

by comparison energy-full-design, energy-full, and other values.

I still believe it is excessively aggressive power settings in GNOME or 
in firmware (BIOS) setup. Maybe it is result of shooting own foot by 
tools like powertop or tlp. Anyway it is rather wrong settings than 
wrong behavior. There is a chance that the issue is with USB controller 
driver. Likely it is better to ask the same question in a user group 
more specific to power management.




Re: Does "LC_ALL=C" work on all shells?

2024-02-15 Thread Max Nikulin

On 16/02/2024 09:34, David Wright wrote:


Yes, LC_ALL=C will override all the locale variables,
but LC_ALL=C.UTF-8 will not:


It is documented in

2.3.3 Specifying a Priority List of Languages
(info "(gettext) The LANGUAGE variable")
https://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html

however you may still prefer

 LC_ALL=C.UTF-8 LANGUAGE=

due to

 touch /tmp/it/è

 LC_ALL=C.UTF-8 ls /tmp/it/
 è

 LC_ALL=C ls /tmp/it/
 ''$'\303\250'




Re: Does "LC_ALL=C" work on all shells?

2024-02-15 Thread Max Nikulin

On 16/02/2024 03:17, Franco Martelli wrote:

On 15/02/24 at 03:28, Max Nikulin wrote:


 LANG=C.UTF-8; LANGUAGE=; export LANG LANGUAGE


Doesn't LC_ALL=C setting override LANG or LANGUAGE settings?


Sorry, my bad. Of course

LC_ALL=C.UTF-8; LANGUAGE=; export LC_ALL LANGUAGE


and LC_ALL=C override the LANG setting when used inline of the command.



LC_ALL does not override LANGUAGE. Try e.g.

LC_ALL=C.UTF-8 LANGUAGE=it aptitude why firefox-esr

# env LC_ALL=C script -T ~/upgrade-bookwormstep.time -a 
~/upgrade-bookwormstep.script


Try to add "export LC_ALL=it_IT.UTF-8" to .bashrc and e.g."date" in the 
script session.





Re: Does "LC_ALL=C" work on all shells?

2024-02-14 Thread Max Nikulin

On 14/02/2024 23:11, Franco Martelli wrote:
Well, I'll go with env command syntax for shells portability. I was 
asking this because I want to suggest a change to the DDP (Debian 
Documentation Project) members for the releases notes documentation ¹


# env LC_ALL=C script -t 2>~/upgrade-bookwormstep.time -a 
~/upgrade-bookwormstep.script


Perhaps LC_ALL=C.UTF-8 is safer. At least several years ago some python 
scripts (unrelated to Debian upgrade however) failed trying to log e.g. 
non-ascii file paths, etc.


I would reset LANGUAGE as well otherwise some programs may use localized 
messages.


Finally, some users might have LC_ALL (despite it is not recommended) or 
LANGUAGE set in a file like ~/.bashrc. That is why the following 
approach may be more reliable. Run commands within the "script" session


LANG=C.UTF-8; LANGUAGE=; export LANG LANGUAGE

with a note concerning csh. To affect messages generated by shell 
itself, "export" is separated from setting of the variables.




Re: f3tools vs Silicon Power 4T drive

2024-02-14 Thread Max Nikulin

On 15/02/2024 08:48, gene heskett wrote:
This is what gparted calls a "partition label" and certainly does not 
need a 4.5 megabyte camera image to see. or even a 50k screen snap.


lsblk --fs -o +PARTLABEL  /dev/sdc




Re: Does "LC_ALL=C" work on all shells?

2024-02-13 Thread Max Nikulin

On 14/02/2024 07:56, Gremlin wrote:

Gremlin (12024-02-13):


cat /etc/default/locale
#  File generated by update-locale
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8


Found this in a shell script:

LC_ALL=$LOC LANG=$LOC LANGUAGE=$LOC update-locale LANG=$LOC LC_ALL=$LOC 
LANGUAGE=$LOC


Do not do it for LANGUAGE, it should obey another conventions

LANGUAGE=en_US:en

Its value is a list of languages, not a locale. This variable may affect 
messages generated by some applications, especially GUI ones, even when 
LC_ALL is set.





Re: shred bug? [was: Unidentified subject!]

2024-02-12 Thread Max Nikulin

On 12/02/2024 05:41, David Christensen wrote:


Apparently, shred(1) has both an info(1) page (?) and a man(1) page. The 
obvious solution is to write one document that is complete and correct, 
and use it everywhere -- e.g. DRY.


https://www.gnu.org/prep/standards/html_node/Man-Pages.html
6.9 Man Pages in "GNU Coding Standards"

In the GNU project, man pages are secondary. It is not necessary or
expected for every GNU program to have a man page, but some of them do.


A standalone man page is not the same as a section in a document 
describing the whole bundle.


Notice that man uses direct formatting, not logical markup. E.g. there 
is no dedicated structure for links to other man pages. They were not 
designed as hypertext documents, they are to be printed on paper. In 
this sense texinfo is a more advanced format.


P.S. I admit that in some cases "man bash" may be more convenient for 
searching than an info browser.




Re: [ *** ] Job anacron.service/stop running (15min 49s / no limit)

2024-02-12 Thread Max Nikulin

On 13/02/2024 03:16, Rainer Dorsch wrote:


I will check the anacron
status before the next reboot.


Try it now. It is a good chance that you have a stuck job already 
(waiting for read on a file descriptor leaked from the parent, etc.).





Re: [ *** ] Job anacron.service/stop running (15min 49s / no limit)

2024-02-11 Thread Max Nikulin

On 12/02/2024 03:41, Darac Marjal wrote:

On 11/02/2024 11:21, Rainer Dorsch wrote:


- How can I found out which process anacron is still running?


I think that, once the shutdown has started this is basically 
impossible.


Likely some cron job requires a fix. Try

systemctl status anacron

*before* shutdown and inspect processes that are started by anacron. 
Other variants are


systemd-cgls
ps xuwf




  1   2   3   4   5   6   >