Saturday, January 30, 2016

Bitlbee 3.4.1 plugin issues

One of the hazards of working with open source code is that there's always someone likes to customize "How Things Are Done", thereby managing to gum up the works for everyone else. Case in point, by default:
  • Bitlbee 3.4.1 expects plugins to be located in /usr/local/lib/bitlbee
  • The Facebook MQTT and Steam plugin code drops their libs in that folder
  • The Omegle and Torchat plugin code drops their libs in /usr/lib/bitlbee

The end result: any attempt to use the Omegle or Torchat plugins results in an "Unknown protocol" error.

The fix: use "./configure --prefix=/usr/local" instead of just "./configure".

Sunday, January 24, 2016

What have I been reading this week? (20160124)

The listing is a bit sparse as I spent the week learning about (and playing with) Docker and various Docker containers. I now have very nice set ups for Guacamole, Shout-IRC, and an in-progress web-based home-grown container controller. I've also decided that Booktype 2.0 is more hype than anything else (being non-intuitive, bloated (dozens of dependencies) and being able to produce less than my home-grown Docbook editor (okay, something in the "publish" code is definitely borked)).

2016-01-19

- Announcing sshexport
- Making WhatsApp free and more useful
- Retirement of certain Google search APIs
- Crashing Your Browser

2016-01-20

- Sort Faster with FPGAs
- Adblock Plus blocked from attending online ad industry s big annual conference
- Announcing Wolfram Programming Lab Wolfram Blog

2016-01-22

- Learn R From Scratch Part 1
- Learn R From Scratch Part 2
- Learn R From Scratch Part 3

2016-01-24

- How deep is the snow on Jill's bucket?

Above was generated by a homegrown bolt-on script for Wallabag, which is a free utility for capturing web content so that it can be read later.

Saturday, January 23, 2016

Shellinabox working with Docker

About a week ago, I became interested in Docker after spending hours trying to (unsuccessfully) get Guacamole to work on a lab machine. In frustration, I tried the Docker version. Guacamole was up and running about five minutes after that.

This week, I've been working on a web-based front-end to Docker. So far, I'm able to list containers and start/stop/pause/unpause them. Last night, I added ShellInABox to the mix. In short, I can now access the individual containers via a browser-based termernal. Not wanting to have multiple full-time instances of SIAB, I used the CGI option and came up with the following CGI script:

#!/usr/bin/perl

use CGI;
my $query=new CGI;

my $container_id=$query->param("container_id");
chomp $container_id;

system("sudo shellinaboxd -q -t --cgi --service='/':0:0:'/var/tmp':'/bin/bash -c \"docker exec -it $container_id bash\"'");

Above is called by an url (in the web front-end) that looks like: "http://dockerbox.joat/cgi-bin/siab.cgi?container_id=6402f93179a1". It can also be called via the appropriate POST request.

Noted shortcomings:

  • SIAB appears to not function well with Chrome. In reading various others comments on the topic, it appears that Google made changes to the CSS handler some time in the past and it appears to be on the SIAB author(s) to make adjustments.

    Update: While the bug is quite annoying (ShellInABox output sometimes is mashed into a single line), it becomes minor one once you know the work-around: change your zoom level back to 100% and refresh the page.

  • SIAB does not automatically disconnect from the target container when the browser window is closed. I'm experimenting with Bash shell timeouts in an attempt to compensate.

    Update: The browser timeouts appear to work. Add the following to /root/.bashrc in each container:

    TMOUT=300
    readonly TMOUT
    export TMOUT

    Above will automatically logout the user after 5 minutes of inactivity. Doing so also kills the individual instance of ShellInABox (in CGI mode). Of course, this does nothing for security of the configuration so absolutely DO NOT USE this in production environments.

    Update: You can also add in a "cleanup" system call to kill existing/unused instances of ShellInABox. "killall shellinaboxd" or some such.

  • There's absolutely no security associated with the above method, so add authentication and security (e.g., encryption) before using the above.

Sunday, January 17, 2016

What have I been reading this week? (20160117)

I included the piece about Docker 'cause it's basically the same logic set that I passed through today. Although I run a hybrid network, I've been having fewer issues with Ubuntu than with CentOS.

That and I implemented my first docker instance today (three containers, supporting a Guacamole instance). I'd resorted to trying a Docker instance after spending hours in an attempt to get Guacamole to build. Five minutes later (using someone else's recipe) and Guacamole is up and running.

In any case, this past week's reads:

2016-01-12

- The Boy Who Could Change the World
- Summon Your Tesla from Your Phone

2016-01-13

- The Dying Art of Mental Math Tricks

2016-01-18

- Yahoo Releases the Largest-ever Machine Learning Dataset for Researchers
- Linux-toys.com Blog Archive Goodbye Docker on CentOS. Hello Ubuntu!
- altcoins - Analyzing the $5.6 Million Exploit and Cryptsy's Security Failings
- Sean Penn and El Chapo : Operational Security Errors Part 1 Hacker Daily
- The Secretly Exceptional Mind of Mrs. Einstein
- client bugs CVE-2016-0777 and CVE-2016-0778

Above was generated by a homegrown bolt-on script for Wallabag, which is a free utility for capturing web content so that it can be read later.

Tuesday, January 12, 2016

PmWiki textarea autofocus

I often end up tweaking various tools to avoid having to reach for the mouse as the first action (i.e., to focus on a field before entering text).  Following is a modification for auto-focusing the editor textarea in PmWiki.  Note: assumption is that the Triad skin is employed.

1) Find pub/skins/triad/wikilib.d/Site.Popup-EditForm and open it in an editor.

2) In that file, there is only one instance of "textarea". It looks like:

  (:input e_textarea :)

Make it look like:

  (:input e_textarea focus=1:)

3) Save and exit

After that, whenever you open the edit function, the main textarea should already have focus.