page feed



31 July, 2017

Server update

oak and ash have both been updated to latest stable version of Debian (stretch). This should mark a big improvement over the software that was running on them, which was becoming quite dated.

As a result, several services have been affected by the update and have required some maintenance. These are:

  • Web services
  • MySQL
  • Matrix
  • mail (and spam filtering)
  • SSH
  • XMPP (jabber)

Outstanding issues are:

  • The XMPP server is down and will require some work to fix.

I will update below as and when problems are resolved. If you notice anything awry, please let me know immediately.

UPDATE: Web services are working again (they were only down briefly) [2017-07-31]

UPDATE: MySQL has been migrated to Maria and there was briefly an authentication, which has been resolved. [2017-07-31]

UPDATE: The Matrix server is now working again. [2017-07-31]

UPDATE: Mail is working again and should start to come through. No mail should have been lost. [2016-07-31]

UPDATE: The issue with SSH keys has been resolved. [2016-08-01]

UPDATE: The remaining issue with URL rewriting has been resolved. [2016-08-01]

UPDATE: The spam filter (spamassassin) works again. [2016-08-01]


3 July, 2017

Matrix server

The matrix server, running at matrix.waxworlds.org, will probably be intermittent for a couple of days while I upgrade it.

If anyone isn't using Riot, you can get a client for Android, iOS, the web and your desktop (although the desktop client is a bit shoddy, so I use the website, which integrates well with desktop notifications, sounds, etc).

If you want an account adding at matrix.waxworlds.org, please email me.


15 June, 2017

Major server failure

oak.waxworlds.org died rather unexpectedly last night. I have not yet had a chance to make a propper analyisys of the problem, but it looks as though the disk might be toast and a complete reinstall might be on the cards.

The upshot of the situation is that mail, jabber and access to the Central network are unavailable until I am able to resolve the problm.

I will update here as things unfolds or when I find out more.

Update: oak has been up and running this evening and has been catching up with mail. All services are restored. However there will be intermittent downtime over the next few days as hardware is replaced. [2017-06-15]


8 December, 2016

Service disruption to ash

ash.waxworlds.org will be down for maintenance for approximately 1 hour tomorrow evening at 9pm GMT, after which time it will have more RAM.

Update: all done. [2016-12-09]


6 December, 2016

Service disruption to oak

oak.waxworlds.org will be down for approximately 2 hours tomorrow evening at 6pm GMT while work is undertaken on the power.

Update: work has been completed on schedule. [2016-12-07]


25 November, 2016

Spaces within parenthesis in emacs

There’s lots of opinion about coding styles and which is best. I prefer one that helps you read the code. And, to that end, I prefer to have spaces inside parenthesis, like this:

for( int a = 0; a < 20; a++ ) {
    dump( data[ a ] );

Call me a heathen if you like, but it’s how I roll!

And it’s how I set out to configure emails to help me roll…

Unfortunately, emacs’s electric-pair-mode doesn’t do this sort of thing and can’t be configured to, either. There are two problems. The first is that electric-pair-mode doesn’t allow for conditions as to when it will insert a pair. So, I could add a pair of spaces, (?\s . ?\s), to electric-pair-pairs so that it would automatically insert a second space, but it would do this for every space I typed. The second problem is that electric-pair-mode does some white-space skipping internally, which I think would be problematic. :(

So I did it the old-fashioned way and added my own functions:

(defun my/c-mode-insert-space (arg)
  (interactive "*P")
  (let ((prev (char-before))
        (next (char-after)))
    (self-insert-command (prefix-numeric-value arg))
    (if (and prev next
             (string-match-p "[[({]" (string prev))
             (string-match-p "[])}]" (string next)))
        (save-excursion (self-insert-command 1)))))

(defun my/c-mode-delete-space (arg &amp;optional killp)
  (interactive "*p\nP")
  (let ((prev (char-before))
        (next (char-after))
        (pprev (char-before (- (point) 1))))
    (if (and prev next pprev
             (char-equal prev ?\s) (char-equal next ?\s)
             (string-match "[[({]" (string pprev)))
        (delete-char 1))
    (backward-delete-char-untabify arg killp)))

They can be bound in c-mode and c-mode derivatives like this:

(add-hook 'c-mode-common-hook
          (lambda ()
            (local-set-key " " 'my/c-mode-insert-space)
            (local-set-key "\177" 'my/c-mode-delete-space)))


6 October, 2016

Service disruption to oak

It would appear that our service provider have made a misconfiguration whilst transferring IP addresses to the new DSL (see post for 2016-10-02). As a result, oak is currently down.

Mail and jabber will most notably be affected, although no mail should get lost (it will come through when oak comes back on-line).

Apologies for any inconvenience. I will update as I resolve the issue with our provider.

Update: The issue has now been resolved. All services should be up and running as normal again and mail will no doubt start trickling through again. [2016-10-06]


2 October, 2016

Temporary IP address changes to oak

As of Sunday 2nd October, the IP address of oak.waxworlds.org may change temporarily. DNS records will be updated accordingly, and there should be minimal service disruption. Oak's IP address should revert to that previously assigned in a few days. I'll update this post as I hear more.

Update: The IP address has changed. DNS has been updated. The interface of oak's default route has also changed, so please report any problems. [2016-10-02]

Update: Our service provider appears to have made a misconfiguration whilst transferring IP addresses. As a result, oak is currently down. [2016-10-06]

Update: IP addresses have been restored, although oak's IP address has actually changed to a different one within the subnet. Hopefully everything should be working again now. [2016-10-06]


19 November, 2015

Server software update and migration

I will be updating ash to Debian 8 on Sunday 22nd November. There should be vitually no disruption, aside from a reboot.

I will also be moving oak to a new machine (which will be running Debian 8). There may be a brief disruption to mail and xmpp while I transfer configuration, etc.

I'll update this post with further info.

Update: This entire upgrade/migration has been postponsed due to a) an issue with oak's new hardware, and b) a hardware issue that is preventing backups on willow.


8 October, 2015

Using a shell in Emacs

Emacs Pumpkin

Emacs rocks.

It’s true, it does.

Recently, though, I’ve been trying to streamline my use of the shell in Emacs. Here’s my Halloween Emacs tips.

Added support for multiple shells

The first, glaring problem with shells in Emacs is that you can only have one.

I added a function that creates a shell based on the remote host of a buffer. It also names the shell after that host, so if I’m working on /example.com:/some/file, I’ll get a shell called *shell:example.com* (instead of just *shell*). This allows you to have multiple shells open simultaneously, one per host. [Credit: EmacsWiki]

(defun my/shell (&optional buffer)
   (let* ((tramp-path (when (tramp-tramp-file-p default-directory)
                        (tramp-dissect-file-name default-directory)))
          (host (tramp-file-name-real-host tramp-path))
          (user (if (tramp-file-name-user tramp-path)
                  (format "%s@" (tramp-file-name-user tramp-path)) ""))
          (new-buffer-name (format "*shell:%s%s*" user host)))
     (shell (if host new-buffer-name buffer))))

Added F9 shell toggle

Then I added the F9 global key binding to toggle between the current buffer and the related shell for the current buffer’s host, creating that shell as necessary.

(defun my/shell-toggle (&optional buffer)
  (if (string-match "^\\*shell[\\*:]" (buffer-name) )
      (my/shell buffer)))
(global-set-key [f9] 'my/shell-toggle)

Handle shell termination

There are several ways you could handle terminating the shell. You could, just for shell buffers, turn off the prompt that asks you if you’re sure you want to kill a buffer with an active subprocess running in it, and then use C-x k. But this would kill bash rudely, and bash would not save your command history. You could tell bash to save command history after every command. But this leaves executed commands between different shells all intermixed in the history file and shells would no longer have their own individual session history. That doesn’t appeal to me.

So I opted for another method: detect when the shell terminates and close the emacs buffer. This way, you can hit Ctrl-D (same as you would in a terminal window), bash saves its history, and everyone’s happy.

(add-hook 'comint-exec-hook
          (lambda ()
            (set-process-sentinel (get-buffer-process (current-buffer))
(defun my/shell-process-sentinel (process state)
  ;; show shell status and kill the buffer automatically
  (message "shell: %s" state)
  (if (or
       (string-match "exited abnormally with code.*" state)
       (string-match "finished" state))
      (kill-buffer (current-buffer))))