luisaff birteenah laquintise

0 views
Skip to first unread message

Akinlolu Bellotti

unread,
Aug 2, 2024, 7:50:53 AM8/2/24
to menwerbrecat

If you have a personal domain, it is nice if you can redirectwebfinger requests so youcan be easily found via your email. This is hardly a new idea, butthe growth of Mastodon recentlyhas made this more prominent.

I wanted to redirect webfinger endpoints to a Mastondon host I amusing, but only my email and only standard Apache rewrites. Below,replace xxx@yyy\.com with your email and zzz.social with theaccount to be redirected to. There are a couple of tricks in beingable to inspect the query-string and quoting, but the end result thatworks for me is

I have a cheap no-name UPS acquired from Jaycar and was wondering if Icould get it to connect to my Synology DS918+. It rather unhelpfullyidentifies itself as MEC0003 and comes with some blob ofnon-working software on a CD; however some investigation found itcould maybe work on my Synology NAS using the Network UPS Tools nutdrv_qx driver with thehunnox subdriver type.

Unfortunately this is a fairly recent addition to the NUTs source,requiring rebuilding the driver for DSM7. I don't fully understandthe Synology environment but I did get this working. Firstly Idownloaded the toolchain from andextracted it. I then used the script from -ng to downloadsome sort of build environment. This appears to want root access andpossibly sets up some sort of chroot. Anyway, for DSM7 on the DS918+I ran EnvDeploy -v 7.0 -p apollolake and it downloaded sometarballs into toolkit_tarballs that I simply extracted into thesame directory as the toolchain.

DSM does a bunch of magic to autodetect and configure NUTs when a UPSis plugged in. The first thing you'll need to do is edit/etc/nutscan-usb.sh and override where it tries to use theblazer_usb driver for this obviously incorrect vendor/product id.The line should now look like

Lastly, you will need to edit the /etc/ups/ups.conf file. Thiswill probably vary depending on your UPS. One important thing is toadd user=root above the driver; it seems recent NUT has becomemore secure and drops permissions, but the result it will not find USBdevices in this environment (if you're getting something like noappropriate HID device found this is likely the cause). So theconfiguration should look something like:

Of course this is all unsupported and probably likely to break --although I don't imagine much of these bits are updated veryfrequently. It will likely be OK until the UPS battery dies; at whichpoint I would reccommend buying a better UPS on the Synology supportlist.

I recently picked up this portable projector for a reasonable price.It might also be called a "M5" projector, but I can not find onecanonical source. In terms of projection, it performs as well as a5cm cube could be expected to. They made a poor choice to eschewadding an external video input which severely limits the device'susefulness.

The design is nice and getting into it is quite an effort. There isno wasted space! After pulling off the rubber top covering and base,you have to pry the decorative metal shielding off all sides to accessthe screws to open it. This almost unavoidably bends it so it willnever quite be the same. To avoid you having to bother, some photos:

It is fairly locked down. I found a couple of ways in; installing theDisney+ app from the "Aptoide TV" store it ships with does not work,but the app prompts you to update it, which sends you to an actionwhere you can then choose to open the Google Play store. From there,you can install things that work on it's Android 7 OS. This allowedme to install a system-viewer app which revealed its specs:

Another weird thing I found was that if you go into the customlauncher "About" page under settings and keep clicking the "OK" buttonon the version number, it will open the standard Android settingspage. From there you can enable developer options. I could not getit connecting to ADB, although you perhaps need a USB OTG cable whichI didn't have.

It has some sort of built-in Miracast app that I could not getanything to detect. It doesn't have the native Google app store; mostof the apps in the provided system don't work. Somehow it runsNetflix via a webview or which is hard to use.

If it had HDMI input it would still be a useful little thing to plugthings into. You could perhaps sideload some sort of apps to get thescreensharing working, or it plays media files off a USB stick ornetwork shares. I don't believe there is any practical way to get amore recent Android on this, leaving it on an accelerated path toe-waste for all but the most boutique users.

For work I run a personal and a work VM on my laptop. When I was atVMware I dogfooded internal builds of Workstation which worked well,but was always a challenge to have its additions consistently buildingagainst latest kernels. About 5 and half years ago, the onlypractical alternative option was VirtualBox. IIRC SPICE maybe didn't even exist or was very early,and while VNC is OK to fiddle with something, completely impracticalfor primary daily use.

VirtualBox is fine, but there is the promised land of all the greatfeatures of qemu/kvm and many recent improvements in 3D integrationalways calling. I'm trying all this on my Fedora 28 host, with aFedora 28 guest (which has been in-place upgraded since Fedora 19), soeverything is pretty recent. Periodically I try this conversionagain, but, spoiler alert, have not yet managed to get things quiteright.

Image conversion has become much easier. My primary VM has a numberof snapshots, so I used the VirtualBox GUI to clone the VM andfollowed the prompts to create the clone with squashed snapshots.Then simply convert the VDI to a RAW image with

virt-manager has come a long way too.Creating a new VM was trivial. I wanted to make sure I was using allthe latest SPICE gl etc., stuff. Here I hit some problems with whatseemed to be permission denials on drm devices before even gettingthe machine started. Something suggested using libvirt in sessionmode, with the qemu:///session URL -- which seemed more like whatI want anyway (a VM for only my user). I tried that, put theconverted raw image in my home directory and the VM would boot. Yay!

It was a bit much to expect it to work straight away; while GRUB didstart, it couldn't find the root disks. In hindsight, you shouldprobably generate a non-host specific initramfs before convertingthe disk, so that it has a larger selection of drivers to find theboot devices (especially the modern virtio drivers). On Fedora thatwould be something like

As it turned out, I "simply" attached a live-cd and booted into that,then chrooted into my old VM and regenerated the initramfs for thelatest kernel manually. After this the system could find the LVMvolumes in the image and would boot.

After a fiddly start, I was hopeful. The guest kernel dmesg DRMsections showed everything was looking good for 3D support, along withthe glxinfo showing all the virtio-gpu stuff looking correct.However, I could not get what I hoped was trivial automatic windowresizing happening no matter what. After a bunch of searching,ensuring my agents were running correctly, etc. it turns out that hasto be implemented by the window-manager now, and it is not supportedby my preferred XFCE (see _bug.cgi?id=1290586). Note youcan do this manually with xrandr --output Virtual-1 --auto to getit to resize, but that's rather annoying.

I thought that it is 2018 and I could live with Gnome, so installedthat. Then I tried to ping something, and got another selinux denial(on the host) from qemu-system-x86 creating icmp_socket. I amguessing this has to do with the interaction between libvirt sessionmode and the usermode networking device (filed _bug.cgi?id=1609142). I figuredI'd limp along with ICMP and look into details later...

Finally when I moved the window to my portrait-mode external monitor,the SPICE window expanded but the internal VM resolution would notexpand to the full height. It looked like it was taking the heightfrom the portrait-orientation width.

Unfortunately, forced swapping of environments and still havingtwo/three non-trivial bugs to investigate exceeded my practical timeto fiddle around with all this. I'll stick with VirtualBox for alittle longer; 2020 might be the year!

The world of Python based web applications, WSGI, its interactionwith uwsgi and various deployment methods can quickly turn into aincredible array of confusingly named acronym soup. If you jumpstraight into the uwsgi documentation it is almost certainyou will get lost before you start!

Below tries to lay out a primer for the foundations of applicationdeployment within devstack; a tool forcreating a self-contained OpenStack environment for testing andinteractive development. However, it is hopefully of more generalinterest for those new to some of these concepts too.

Let's start with WSGI. Fully described in PEP 333 -- Python WebServer Gateway Interface the core concept astandardised way for a Python program to be called in response to aweb request. In essence, it bundles the parameters from the incomingrequest into known objects, and gives you can object to put data intothat will get back to the requesting client. The "simplestapplication", taken from the PEP directly below, highlights thisperfectly:

In general, this is illustrating how an API end-point might be connected together to an underlyingWSGI implementation written in Python (web_app.py). Of course,there are going to be layers and frameworks and libraries and heavensknows what else in any real deployment. We're just concentrating onApache integration -- the client request hits Apache first and thengets handled as described below.

Starting with 1 in the diagram above, we see CGI or "CommonGateway Interface". This is the oldest and most generic method of aweb server calling an external application in response to an incomingrequest. The details of the request are put into environmentvariables and whatever process is configured to respond to that URL isfork() -ed. In essence, whatever comes back from stdout is sentback to the client and then the process is killed. The next requestcomes in and it starts all over again.

90f70e40cf
Reply all
Reply to author
Forward
0 new messages