Archives July 2014

Create your own virtual keyboard with Python

So at some point I need the voice dictation client to be able to do basic interactions with applications on the desktop (think typing text and the like). So how do I go about doing that? I want to be compatible with Wayland when it shows up, but still work on X (since that's where I'm working now). That would seem to preclude using X event sending. What about making a "virtual keyboard" that actually sends the events through the Linux kernel event subsystem?

The resulting spike-test (using uinput) is checked into the listener project. It seems to ...

Continue reading

GStreamer Level Plugin Monitoring

So you have an audio stream where you'd like to get a human-friendly readout of the current audio level. You add a level component, but how do you actually get the level messages it generates?

            bus.add_signal_watch()
            bus.connect( 'message', self.on_level )

It really seems that you *should* be able to use element.connect(), but there doesn't seem to be an available event to which to connect on the level. So, you wind up having to process all of the events and look for your level event...

    def on_level( self, bus, message ):
        """Level message was received"""
        if message ...

Continue reading

wx in a VirtualEnv (for RunSnakeRun)

Since I got asked about this in email I'll post it here for the google-verse. Say you want to allow your developers to use RunSnakeRun running in a virtualenv on an Ubuntu distribution.  You'll recall that normally to run RSR as a utility you do:

$ sudo apt-get install python-wxgtk2.8
$ pip install --user SquareMap RunSnakeRun
$ runsnake

That gets a bit more complex when you want to put RSR in a virtualenv (the question was actually how to make this work on many, many workstations using puppet, but you puppet peoples can figure that out). Building wxPython is not ...

Continue reading

Nginx Reverse Proxy with Authentication

So you have an internal device the web-gui of which you want authenticated users to be able to access.  You've got nginx running on the front-end server. You're willing to open up a port on the outside firewall, but all access on that port needs to go through your main web-app's permissions. You setup an nginx proxy like so:

upstream internal_gui {
    server 198.51.100.5:443 fail_timeout=0;
}

That sets up your upstream proxy. Here we're connecting to ssl. We then setup a server to listen on a high port (using ssl). It has two ...

Continue reading

Daily archives

Previous month

June 2014

Next month

August 2014

Archives