Misc Linux stuff

Reverse sshfs

https://blog.dhampir.no/content/reverse-sshfs-mounts-fs-push

You need the SFTP server program on your local machine (on Debian, the openssh-server package) and sshfs on the remote machine.

Find non-Debian packages

aptitude search '~S ~i !~ODebian'

Memory usage queries

systemd

systemd-cgtop -m

Drill down with:

systemd-cgtop -m user.slice/user-1000.slice

smem

sudo smem -P beam.smp -kta

Quick rerouting of browser traffic through another host

"ssh -D 1234 host" creates a Socks proxy on localhost:1234 that sends traffic through host.

By enabling "allow extension to control proxy settings" in the multi account containers Firefox add-on, you can make containers use specific proxies.

Email forwarding via IMAP

When you have multiple email addresses, you have multiple options to use them.

Traditionally, people used redirection/forwarding to make email arriving at from@example.com go to to@example.net instead.

If mail from example.com and example.net is handled by different servers, typically you can configure the example.com mail server to resend any message arriving to the from address to to@example.net.

However, nowadays with spam filtering, the example.net mail server can reject these emails as spam, sometimes silently.

For safer redirects, you can:

A third option is to run this fetching process yourself.

IMAPFilter supports connecting to an IMAP account, waiting until messages to arrive, and moving them to another IMAP account.

Benefits:

Drawbacks:

Refer to this Python module for scripts that configure IMAPFilter as a systemd service, with credentials from Bitwarden.

Using a PCSensor pedal

Install Footswitch

sudo footswitch -1 -m ctrl -2 -S '7F' -3 -m win -k m

Maps:

Remote networking

If you can create a pipe between two hosts (using SSH, for example), you can use VDE (Virtual Distributed Ethernet) to connect the two hosts over a virtual network.

You need the following programs on both hosts:

Run as root on both hosts:

vde_switch -t tap0

This command creates a virtual switch connected to tap0.

Use the dpipe command to connect two instances of the vde_plug command running as root on both hosts.

$ dpipe sudo vde_plug = ssh root@remote vde_plug

Then bring the tap0 interface up and configure IP addresses on both hosts.

# ip link set tap0 up
# ip addr add $IP/$NETMASK dev tap0