2015-02-19 Reworked an old PHP website of mine, today. This one accompanies me since ten years already. (The code behind it is accordingly bad ... although it had improved through several reworks consid- erably.) The website receives few to moderate traffic and re- ceives changes infrequenty. Since I migrated the website from an webspace the a server I more and more switched from the database storage to file system storage. Today, I did another such transfer. This made it much easier to connect an email gateway to it. With about 25 lines of shell script and one MTA alias, I made it possible to insert content by email. This is the first time that I implemented such a thing, but it is only sensible, as I am really email-centered. #!/bin/sh # depends: mmh, imagemagick, mailx export PATH="/usr/local/mmh/bin:/usr/local/bin:/usr/bin:/bin" dir="/var/www/.../`date +%Y`" tmp="`mktemp -d`" trap 'rm -rf "$tmp"' 0 1 2 15 cd "$tmp" mkdir .mmh echo "Path: $tmp/.mmh" >.mmh/profile MMH=.mmh mhstore -file - rm -f *.plain for i in *.jpg *.png ; do [ ! -f "$i" ] && continue mogrify -resize 400x "$i" done chmod 664 * chgrp foogroup * [ ! -d "$dir" ] && mkdir "$dir" && chmod 775 "$dir" mv * "$dir" || mail -s "Nothing to store" meillo <<-! $0 I received a message that had no attachments. Please check if this was as intended. ! This is a good explanation of the difference between /var/log/messages and /var/log/syslog. [0] Via TUHS mailing list, I came across this cool blog post. [1] I started to copy data (backups) from Molly to Quagga. [0] http://wayback.archive.org/web/20101007163324/http://namakajiri.net/complog/the- difference-between-messages-and-syslog/ [1] http://garrett.damore.org/2014/09/modernizing-less.html http://marmaro.de/lue/ markus schnalke