You are not logged in.

#1 2015-02-08 13:28:09

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 813
Website

Reviving the doomcube

I find the GPL Cube of Potential Doom fascinating.

A long time ago I put some serious thought into making a Compiz plugin from this, but there were problems:

  • It required a custom kernel with the conntrack module

  • Use of conntrack to get the network information required SUID

  • I lacked experience to do anything about it?

At least the first two problems weren't that hard to solve.

I made a bash script to get the connection info:
doomcube-feed

#!/bin/bash

[[ -n "$1" ]] && SLEEPTIME="$1" || SLEEPTIME="5"

while true; do
  CONNECTIONS="$(ss -n | grep '^[a-z]*p' | sed 's|[a-z]*p[ ]*[A-Z]*[ ]*[0-9]*[ ]*[0-9]*[ ]*||g;s|-[A-Z]*.*||g;/^$/d')"

  #ports
  PORTS="$(echo "${CONNECTIONS}" | sed 's|.*:||1')"

  #ips local
  IPIN="$(echo "${CONNECTIONS}" | sed 's|:.*||1')"

  #ips remote
  IPOUT="$(echo "${CONNECTIONS}" | sed 's|[0-9]*.[0-9]*.[0-9]*.[0-9]*:[0-9]*[ ]*||1;s|:[0-9]*.*||g')"

  LINENUM="0"

  while read -r line; do
    ((LINENUM++))
    OUTPUT="$(echo "${IPIN}"| sed -n "${LINENUM}p") $(echo "${IPOUT}"| sed -n "${LINENUM}p") $(echo "${PORTS}"| sed -n "${LINENUM}p")"
    [[ ! "${OUTPUT}" == "\n" ]] && echo "${OUTPUT}"
  done <<< "${CONNECTIONS}"

  sleep "${SLEEPTIME}"
done

This will feed the connections to doomcube (in 5 second intervals by default):

doomcube-feed | doomcube

Now I need to learn about making compiz plugins. There's a little info on the compiz website, but very few up-to-date resources on this topic exist.

Last edited by quequotion (2015-02-08 19:11:08)

Offline

#2 2015-04-11 12:04:34

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 813
Website

Re: Reviving the doomcube

Back to requiring suid again...

This doesn't make sense to me: when I posted this thread, ss did not need to be called by sudo to output destination IPs but now it does; why?

And then sometimes it doesn't need sudo at all....?

Last edited by quequotion (2015-04-11 12:06:52)

Offline

Board footer

Powered by FluxBB