DevHeads.net

Postings by Chris G

How to remove "user@host's password" from ssh login prompt?

How can one remove the username and hostname that precede "password"
when logging in using ssh?

I.e. when I connect to a host called abcdef I want to see just:-

Password:

rather than:-

chris@abcdef's password:

Static web photo gallery generator wanted

I'm looking for a simple, efficient way to generate an HTML gallery
from a hierarchy of jpeg images.

I.e. I have a directory ~/pictures which contains quite a deep
hierarchy of sub-directories oranising my pictures organised as I
want them. It's quite big, something like 30 thousand images which
total something over 50Gb.

I want a way to generate a web gallery with much smaller iamage files
(e.g. maximum image size something like 1024x1024) in a hierarchy
with simple HTML (or whatever) to make it navigable with a web
browser.

Systemd journal getting very large on 18.04 - how to reduce?

I have an Ubuntu 18.04 system and I've just noticed that the
/var/log/journal directory is 4Gb, that's way too much.

How is it supposed to be limited.

How can one change dircolors globally?

I suspect the answer to this may be that you can't, but I'll ask the
question anyway.

Is there any sensible/easy way to change the defaults for all users
set up by dircolors in Ubuntu? From reading the man pages for
dircolors and dir_colors it would seem that it's not possible.

On Ubuntu (and any Debian derived system) dircolors doesn't read
either of /etc/DIR_COLORS or ~/.dir_colors so one can't change colors
by creating/changing these files.

Is there any way to configure the options that Network Manager sends to dhclient?

I'm running xubuntu 17.10 on my laptop (soon to be 18.04) and use the
default Network Manager to handle network connections.

I have a need to change the dhclient settings which are set by Network
Manager which calls dhclient:-

chris$ ps -ef | grep dhclient
root 7586 1585 0 09:00 ?

Should dhclient be running all the time?

I have a laptop running Ubuntu 17.10 (well, actually xubuntu but that
makes little difference to this) and I have a problem with dhcp.

The problem occurs when I move the laptop around and have to change
from one router's WiFi to another (we have quite a big house). What
happens is that dhcp seems to fail when connecting to the new router
and the WiFi on the laptop has no IP, DNS or default route. I do the
change manually using the Network Manager applet, i.e.

Power manager panel applet shows only one battery now, used to show two

I have a Thinkpad laptop with two batteries, I used to see both
batteries in the panel applet but now there's only one. How can I get
to see both batteries again?

WiFi problem, loss of DHCP/DNS when changing from one SSID to another but OK from turn on

I am having a problem with WiFi connections from my Lenovo laptop
running xubuntu 17.10.

I have a number of different WiFi sources round our rather rambling
house so the laptop has to move from one to another as I move around.

When moving to one SSID in particular it always fails to get proper
settings via DHCP, in fact it acts rather as if DHCP fails altogether.
Network Manager tells me I'm connected but the WiFi has no IP address
and thus, obviously, no functional connection.

If I turn the laptop off and power it up then it connects OK to the
same SSID.

Does mv on a FAT filesystem actually rename or does it copy and delete?

I want to rename some picture files on a mounted digital camera
filesystem. It is a VFAT filesystem.

If I rename one of the files using 'mv <xxxx.yyy>' will the file
*actually* be renamed by changing the directory entry only or will
mv copy the file to one with the new name and then delete the old one?

xxx.yyy.distupgrade files in /etc/apt/sources.list - what are these?

I have just used do-release-upgrade to upgrade my system to xubuntu
17.10.

It looks as this upgrade has created some oddly named files in
/etc/apt/sources.list, these are:-

-rw-r--r-- 1 root root 78 Dec 3 16:12 owncloud.list.distUpgrade
-rw-r--r-- 1 root root 48 Dec 3 16:12 syncthing.list.distUpgrade

Can anyone tell me what these files are for?

How to allow easy editing of www-data owned files by a user

I've been trying to find a good solution to this problem for *years*
but I'm still hitting problems with it. The current problem is that
syncthing doesn't deal well with directories and files which have
different owners on different systems.

The essential problem is that web files which are manipulated by
apache need to be owned by www-data but I want to be able to edit
these files as well.

Is it a good idea to limit the range of servers that can connect to port 25?

I have run postfix for a number of years on my home (xubuntu) server
machine with my router firewall limiting connections on port 25 to
just the range of IP addresses which are my domain hosting company's
SMTP servers.

This caused me a problem recently when they started using a new SMTP
server which wasn't in the ranges allowed by my firewall.

I can obviously add the address of the new server but would have the
same problem the next time they add a new server.

Strategies for using backup MX records

This is a fairly naive and open-ended question I'm afraid but I'm sure
others here may have similar setups and thus have answers.

I run Postfix on a home server which is on all the time of course but,
as it's connected via a 'domestic' broadband service it's not a 100%
reliable connection. There are also times when I reconfigure things
(e.g. upgrade the server) that cause downtimes.

What sort of strategies are available for coping with the (rare)
disconnections of a few hours that occasionally occur?

Another systemd-resolved problem in 17.04

After my problems with systemd-resolved being unable to resolve
unqualified names I've hit another issue that seems to be a resolver
problem as well.

I left my laptop running for a few days and this morning DNS was
broken, most queries were getting REFUSED returned by the local
resolver. All other systems on the LAN (not yet 17.04) had DNS
functioning OK.

Restarting system-resolved seems to have fixed the problem (I did mean
to send it a SIGUSR2 but killed it by mistake).

Network Manager problem when changing WiFi connection in 17.04

Another problem with 17.04 that isn't in 16.04.

If you change the WiFi SSID you're connected to by simply clicking on
the new SSID then, in 17.04, Network Manager thrashes around for
several minutes and sometimes fails completely to reconnect. If you
explicitly 'disconnect' from the first WiFi SSID and then click on the
new one it works perfectly OK.

This doesn't happen in 16.04.

(I'm actually running xubuntu 17.04 but I suspect this is an Ubuntu
rather than a specific xubuntu issue)

Further problems with systemd-resolved on xubuntu 17.04

Well, having bodged my domain name into /etc/resolv.conf it seems that
systemd-resolved is *still* somewhat broken.

When I start the system it can resolve local names OK but after a
while (I haven't quite determined how long it is yet, but somewhere in
the ten to twenty minutes area I think) it fails to resolve local
names, as before with SERVFAIL.

If I restart systemd-resolved then it works again.

The result of 'systemd-resolve --status' remains unchanged all the
time.

Aha! ...

Further to DNS problem on 17.04

I've dug further into this problem, I think the fundamental issue is
that it seems that LLMNR *can't* be disabled:-

root@t470:/etc/systemd# more resolved.conf
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.

How to get the systemd resolver to resolve local (i.e. unqalified) names?

Before the systemd-resolved came along my systems resolved local (i.e.
unqualifed) names quite happily, e.g. on my older xubuntu 16.04
systems I can do:-

chris@backup:~$ host esprimo
esprimo.zbmc.eu has address 192.168.1.3
chris@backup:~$ host esprimo.zbmc.eu
esprimo.zbmc.eu has address 192.168.1.3
chris@backup:~$ host pi
pi.zbmc.eu has address 192.168.1.2
chris@backup:~$

...

SIM in Lenovo T430

I have a Lenovo T430 with Ubuntu 16.04, it's an excellent little laptop.

Does anyone know if Ubuntu can use the SIM slot in this laptop for data
and/or for making calls? If so what software might I need to install?

Can anyone expain this difference between almost identical postfix installations

I am trying to diagnose why messages from on system fail to arrive
whereas identical messages from another similar system arrive
successfully.

Both systems are single board computers running postfix 2.9.6 under
Debian. The main.cf on both systems is identical.

Different treatment of ports 465 and 587 between postfix versions 2.9 and 3.1

I am running postfix 3.1.0 on an xubuntu 16.04 system and postfix 2.9.6
on a Raspberry Pi running Debian.

They seem to act very differently as regards the use of ports 465 and
587 and I'd like things clarified so I can understand better.

I use both postfix installations to send outgoing E-Mail (i.e. mail
which is leaving my home LAN) to my hosting company's servers. Their
documentation says that I should use port 465 and TLS to connect to
the SMTP server.

On the postfix 3.1 system this works, I specify port 465 in main.cf
and everything is as it should be.

Managing cron and similar E-Mails from headless systems

I have several headless systems doing useful work around the place:-

A Raspberry Pi providing local DNS and DHCP

A Beaglebone Black on our boat monitoring temperatures and batteries

An old desktop doing backups in the garage

etc.

Most of these have one or more cron jobs running periodic rsync
backups, copying data, etc. If the cron job has an error then it
sends E-Mail to the owner of the job ('chris' in most cases, might be
root in a couple).

It's (moderately) easy to set up an MTA and /etc/aliases so that the
messages are sent to my normal E-Mail.

Is disk really bad if mkfs.ext4 -c -c reports errors?

I have been reformatting a disk which had a few corrupted files on it
with the following command:-

mkfs.ext4 -c -c /dev/sdb1

(Yes, I know this destroys all the data, everything except the few
corrupted files has been copied off the disk)

The second pass of badblocks is reporting some errors. Does this
indicate that the disk is dying?

The problem is that the documentation doesn't really tell one what the
errors mean. Do the reported errors get remapped using the bad blocks
list or are they errors which *can't* be remapped because the bad
blocks list is full?

Latest (4.4.0-53) kernel fails to boot - kernel panic

My old[ish] Acer Aspire netbook running 16.04.1 has just upgraded
itself to the 4.4.0-53 kernel, it crashes at startup with a kernel
panic, which ends as follows:-

---[ end kernel] panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

Fortunately the 4.4.0-51 kernel is still installed and still works
fine if selected from the boot menu 'advanced' options.

I looked at the grub.cfg file and the entries for 4.4.0-53 and
4.4.0-51 look the same (apart from the number difference) so I don't
really understand what's gone wrong, unless the 4.4.0-53 kernel really
is broken.

Is i

Systemd module loading error, doesn't seem to break anything though

Running xubuntu 16.04 on an Acer Apire One netbook I am getting the
following error at boot:-

[FAILED] Failed to start load kernel modules

However the system continues to load and boot OK.

How to find what options are configured in a standard Ubuntu package?

I'm trying to find out what configuration options were used to build
the wpa_supplicant that comes with Ubuntu 16.04.

Is there anywhere that documents what options have been used to build
programs in the Ubuntu repositories?

Interrupted release upgrade, how to sort out left-over old packages?

I think I know now the cause of my 'left-over' PHP5 packages in a
16.04 installation. (See previous thread)

The system in question got interrupted (the cat walked across the
keyboard!) while doing a do-release-upgrade. I restarted it and after
a couple of 'apt-get update' and an 'apt-get dist-upgrade' it seemed
to have sorted itself out and have 16.04 properly installed.

However, obviously not all the packages that should have been upgraded
were upgraded, hence my left-over PHP5 packages.

PHP5 packages can be installed on one 16.04 system but not on another

I have two xubuntu 16.04 systems both with LAMP server software on
them. On one I can see and successfully install a number of PHP5
packages, in particular php5-sqlite, on the other it can't see this
package at all using apt-search or synaptic.

I have checked through all the repsitories in /etc/apt and, as far as
I can see, they're identical.

What is wrong? I need php5-sqlite on both systems.

How to make gnome keyring ask for passphrase on the command line instead of a GUI pop-up?

I want to be asked for my passphrase on the command line in the
terminal when I ssh to somewhere. By default gnome keyring (or
whatever talks to it) asks for the passphrase in a GUI pop-up.

How can I change the default so it asks for it on the command line?

Firefox question - can I open a URL in a 'hidden' tab, or at least not move to the tab when opening it?

Is there any way in Firefox to 'open' a URL but not move to a tab to
display it?

I want to open internet radio URLs without changing what Firefox
shows, so either some sort of hidden TAB or simply a way of not going
to tabs opening certain specific URLs would do what I want.