From 718a99aef9c7a32821dabcc2ba983afc0e8606af Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 22 Feb 2026 13:20:40 +0100 Subject: Use dashes instead of underscores --- blog/content/notes/tech/misc-linux-stuff.gmi | 116 +++++++++++++++++++++++++++ blog/content/notes/tech/misc_linux_stuff.gmi | 116 --------------------------- 2 files changed, 116 insertions(+), 116 deletions(-) create mode 100644 blog/content/notes/tech/misc-linux-stuff.gmi delete mode 100644 blog/content/notes/tech/misc_linux_stuff.gmi (limited to 'blog/content/notes/tech') diff --git a/blog/content/notes/tech/misc-linux-stuff.gmi b/blog/content/notes/tech/misc-linux-stuff.gmi new file mode 100644 index 00000000..a5521f1f --- /dev/null +++ b/blog/content/notes/tech/misc-linux-stuff.gmi @@ -0,0 +1,116 @@ +# 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: + +* Use the same mail server for both accounts. However, this sometimes cannot be done or has extra cost and complexity. + +* Configure the destination email server to fetch email from the origin mail server. For example, Gmail can do this, but the fetching period can be as long as 15 minutes. This can be inconvenient when receiving confirmation emails, etc. Additionally, operators of the destination email server now have your credentials. + +A third option is to run this fetching process yourself. + +=> https://github.com/lefcha/imapfilter IMAPFilter supports connecting to an IMAP account, waiting until messages to arrive, and moving them to another IMAP account. + +Benefits: + +* IMAPFilter can use IMAP idle to request the IMAP server to notify when messages arriving, so forwarding happens without a polling delay. +* Because IMAP is used on both sides, no spam filtering happens. +* IMAPFilter is packaged for many distributions. + +Drawbacks: + +* Requires additional infrastructure. +* If IMAPFilter stops working, email stops being forwarded without warning. + +=> https://ñix.es/cgit/alex/alexpdp7.git/tree/scripts/p7s/mail/__init__.py?h=master Refer to this Python module for scripts that configure IMAPFilter as a systemd service, with credentials from Bitwarden. + +## Using a PCSensor pedal + +=> https://github.com/rgerganov/footswitch Install Footswitch + +``` +sudo footswitch -1 -m ctrl -2 -S '7F' -3 -m win -k m +``` + +Maps: + +* Left pedal to be a ctrl key +* Center pedal to the toggle mute key +* Right pedal to be Win+M (you can map this in Gnome to toggle mic status) + +## 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: + +* dpipe and vde_plug (on Debian, use the vdeplug package) +* vde-switch (on Debian, use the vde-switch package) + +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 +``` diff --git a/blog/content/notes/tech/misc_linux_stuff.gmi b/blog/content/notes/tech/misc_linux_stuff.gmi deleted file mode 100644 index a5521f1f..00000000 --- a/blog/content/notes/tech/misc_linux_stuff.gmi +++ /dev/null @@ -1,116 +0,0 @@ -# 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: - -* Use the same mail server for both accounts. However, this sometimes cannot be done or has extra cost and complexity. - -* Configure the destination email server to fetch email from the origin mail server. For example, Gmail can do this, but the fetching period can be as long as 15 minutes. This can be inconvenient when receiving confirmation emails, etc. Additionally, operators of the destination email server now have your credentials. - -A third option is to run this fetching process yourself. - -=> https://github.com/lefcha/imapfilter IMAPFilter supports connecting to an IMAP account, waiting until messages to arrive, and moving them to another IMAP account. - -Benefits: - -* IMAPFilter can use IMAP idle to request the IMAP server to notify when messages arriving, so forwarding happens without a polling delay. -* Because IMAP is used on both sides, no spam filtering happens. -* IMAPFilter is packaged for many distributions. - -Drawbacks: - -* Requires additional infrastructure. -* If IMAPFilter stops working, email stops being forwarded without warning. - -=> https://ñix.es/cgit/alex/alexpdp7.git/tree/scripts/p7s/mail/__init__.py?h=master Refer to this Python module for scripts that configure IMAPFilter as a systemd service, with credentials from Bitwarden. - -## Using a PCSensor pedal - -=> https://github.com/rgerganov/footswitch Install Footswitch - -``` -sudo footswitch -1 -m ctrl -2 -S '7F' -3 -m win -k m -``` - -Maps: - -* Left pedal to be a ctrl key -* Center pedal to the toggle mute key -* Right pedal to be Win+M (you can map this in Gnome to toggle mic status) - -## 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: - -* dpipe and vde_plug (on Debian, use the vdeplug package) -* vde-switch (on Debian, use the vde-switch package) - -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 -``` -- cgit v1.2.3