Archive for August, 2013

My first WordPress plugin: Share on Diaspora

Posted by Vitalie Ciubotaru

Not that I’m planning to write plugins for WordPress on a regular basis, so the first attempt may very well be the only one. Anyway, that is it: I wrote a plugin for WordPress.

This plugin adds a “share on D*” button to the bottom of my blog posts. D* stands for Diaspora, a free and open-source distributed social network (basically, a network of independent, but interconnected, servers). While we can see an entire zoo of share buttons for Facebook, Twitter and the like, Diaspora buttons are really hard to come by. The existing buttons are mostly limited to one host, while the code of the “properly cooked” ones can not be used out of the box. My plugin is nothing but an effort to collect the good code and package it.

This is how it looks in the `Twenty Thirteen’ theme, under the default `Hello World’ post:

Share on Diaspora button

Share on Diaspora button

"Share on D*" button

Choose a Diaspora pod from the list or type it in the text field.

Share on Diaspora button

Share on Diaspora button

The plugin is written according to Diasporial quidelines — it allows the user to select his/her pod. Its code is hosted in my Github repository. Version 0.1 of the plugin has passed the official WordPress screening and was accepted into the WordPress Plugin Directory (plugin page). Everybody is welcome to use, distribute or improve it.

* * *

Followup posts on this topic:

Logging all traffic on a cjdns node

Posted by Vitalie Ciubotaru

While sniffing the traffic flowing through a cjdns node is not possible by design (and that’s the selling point of cjdns!), a node owner might wish to see the traffic for which his/her node is the source or the destination.

1. Add a new rule to ip6tables:

$ sudo ip6tables -A INPUT -i tun0 -j LOG --log-prefix "ip6tables: "
where ‘tun0’ is the cjdns interface (different systems can have different number), and –log-prefix key adds text to the log message, so as to make it easier to filter.

2. Create a new rule of rsyslog (rsyslog is the logging daemon on Ubuntu, other systems can have different daemons, and different settings):
$ sudo touch /etc/rsyslog.d/ip6tables.conf
$ sudo echo ':msg, contains, "ip6tables: " -/var/log/it6tables.log' >> /etc/rsyslog.d/ip6tables.conf
$ sudo service rsyslog restart

where the first line creates a new config file for rsyslog, the second one adds a rule to redirect all messages that contain “ip6tables: ” to a separate log file, and the third one restarts the logging daemon with the new config.

Done! Now, if there is some incoming/outgoing (transit excluded) activity on the node, the log will contains something like:

Aug 20 18:01:51 localhost kernel: [2896208.142539] ip6tables: IN=tun0 OUT= MAC= SRC=fc5d:baa5:61fc:6ffd:9554:67f0:e290:7535 DST=fc1c:4e55:674d:970a:9901:34ae:4cb0:b00b LEN=163 TC=0 HOPLIMIT=64 FLOWLBL=0 PROTO=UDP SPT=53 DPT=57952 LEN=123
Aug 20 18:18:51 localhost kernel: [2897228.738693] ip6tables: IN=tun0 OUT= MAC= SRC=fc89:d0bf:6d7d:3e17:eda3:a53a:5846:0001 DST=fc1c:4e55:674d:970a:9901:34ae:4cb0:b00b LEN=104 TC=0 HOPLIMIT=64 FLOWLBL=0 PROTO=ICMPv6 TYPE=129 CODE=0 ID=25912 SEQ=1