Installing variety wallpaper changer on Fedora 25

The rpm-sphere rpm doesn’t work for me.

First install some packages, you may need more, these worked for me:

dnf install libindicator-gtk3 libdbusmenu-gtk3 libappindicator-gtk3 python-appindicator \
webkitgtk3 intltool

Then create a python virtualenv & activate it.

mkvirtualenv --system-site-packages -p $(which python2) utils

Download the variety & python-distutils-extra tarballs & untar.

Install both packages into your virtualenv (python-distutils-extra first).

python setup.py install

Go to virtualenv bin directory & rename variety.py (this upsets python module import)

cd ~/.virtualenvs/utils/bin
mv variety.py varietybin.py
rm variety.pyc

and run

variety

 

nrpe systemd socket activation

If you’re using nrpe socket activation and don’t have a template file, try this in /etc/systemd/system/nrpe@.service :

[Unit]
Description=nrpe socket service
Requires=nrpe.socket

[Service]
User=nrpe
ExecStart=-/usr/bin/nrpe -c /etc/nrpe/nrpe.cfg --inetd
StandardInput=socket
StandardOutput=inherit
StandardError=journal

[Install]
WantedBy=multi-user.target

You’ll also need /etc/systemd/system/nrpe.socket :

[Unit]
Description=Nagios Remote Plugin Executor
Documentation=http://www.nagios.org/documentation
Before=nrpe.service
Conflicts=nrpe.service

[Socket]
ListenStream=5666
Accept=yes

[Install]
WantedBy=sockets.target

Then

systemctl start nrpe.socket

emacs tip of the week #7: local chord shortcuts

I like chord-mode to avoid emacs pinkie.

If you want to bind say a quick double I to indent in python mode (and double U to unindent), do this:

(add-hook 'python-mode-hook '(lambda ()
                   (key-chord-define-local "II" 'python-indent-shift-right)
                   (key-chord-define-local "UU" 'python-indent-shift-left)))

 

Getting a lot of spam from .tk domains – kill it with spamassassin

Seems they are cheap to set up, spammers set up domainkeys / SPF too!

Here’s a spamassassin rule (don’t use it if you get valid mail from .tk):

header      NAUGHTY_FROM_TLD  From   =~ /@[a-z0-9\-\.]+\.(tk)/i
describe    NAUGHTY_FROM_TLD  From address is from a naughty TLD (eg .tk)
score       NAUGHTY_FROM_TLD  2.8

UPDATE: Looks like the spammers get a free .tk domain, rent a temporary DigitalOcean box, set up spam relay on it and blast out mail until it gets shut down.