<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Marius Teufelweich</title>
    <description>The latest articles on DEV Community by Marius Teufelweich (@teufelweich).</description>
    <link>https://dev.to/teufelweich</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1051475%2F214db6a5-d29b-4326-9b70-e49a2a206458.jpeg</url>
      <title>DEV Community: Marius Teufelweich</title>
      <link>https://dev.to/teufelweich</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/teufelweich"/>
    <language>en</language>
    <item>
      <title>Sharing the WWW with a remote host that has no internet connection</title>
      <dc:creator>Marius Teufelweich</dc:creator>
      <pubDate>Thu, 07 Sep 2023 13:58:12 +0000</pubDate>
      <link>https://dev.to/teufelweich/sharing-the-www-with-a-remote-host-that-has-no-internet-connection-dp6</link>
      <guid>https://dev.to/teufelweich/sharing-the-www-with-a-remote-host-that-has-no-internet-connection-dp6</guid>
      <description>&lt;p&gt;Recently I had the following issue with my Turtlebots: They are only connected to a local network without a route to an uplink with internet connection. This is okay as I just want them to communicate with other ROS2 devices inside the local network. But sometimes I want to update or install a new package with &lt;code&gt;apt&lt;/code&gt; or &lt;code&gt;pip&lt;/code&gt;. Usually the Turtlebot/Pi would need a internet connection for this. But inside this local network only my notebook has internet access through a different network interface. I could use the notebook as a router but I don't want to get into the hassle of doing this, as network stuff with ROS2 is already complex enough.&lt;/p&gt;

&lt;p&gt;But there is another way to achieve this communication from the Turtlebot to the WWW via my notebook: the &lt;a href="https://en.wikipedia.org/wiki/SOCKS"&gt;SOCKS5&lt;/a&gt; proxy.&lt;/p&gt;

&lt;h3&gt;
  
  
  SSH SOCKS5 proxy
&lt;/h3&gt;

&lt;p&gt;When I &lt;code&gt;ssh&lt;/code&gt; onto the Turtlebot (&lt;code&gt;remotehost&lt;/code&gt;) I can use the &lt;code&gt;-R&lt;/code&gt; option to open a SOCKS5 proxy port on the &lt;code&gt;remotehost&lt;/code&gt; which forwards the communication to my notebook.&lt;/p&gt;

&lt;p&gt;With &lt;code&gt;ssh -R 1080 user@remotehost&lt;/code&gt; I open the connection on the default SOCKS5 port.&lt;/p&gt;

&lt;p&gt;We can check if the proxy works with &lt;code&gt;curl --socks5-hostname localhost http://captive.apple.com&lt;/code&gt; which should return:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;HTML&amp;gt;&amp;lt;HEAD&amp;gt;&amp;lt;TITLE&amp;gt;&lt;/span&gt;Success&lt;span class="nt"&gt;&amp;lt;/TITLE&amp;gt;&amp;lt;/HEAD&amp;gt;&amp;lt;BODY&amp;gt;&lt;/span&gt;Success&lt;span class="nt"&gt;&amp;lt;/BODY&amp;gt;&amp;lt;/HTML&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;--socks5-hostname&lt;/code&gt; is especially important here, as this forwards the DNS resolving on to the notebook, where as &lt;code&gt;--socks5&lt;/code&gt; would try to resolve it on the &lt;code&gt;remotehost&lt;/code&gt; (which can't do it because it has no internet connection).&lt;/p&gt;

&lt;h3&gt;
  
  
  APT
&lt;/h3&gt;

&lt;p&gt;Now we have to tell &lt;code&gt;apt&lt;/code&gt; to use this proxy. For this we have to add a config to &lt;code&gt;/etc/apt/apt.conf.d/&lt;/code&gt; and write &lt;code&gt;Acquire::http::proxy "socks5h://localhost:1080";&lt;/code&gt; into it.&lt;br&gt;
This one liner does it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Acquire::http::proxy "&lt;/span&gt;socks5h://localhost:1080&lt;span class="s2"&gt;";"&lt;/span&gt;  | &lt;span class="nb"&gt;sudo tee&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; /etc/apt/apt.conf.d/12proxy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(You can remove the port, as &lt;code&gt;1080&lt;/code&gt; is the default one, but I like it more explicit as it doesn't hurt inside such config files)&lt;br&gt;
As with &lt;code&gt;curl&lt;/code&gt; it is important to use &lt;code&gt;Acquire::http::proxy&lt;/code&gt; and not &lt;code&gt;Acquire::socks::proxy&lt;/code&gt; with &lt;code&gt;socks5h&lt;/code&gt; and not &lt;code&gt;socks5&lt;/code&gt; as only the combination used above forwards the DNS resolving to the notebook.&lt;/p&gt;

&lt;p&gt;Now you can happily run &lt;code&gt;sudo apt update&lt;/code&gt; and you should see something like: &lt;br&gt;
&lt;code&gt;0% [Connecting to SOCKS5h proxy (socks5h://localhost:1080)]&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  pip
&lt;/h3&gt;

&lt;p&gt;Out of the box, &lt;code&gt;pip&lt;/code&gt; can't use SOCKS sockets. We first have to install &lt;code&gt;pysocks&lt;/code&gt;. We could do this by downloading it with &lt;code&gt;curl&lt;/code&gt; or &lt;code&gt;scp&lt;/code&gt; the file from the notebook, but the more convenient way would be to install it with &lt;code&gt;apt&lt;/code&gt; (this isn't ideal, but bootstrapping never is):&lt;br&gt;
&lt;code&gt;sudo apt install python3-socks&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now we can install any python package with &lt;code&gt;pip&lt;/code&gt;:&lt;br&gt;
&lt;code&gt;pip install --proxy socks5h://localhost:1080 &amp;lt;package&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  tsocks for everything else
&lt;/h3&gt;

&lt;p&gt;If I would have other software that I want to connect via the SOCKS5 socket, but doesn't bring support for it, I would try using &lt;a href="https://linux.die.net/man/8/tsocks"&gt;&lt;code&gt;tsocks&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>pipewire on Linux Mint 21.1</title>
      <dc:creator>Marius Teufelweich</dc:creator>
      <pubDate>Wed, 19 Apr 2023 16:19:51 +0000</pubDate>
      <link>https://dev.to/teufelweich/pipewire-on-linux-mint-211-5h13</link>
      <guid>https://dev.to/teufelweich/pipewire-on-linux-mint-211-5h13</guid>
      <description>&lt;p&gt;Though &lt;code&gt;pipewire-pulse&lt;/code&gt; is finally available on Linux Mint 21.1, it's not straight forward to install and use piperwire.&lt;/p&gt;

&lt;p&gt;To me (with Cinnamon), &lt;code&gt;pipewire&lt;/code&gt; came installed and I tried all the guides (&lt;a href="https://forums.linuxmint.com/viewtopic.php?t=375771"&gt;Mint Forum&lt;/a&gt;, &lt;a href="https://github.com/mikeroyal/PipeWire-Guide#installing-pipewire-for-ubuntu"&gt;PipeWire Guide&lt;/a&gt;) I could find, but there were some catches:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;/etc/pipewire/&lt;/code&gt; isn't created during install, you need to copy it from &lt;code&gt;/usr/share/pipewire&lt;/code&gt; &lt;a href="https://forum.artixlinux.org/index.php/topic,2726.0.html"&gt;Artix Forum&lt;/a&gt;&lt;br&gt;
(maybe we don't have to copy it at all or can place it locally as the configs are suggesting)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;thanks to &lt;a href="https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2185#note_1280538"&gt;this&lt;/a&gt; I've found out, that &lt;code&gt;pipewire-media-sessions&lt;/code&gt; is outdated now and one should use &lt;code&gt;wireplumber&lt;/code&gt;.&lt;br&gt;
Installing it with &lt;code&gt;apt install wireplumber&lt;/code&gt; and enabling it with &lt;code&gt;systemctl enable --now --force --user  wireplumber&lt;/code&gt; resolved it (&lt;code&gt;--force&lt;/code&gt; was necessary because the &lt;code&gt;pipewire-media-session&lt;/code&gt; symlink was still existent &lt;code&gt;Failed to enable unit: File /local/marius/.config/systemd/user/pipewire-session-manager.service already exists and is a symlink to /usr/lib/systemd/user/pipewire-media-session.service.&lt;/code&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;you don't need to create the &lt;code&gt;/usr/share/pipewire/media-session.d/with-pulseaudio&lt;/code&gt; file&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>Workflow for recording a talk and post-processing it</title>
      <dc:creator>Marius Teufelweich</dc:creator>
      <pubDate>Fri, 24 Mar 2023 09:42:58 +0000</pubDate>
      <link>https://dev.to/teufelweich/workflow-for-recording-a-talk-and-post-processing-it-122f</link>
      <guid>https://dev.to/teufelweich/workflow-for-recording-a-talk-and-post-processing-it-122f</guid>
      <description>&lt;ol&gt;
&lt;li&gt;Capture screen and in-build notebook microphone during talk with &lt;a href="https://obsproject.com/"&gt;OBS&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Cut the video to the desired length with &lt;a href="https://kdenlive.org"&gt;Kdenlive&lt;/a&gt;. Export as &lt;code&gt;h264&lt;/code&gt; for maximum end-user compatibility&lt;/li&gt;
&lt;li&gt;Upload recording to &lt;a href="https://auphonic.com/"&gt;auphonic.com&lt;/a&gt; for automated processing (volume leveling -&amp;gt; pretty clean audio, speech recognition -&amp;gt; subtitles)&lt;/li&gt;
&lt;li&gt;Correct generated subtitles with &lt;a href="https://subtitlecomposer.kde.org/"&gt;Subtitle Composer&lt;/a&gt; (latest git development version for WebVTT (&lt;code&gt;.vtt&lt;/code&gt;) support)&lt;/li&gt;
&lt;li&gt;Export subtitles as SubRip (&lt;code&gt;.srt&lt;/code&gt;) with Suptitle Composer&lt;/li&gt;
&lt;li&gt;Translate the &lt;code&gt;.srt&lt;/code&gt; with &lt;a href="https://www.deepl.com/translator"&gt;deepl.com&lt;/a&gt; by opening the file with a text editor and copying twenty captions at a time for translation (auto translation from Subtitle Composer was not working for me). Save the translations in a new &lt;code&gt;.srt&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Embed the subtitles with &lt;a href="https://ffmpeg.org/"&gt;ffmpeg&lt;/a&gt; with the following command (taken from &lt;a href="https://www.bannerbear.com/blog/how-to-add-subtitles-to-a-video-file-using-ffmpeg/#one-liner"&gt;bannerbear.com&lt;/a&gt;)&lt;br&gt;
&lt;br&gt;
&lt;code&gt;ffmpeg -i input.mp4 -i subtitle.en.srt -i subtitle.chi.srt -map 0 -map 1 -map 2 -c copy -c:s mov_text -metadata:s:s:0 language=eng -metadata:s:s:1 language=chi output_eng_chi.mp4&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Share :)&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
  </channel>
</rss>
