Skip to content

Instantly share code, notes, and snippets.

@therealchjones
therealchjones / google-openidc-apache.md
Last active January 9, 2024 16:30
Easy Google authentication for Apache

Google authentication for Apache

What do we want?

Primary goal

Protect a web resource served by Apache httpd without making users "sign up" or add a new login and password combination to keep track of.

Secondary goal

@therealchjones
therealchjones / seedhost-mod_auth_openidc.md
Last active December 19, 2023 20:39
mod_auth_openidc on a seedbox

Note: I'm a customer of SeedHost and am happy with their services, but am not employed by them and do not receive compensation from them or associated companies for any purpose.

@therealchjones
therealchjones / seedhost-webserving.md
Last active May 25, 2024 23:04
seedhost web serving

Seedhost's web server structure

I don't know if this applies to all Seedhost servers, just "Dedicated Hosting", or just the server I use. I've made some notes here because it's not entirely straightforward and doesn't appear to be documented elsewhere. If you're looking to host your own content on a Seedhost box, however, it may be useful to know how the system is arranged and what you can do with it.

Primary external web server: nginx

  • nginx listens on 80 and 443 (ssl) with default server_name set to servername.seedhost.eu (mine is server1359.seedhost.eu).
@therealchjones
therealchjones / scripting-rtorrent.md
Last active November 22, 2023 20:41
Notes on scripting rtorrent

tested and source reviewed for rtorrent 0.9.6

d.multicall2=viewname,command performs command for each download that is visible in view viewname. This is not the same as each download with d.views.has=viewname. I think that d.views.* and view.* describe two entirely different things, or at best ones that are loosely related. Also, inconsistent naming and implicit targets just suck. A view (view.h) is a list of downloads split into visible downloads and filtered (not visible) downloads. set_visible(d) and set_not_visible(d) moves download d between the sublists, and filter_download(d). view.add=name -> core::control->viewManager.insert_throw(name) -> viewManager.insert(name) creates the new view and runs view.initialize(), which adds all existing torrents from the download list into the view (doing nothing to the downloads or d.views themselves)

When a download d is added (be it from session or new), view.

@therealchjones
therealchjones / My Life in the Mines.md
Created September 24, 2023 19:47
My Life in the Mines - a fragment of an incomplete memory of an imperfect performance of an unknown source

My Life in the Mines

Let me tell you about my life in the mines. First, just to give you an idea of the intellect of the people in the mines, I went into the mines one day and said to one of my fellow miners, "Have you ever heard of Marcel Proust?"

He said "No, he must work in another mine."

"No," I said, "Marcel Proust is a French author who, when he eats breakfast, dips his biscuit into his tea. Then, when he bites his biscuit, all his memories come flowing back."

Well, I decided to try my hand at Mr. Proust's task and write a book. I called it My Life in the Mines. It consisted of this:

@therealchjones
therealchjones / stars.txt
Created December 11, 2022 20:41
Silly parody in response to a conversation long ago...
“Stars”, or why Javert hates Visual Studio
Here, coding on Windows
An IDE lacking
Regexes and scripting
And syntaxes (but C)
God be my witness
I never compile
Without an error or three
without an error or three
@therealchjones
therealchjones / macOS-path.md
Last active February 27, 2024 21:25
Some notes on the environment (especially PATH) in macOS

macOS PATH and Visual Studio Code

As of macOS Monterey 12.2.1 and Visual Studio Code 1.66.0.

The value of macOS's PATH environment variable is set or modified by many different processes. By the time you run programs from the integrated terminal in Visual Studio Code, it's changed several times. Running a task or launching an extension in VS Code makes it even more complicated. Let's take a look.

PATH inheritance

On macOS, each process after booting is started by another process. When creating the "child" process, the "parent" process can choose what environment the child process starts with. Most programs either allow their child processes to "inherit" the same process they started with or start their child processes with "clean" environments with relatively few environment variables set, but nearly any customization of the environment is possible for each child process.

@therealchjones
therealchjones / keycodes.py
Last active February 16, 2022 22:39
Keycodes for Parallels Desktop
#!/usr/bin/env python3
# Parallels Virtualization SDK 17 for Mac:
# https://www.parallels.com/download/pvsdk17/
import prlsdkapi
import string
# Using Parallels SDK to send keycodes/keystrokes to Parallels Desktop virtual
# machine example ("Creating a Simple OS Installation Program"):
# https://download.parallels.com/desktop/v17/docs/en_US/Parallels%20Virtualization%20SDK%20Programmer's%20Guide/27991.htm