SNMP logging a lot to Syslog

SNMPd is a systemd, unit now.

So the file we have to modify is not /etc/default/snmpd but /etc/systemd/system/multi-user.target.wants/snmpd.service

We just need to change -Lsd to -LS4d to only log warning level messages and get rid of the millions of UDP connections.

[Unit]
Description=Simple Network Management Protocol (SNMP) Daemon.
After=network.target
ConditionPathExists=/etc/snmp/snmpd.conf

[Service]
Environment="MIBSDIR=/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf:/usr/share/mibs/site:/usr/share/snmp/mibs:/usr/share/mibs/iana:/usr/share/mibs/ietf:/usr/share/mibs/netsnmp"
Environment="MIBS="
Type=simple
ExecStartPre=/bin/mkdir -p /var/run/agentx
ExecStart=/usr/sbin/snmpd -LS4d -Lf /dev/null -u Debian-snmp -g Debian-snmp -I -smux,mteTrigger,mteTriggerConf -f
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target

After that run:

systemctl daemon-reload
systemctl reload snmpd

Samba hell

The share options “read only” and “writeable” have the following defaults:

Default: read only = yes
Default: writeable = no

So, think of explicitly set write permissions if needed (or lose a lot of time searching why you cannot write, that happened to a err.. friend, you know :/).

Obey pam restrictions has weird side effects like using the default UMASK set on the host for creating files, which de facto overwrite the force create mode and force directory mode options. That’s also a good way to lose time searching why the permissions are not set correctly.

On some old configurations I found it set to yes, but the default is now no.

Default: obey pam restrictions = no

Source: https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html

Little one liners you always need

ip – show / manipulate routing, network devices, interfaces and tunnels

ip addr
ip route show

du – estimate file space usage

du --max-depth=1 --human-readable --one-file-system Documents/
du -hxd 1 Documents/

rsync – a fast, versatile, remote (and local) file-copying tool

rsync -avz --update -e ssh --progress --delete leopardb@neptune:/home/leopardb/Documents/ /home/leopardb/Documents/ --dry-run
rsync -avz --update -e ssh --progress --delete leopardb@neptune:/home/leopardb/Documents/ /home/leopardb/Documents/

Smbclient

For some reason, this is not the default, but to connect to any reasonably recent SMB server, you must pass the -m SMB3 argument, like:

smbclient -m SMB3 -L mycomp -U myuser -W MYDOMAIN
smbclient -m SMB3 //mycomp/sharedfolder -U myuser -W MYDOMAIN

To send an email in one line

Sending it to root, to make sure the redirection works.

In my case, using postfix, the right email address is in /etc/aliases

echo -e "From:authorized@domain.com\nTo:leo@domain.com\nSubject:Test Email - can delete \n\n Just a test, did it come through ?\n" | sendmail root