I write these blog entries in Markdown mode, but markdown-mode in Emacs doesn't stick links at the end of the text the way God intended (and the way footnote-mode does). This is close, but not yet working:
(defun x-hugh-markdown-footnote (description)
"A Small but Useful(tm) function to add a footnote in Markdown mode.
FIXME: Not yet working, but close."
(interactive "sDescription: ")
(let ((current-line (line-number-at-pos))
(last-line (line-number-at-pos (point-max)))
(link (read-string "Link: "))
(link-number (x-hugh-get-next-link-number)))
(save-excursion
(if (> (- last-line current-line) 1)
()
(insert-string "\n"))
(goto-char (point-max))
(insert-string (format "\n[%d]: %s" link-number link)))
(insert-string (format "[%s][%d]" description link-number))))
(defun x-hugh-get-next-link ()
"Figure out the number for the next link."
(interactive)
(save-excursion
(goto-char (point-max))
(beginning-of-line)
(if (looking-at "\\[\\([0-9]\\)]:")
(eval (+ 1 (string-to-number (match-string 1))))
(eval 0))))
Right now it craps out with a "Wrong type argument: integer-or-marker-p, nil" when it runs x-hugh-get-next-link. Doubtless I'm doing a bad thing in my half-baked attempt to return a number. But still, close!
(UPDATE: I figured it out! To return a number, wrap it with
eval
. Fixed above. Working!)
(Believe it or not, I started out to write about Github and bioinformatics. Such is the life of the easily distracted.)
ObMusic: "The Balcony" by The Rumour Said Fire. Reminds me of 60s folk. I like it.
Install logwatch on Solaris fileserver.
Notice that logwatch emails are not coming in.
Log in and run logwatch by hand.
Inspect mail log and notice lack of any entries.
Notice that Postfix is in maintenance mode; start it up.
Notice continued lack of emails.
Notice that Postfix is running, which confused svcadm when told to start up Postfix. It fails to do so and fails to log this.
killall postfix, svcadm enable postfix.
man svcadm; svcadm clear postfix; svcadm enable postfix.
Run logwatch by hand; notice emailed report to "root@localhost.localdomain", which gets bounced by Postfix on the mail server because it's a non-existent host.
Resist temptation to go down that rabbit hole just now, and stick to the problem at hand.
Edit /opt/csw/etc/log.d/logwatch.conf and set MailTo to proper address.
Re-run logwatch and note that reports are still going to root@localhost.
After much swearing, notice that actually, logwatch is set to look in /opt/csw/etc/log.d/conf/logwatch.conf for configuration.
Edit that file, re-run logwatch.
Notice errors from Postfix: "postdrop[13848]: [ID 947731 mail.warning] warning: mailqueueenter: create file maildrop/908447.13848: Permission denied".
Run "postfix set-permissions". Test mail; still failing.
Check permissions on another system and set by hand.
Re-run logwatch. Still no email. Re-run with debug=high and get email.
Wonder idly about futility of self-aware log watching system that can't report on its own heisenbug-induced failure, crappy packaging practices, inability to check end-to-end email connectivity, other career options.
(Update) Realize that the emails show up if "Detail" is set to Medium or High ; Low, the default, makes the report silent.
(Update) Uninstall the package and reinstall, only to find that the symlink to conf/logwatch.conf is set up at installation, and that this is probably a case of $EDITOR breaking the symlink. Apply head to desk.