The other week, I wrote about introducing SQLite support to Known.

Seemingly, I was on a role, and because a client asked me to look in to Postgres support for a separate project, I thought I’d have a crack at implementing support for Known, which I’m glad has been merged in.

This turns out to have been useful to a bunch of folk, for which I am glad.

Installation

Postgres support is still in Beta, and MySQL is still the recommended database engine, so currently installation is a bit of a manual process.

First, you need to make sure you’ve got Postgres support built in to PHP:

apt-get install php5-pgsql
php5enmod pgsql

Then, you need to modify your config.ini

database = 'Postgres'
dbname = 'dbname'
dbpass = 'password'
dbuser = 'username'
dbhost = 'hostname'

filesystem = 'local'
uploadpath = '/path/to/upload_directory/

Once you’ve done that, you need to install the schema, which currently needs to be done from the command line.

psql -c 'create database ;' -U 
psql -U  -d  -a -f schemas/postgres/postgres.sql

Assuming you got no errors, you should now be good to go!

So, a few weeks ago I hacked together some logs for the #knownchat IRC channel.

I accomplished this by hacking together a very simple IRC logging bot. This bot will sit on an IRC channel and output logs in github friendly Markdown (so you can post them to a repo and give people an easy way to read them).

Since it was just as easy to write a flexible bot than a single use bot, I thought others might be interest in it.

Usage

The bot isn’t fancy, but it does the job.

It only supports logging of a single channel per instance, but it will interface with a nickserv server to identify itself, and will log each day’s activity in a separate file (in nicely sortable YYYY-MM-DD.md format) in a directory per channel.

Fire it up in a screen on an always on machine and you should start collecting logs straight away. To create the logs for #knownchat, I turned it’s channel dir into a git repo, and periodically push on a cronjob, but you might find other ways of doing things.

To keep things quiet, it’ll only log chat, not channel messages (leave/join etc).

Hopefully someone else’ll find this useful!

» Visit the project on Github...

IRC (Internet Relay Chat) is a protocol that lets you communicate in text based chat rooms over the internet, and is basically what we all used to use in the 90’s before Twitter or WhatsApp. Think of it like multi-player notepad.

Most folk don’t even know it exists, but many technical people (especially those in the free software community) use IRC to facilitate discussion and development with people around the world.

I quite often use my Known site to share links with people over twitter and facebook, but to do the same with folk in IRC I’d have to paste the link by hand, and, well… I’m lazy. So I wrote a plugin!

One particularly handy thing you can do, combined with my command line API tools, is that you have a quick way to post from system services or internet connected (IoT) devices… but I’ll leave that as an exercise for the reader.

Known IRC

The Known IRC plugin adds the ability to syndicate short messages and share links to one or more IRC channels.

Once activated and configured, you will be able to syndicate out to IRC straight from your site.

Limitations

There are a couple of limitations of course…

  • IRC only lets you have one nickname per network (freenode, efnet etc), so if you sit on IRC as well, use a different nickname. Also consider registering this name with nickserv (the plugin supports nickserv passwords)
  • The plugin doesn’t perform a persistent login (for various reasons), therefore it’ll join, post and then leave the channel.

» Visit the project on Github...