Archive for July, 2010

My first prosody module!

Saturday, July 24th, 2010

I have recently written two XMPP related things. The first is a prosody module called mod_post_msg which accepts messages in a HTTP POST, using HTTP authentication. It was inspired by this ejabberd module by skeltoac, but it takes full stanzas, whereas mine just takes a plain text message body.

The second is a sendxmpp like Bash script based on cURL which works with the module. It is supposed to work like sendxmpp, but doesn’t support all of it’s options. You can get sendxmpp-curl here.

This allows you to post simple XMPP messages from CLI (like sendxmpp), with less round trips than a full XMPP session would require (At least I hope so).

“sudo gedit” must die!

Friday, July 23rd, 2010

Why is it that so many Ubuntu guides tell you to do sudo gedit /path/to/somefile when there is a sudoedit command? An editor, like Gedit, doesn’t need to run as root, ever.

This is so much better and safer:

SUDO_EDITOR=gedit sudo -e /path/to/somefile

This will …

  1. Copy the file to /tmp/
  2. Invoke gedit as your user
  3. Update the original file if you changed the temporary file

It would of course be really useful if gksudo had this built in already, and could be used in a nice way by nautilus-gksu.