Passing REMOTE_USER through mod_WSGI

I need to change the way we authenticate a django application.

Currently we authenticate by an apache module which sets the REMOTE_USER header and passes it to the python app in the environment of mod_wsgi.

The new approach will be to use an app gateway. The gateway works like a reverse proxy and intercept requests to the application. The app gateway authenticates the user and if succesful forwards the request to our application with the REMOTE_USER header set.

The problem with this approach is that mod_wsgi will drop that header. Read more

Mars imaging notes

Some notes on how I’ve been processing recent mars images.

All my images are with the C9.25, televue 2.5x powermate, antares filters and ASI 120mm camera. Using the 5x powermate just gives a blob that I can’t pick out details on. Read more

OMNIRIG AND the ICOM 7300 FIL2 problem

I came across an odd problem getting my shiny new IC-7300 working for digital modes using Omnirig. I set the filter to FIL1, the default widest filter, and the software (JTDX in this case) would transmit correctly. But after the transmission period when it went back to receive it would activate the narrower FIL2. Here’s what’s going on… Omnirig sends this instruction to the ICOM to go back into receive: [pmDIG_U]; These lines select USB-D Read more

Installing Jupyter Notebooks on Solaris

pip installing jupyterlab may give you the following error (somewhere in the error output anyway!): The simplest solution I’ve found to this is just to install libzmq. We can pull the latest code from github and install it. I usually install things in /opt but as the pip process will look for libzmq in /usr/local, we’ll install it in there this time. If you do put it somewhere other than /usr/local you might need to Read more

Install scipy on Solaris

When trying to install scipy via pip on Solaris you may encounter this error: There’s a simple way to resolve this but it’s not immediately obvious. BLAS (Basic Linear Algebra Subprograms) and LAPACK (Linear Algebra Something Something…?) are actually provided by the Solaris math and perf libraries, so installing those and setting a couple of environment variables will get scipy and numpy up and running for us on Solaris. Python 3.7 is in more SRU’s. Read more

One-hot encoding labels

Another little snippet that I sometimes forget 🙂 Suppose you have a dataframe with a column that has data in a string format and you need to transform that into a way that a machine learning algorithm can use. One good way is with one-hot encoding which will take the values in the column and create new columns with 1’s & 0’s representing the original data. Have a look at this dataframe snippet: prod rev Read more

Cheap radio audio interface

This turned into a surprisingly tricky project… I have a signalink as my main audio interface box to my radios. It’s basically a USB sound card that connects to the data port of my radios and lets me use digital modes. It also has a couple of knobs to control levels. It’s great, I love it, but as it costs about €130 I wasn’t going to bu another one just for the convenience of not having to move cables around when I want to use it on a different radio. Read more

Django Q function

When querying objects in django the simplest way is to use the filter() query. If we have a set of systems for example and we want to filter out those that have a SPARC architecture we could do: >>> System.objects.filter(architecture=”sparc”) And if we wanted to narrow that down to only sparc machines that use NIS for name resolution we could do: System.objects.filter(architecture=”sparc”).filter(name_resolution=”NIS”) But that is narrowing down the selection. It’s an AND. What were asking Read more

Simple SSTV from the ISS

From time to time the International Space station transmits Slow Scan TV (SSTV) images as it passes overhead. These are relatively simple to receive and decode and sometimes you can get a downloadable certificate for decoding them. Read more