<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hack It Yourself</title><link>https://hiy.netlify.app/</link><description>Do-it-yourself recipes for computer enthusiasts</description><atom:link href="https://hiy.netlify.app/rss.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2026 &lt;a href="mailto:non@existent.com"&gt;author&lt;/a&gt; </copyright><lastBuildDate>Mon, 26 Jan 2026 02:50:52 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Integrate OBD2 data using Torque to both Home Assistant and ABRP</title><link>https://hiy.netlify.app/posts/obd2-torque-ha-abrp.html</link><dc:creator>author</dc:creator><description>&lt;p&gt;I wanted to use an ELM327 v1.5 adapter to integrate OBD2 data into both Home
Assistant and ABRP using the &lt;a href="https://torque-bhp.com"&gt;Torque app&lt;/a&gt;. Initially I
created an automation to relay the OBD2 data to ABRP via
&lt;a href="https://www.home-assistant.io/integrations/rest_command/"&gt;rest_command&lt;/a&gt;. The
approach works but creates unnecessary traffic in HA. Since I use nginx as a
reverse proxy for HA, I can just use
&lt;a href="https://nginx.org/en/docs/http/ngx_http_mirror_module.html"&gt;ngx_http_mirror_module&lt;/a&gt;
to mirror the GET request from Torque to both end points. This is a write-up to
record the two setups in case they are useful for similar tasks.&lt;/p&gt;
&lt;h3&gt;Common&lt;/h3&gt;
&lt;p&gt;Both setups require setting up the &lt;a href="https://www.home-assistant.io/integrations/torque/"&gt;HA Torque
integration&lt;/a&gt;. For the Data
Logging &amp;amp; Upload settings in the Torque app, "Webserver URL" should be the HA
torque api endpoint (must be https), "Send https: Bearer Token" should be
checked, and "Set Bearer Token" should be set to the HA Long-Lived Access Token.
"User Email address" varies depending on the setup (see below).&lt;/p&gt;
&lt;h3&gt;HTTP mirror requests&lt;/h3&gt;
&lt;p&gt;In this setup, I use the Torque option to &lt;a href="https://abrp.featurebase.app/en/help/articles/3055653-link-your-vehicle-for-live-data"&gt;integrate in-car live data to
ABRP&lt;/a&gt;.
Use the token provided by ABRP as the email address for the HA Torque
integration. The official integration works perfectly with an arbitrary string
as the email address, but the
&lt;a href="https://github.com/JOHLC/ha-torque-2.0/issues/37"&gt;JOHLC/ha-torque-2.0&lt;/a&gt; custom
integration does not, as it gives an invalid_email error.&lt;/p&gt;
&lt;p&gt;I use the &lt;a href="https://github.com/nginx-proxy/nginx-proxy"&gt;nginx-proxy Docker image&lt;/a&gt;
in a &lt;code&gt;docker-compose.yml&lt;/code&gt; file:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;nginx&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;proxy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;jwilder&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nginx&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;proxy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;alpine&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;80&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;443&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;443&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;restart&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;unless&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;stopped&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;volumes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;./&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;certs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nginx&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;certs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;ro&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;./&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nginx&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;conf&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nginx&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;conf&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;./&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nginx&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;vhost&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nginx&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;vhost&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;docker&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sock&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;docker&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sock&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;ro&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;./&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nginx&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;usr&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;share&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nginx&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;./data/nginx/conf.d/ha.conf&lt;/code&gt;:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="n"&gt;log_format&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;vhost2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'$host $remote_addr - $remote_user [$time_local] '&lt;/span&gt;
&lt;span class="w"&gt;                  &lt;/span&gt;&lt;span class="s1"&gt;'"$request" $status $body_bytes_sent '&lt;/span&gt;
&lt;span class="w"&gt;                  &lt;/span&gt;&lt;span class="s1"&gt;'"$http_referer" "$http_user_agent"'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;proxy_pass_header&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;X&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;XSRF&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;TOKEN&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;upstream&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;hass&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;org&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;111.222&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mf"&gt;333.444&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;8123&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;server_name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;hass&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;org&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;listen&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;access_log&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nb"&gt;log&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nginx&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;access&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;vhost2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="c1"&gt;# Do not HTTPS redirect Let'sEncrypt ACME challenge&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;location&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;^~&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/.&lt;/span&gt;&lt;span class="n"&gt;well&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;known&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;acme&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;challenge&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;auth_basic&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;off&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;auth_request&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;off&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;allow&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;all&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;usr&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;share&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nginx&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;try_files&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;uri&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;404&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;location&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;301&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//$&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;request_uri&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;server_name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;hass&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;org&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;listen&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;443&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ssl&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;http2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;access_log&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nb"&gt;log&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nginx&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;access&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;vhost2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;ssl_session_timeout&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;ssl_session_cache&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shared&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;SSL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;ssl_session_tickets&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;off&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;ssl_certificate&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nginx&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;certs&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;org&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;crt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;ssl_certificate_key&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nginx&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;certs&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;org&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;add_header&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Strict&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Transport&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Security&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"max-age=31536000"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;always&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;location&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;proxy_pass&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;hass&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;org&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;location&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;torque&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;mirror&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;api_torque_mirror&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;proxy_pass&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;hass&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;org&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;location&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;api_torque_mirror&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;internal&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;resolver&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;1.1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mf"&gt;1.1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ipv6&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;off&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;proxy_ssl_server_name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;on&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;proxy_ssl_name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;iternio&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;proxy_set_header&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Host&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;iternio&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;proxy_pass&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;iternio&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;tlm&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;torque&lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;is_args&lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;proxy_pass_request_body&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;on&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;proxy_set_header&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Authorization&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I use &lt;a href="https://github.com/acmesh-official/acme.sh"&gt;acme.sh&lt;/a&gt; to automate SSL/TLS
certificates and &lt;a href="https://www.tailscale.com"&gt;Tailscale&lt;/a&gt; to proxy from a VPS with
a public IP address to my Raspberry Pi (on T-Mobile 5G Home Internet;
&lt;code&gt;111.222.333.444&lt;/code&gt; above is the Tailscale IP for the Pi). To test this setup:
  * Verify that HA can receive the OBD2 data. Note that the Torque entities are
    dynamic and will disappear when HA is rebooted, but they will be recreated
    once new data come in.
  * Change "Webserver URL" to &lt;code&gt;https://api.iternio.com/1/tlm/torque&lt;/code&gt; in the
    Torque app, verify that ABRP (and only ABRP) can receive the data.
  * Change "Webserver URL" back to HA torque endpoint in the Torque app and
    change all occurrences of &lt;code&gt;api.iternio.com&lt;/code&gt; in &lt;code&gt;./data/nginx/conf.d/ha.conf&lt;/code&gt;
    to a capturing URL, e.g., from requestlens.com. Verify that the HTTP GET
    requests from Torque are correctly mirrored.&lt;/p&gt;
&lt;h3&gt;Home Assistant REST Relay&lt;/h3&gt;
&lt;p&gt;In this setup, you do not need to use the ABRP Torque token as the email address
in the Torque app or the HA Torque integration. You also do not need the nginx
mirror setup. Instead, just first make sure that the Torque data can be received
by HA. Then create an automation to relay this data to ABRP using its Generic
option for integrating in-car live data. We need to set up the
&lt;a href="https://www.home-assistant.io/integrations/rest_command/"&gt;rest_command&lt;/a&gt; in
&lt;code&gt;configuration.yaml&lt;/code&gt;:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="n"&gt;rest_command&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;update_abrp&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;POST&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;content_type&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"application/x-www-form-urlencoded"&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;gt;-&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="n"&gt;https&lt;/span&gt;&lt;span class="o"&gt;://&lt;/span&gt;&lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;iternio&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;com&lt;/span&gt;&lt;span class="sr"&gt;/1/tlm/s&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="n"&gt;b2162f&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;9599&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;4647&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;8139&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;66&lt;/span&gt;&lt;span class="n"&gt;e9f9528370&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="o"&gt;=[&lt;/span&gt;&lt;span class="n"&gt;ABRP&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Generic&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;TOKEN&lt;/span&gt;&lt;span class="o"&gt;]&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;tlm&lt;/span&gt;&lt;span class="o"&gt;={{&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="s2"&gt;"utc"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;as_timestamp&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="o"&gt;())&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;int&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="s2"&gt;"soc"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;states&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'sensor.vehicle_battery_pack_state_of_charge_displayed'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;float&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="s2"&gt;"power"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;states&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'sensor.vehicle_inst_kpower'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;float&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="s2"&gt;"speed"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;states&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'sensor.vehicle_speed_kmh'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;float&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="s2"&gt;"lat"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;states&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'sensor.vehicle_gps_latitude'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;float&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="s2"&gt;"lon"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;states&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'sensor.vehicle_gps_longitude'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;float&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="s2"&gt;"is_charging"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;states&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'sensor.vehicle_speed_kmh'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;float&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;and&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;states&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'sensor.vehicle_inst_kpower'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;float&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="s2"&gt;"is_dcfc"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;states&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'sensor.vehicle_speed_kmh'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;float&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;and&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;states&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'sensor.vehicle_inst_kpower'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;float&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;and&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;states&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'sensor.vehicle_charger_dc_port_current'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;float&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="s2"&gt;"capacity"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;states&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'sensor.vehicle_battery_pack_capacity_kwh_estimated_2017_2018'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;float&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;66.0&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="s2"&gt;"elevation"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;states&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'sensor.vehicle_gps_altitude'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;float&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.3048&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="s2"&gt;"ext_temp"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;states&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'sensor.vehicle_air_temp_ambient'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;float&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="s2"&gt;"batt_temp"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;states&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'sensor.vehicle_battery_pack_temp_avg_temp'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;float&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="s2"&gt;"voltage"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;states&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'sensor.vehicle_hv_mg_voltage'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;float&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="s2"&gt;"current"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;states&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'sensor.vehicle_hv_current_hd'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;float&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="s2"&gt;"car_model"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"chevy:bolt:17:66:other"&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;to_json&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;urlencode&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="o"&gt;}}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And create an automation in HA:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="n"&gt;alias&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Forward&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Torque&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Data&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ABRP&lt;/span&gt;
&lt;span class="n"&gt;description&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;
&lt;span class="n"&gt;triggers&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;seconds&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;trigger&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;time_pattern&lt;/span&gt;
&lt;span class="n"&gt;conditions&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;condition&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;template&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;value_template&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"{{ states('sensor.vehicle_inst_kpower') | float(0) != 0 }}"&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;condition&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;template&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;value_template&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;gt;-&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="o"&gt;{{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="n"&gt;states&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;sensor&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;vehicle_inst_kpower&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;last_updated&lt;/span&gt;&lt;span class="o"&gt;).&lt;/span&gt;&lt;span class="n"&gt;total_seconds&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;}}&lt;/span&gt;
&lt;span class="n"&gt;actions&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;rest_command&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;update_abrp&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Note that we are using a different ABRP endpoint,
&lt;code&gt;https://api.iternio.com/1/tlm/send&lt;/code&gt;, a public &lt;code&gt;api_key&lt;/code&gt;, and the unique ABRP
user token. For some reason, I can only get it to work by putting all the OBD2
data in the query arguments.&lt;/p&gt;</description><category>auto</category><category>home-automation</category><category>smart-home</category><guid>https://hiy.netlify.app/posts/obd2-torque-ha-abrp.html</guid><pubDate>Sun, 04 Jan 2026 21:45:50 GMT</pubDate></item><item><title>Mysterious suspend when no user is logged in, Ubuntu 24.04</title><link>https://hiy.netlify.app/posts/troubleshooting-ubuntu-mysterious-suspend.html</link><dc:creator>author</dc:creator><description>&lt;p&gt;My Ubuntu 24.04 LTS server strangely suspends itself after 20 min. However, if I
log in via Anydesk, then it stays on even if I minimize the Anydesk window and
do not touch it for hours (it would enter into screensaver mode). If I log out
my user and close Anydesk, it would auto suspend again. I've checked the
following:&lt;/p&gt;
&lt;p&gt;1) Disabled sleep / suspend / hibernation related settings in the Power settings
in LxQT.&lt;/p&gt;
&lt;p&gt;2) Checked from terminal: &lt;code&gt;gsettings list-recursively
org.gnome.settings-daemon.plugins.power&lt;/code&gt; &lt;a href="https://pastebin.com/rAtWvAet"&gt;output&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;3) Explicitly set relevant settings to &lt;code&gt;ignore&lt;/code&gt; in &lt;code&gt;/etc/systemd/logind.conf&lt;/code&gt;
&lt;a href="https://pastebin.com/e1EDTvc5"&gt;logind.conf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;4) Nothing out of the ordinary in &lt;code&gt;systemctl list-timers&lt;/code&gt;
&lt;a href="https://pastebin.com/STjf7dtT"&gt;output&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;5) Nothing unusual when I followed the systemctl log &lt;code&gt;journalctl -f&lt;/code&gt;. You can
see the message `The system will suspend now! &lt;a href="https://pastebin.com/vy7twv8H"&gt;log
file&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt; With the help of ChatGPT and Gemini, the problem is solved!&lt;/p&gt;
&lt;p&gt;1) &lt;code&gt;sudo systemctl mask sleep.target suspend.target hibernate.target
   hybrid-sleep.target&lt;/code&gt; blocks the suspend operation, even though the underlying
   cause is not identified.&lt;/p&gt;
&lt;p&gt;2) Open an override file for the &lt;code&gt;systemd-logind&lt;/code&gt; service: &lt;code&gt;sudo systemctl edit
   systemd-logind.service&lt;/code&gt; and add the following to enable debug logging&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="k"&gt;[Service]&lt;/span&gt;
&lt;span class="na"&gt;Environment&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;SYSTEMD_LOG_LEVEL=debug&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;followed by &lt;code&gt;sudo systemctl restart systemd-logind.service&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Alternatively, use &lt;code&gt;busctl monitor org.freedesktop.login1&lt;/code&gt; to monitor requests
for Suspend.&lt;/p&gt;
&lt;p&gt;3) (2) will produce a line before "The system will suspend now!" in the log
   file. &lt;code&gt;journalctl -b -1 | grep 'system will suspend now' -A 10 -B 10&lt;/code&gt; gives&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="nx"&gt;Aug&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;04&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;17&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;44&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;MACHINE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;systemd&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;logind&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1004&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Got&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;method_call&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;sender&lt;/span&gt;&lt;span class="p"&gt;=:&lt;/span&gt;&lt;span class="m m-Double"&gt;1.67&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;destination&lt;/span&gt;&lt;span class="p"&gt;=:&lt;/span&gt;&lt;span class="m m-Double"&gt;1.1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;org&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;freedesktop&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;login1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;interface&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;org&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;freedesktop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;login1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Manager&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;member&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;Suspend&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nx"&gt;cookie&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;99&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;reply_cookie&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;signature&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;4) &lt;code&gt;busctl --system list | grep ':1.67'&lt;/code&gt; or &lt;code&gt;busctl --user list | grep ':1.67'&lt;/code&gt;
   reveals that it's &lt;code&gt;/usr/lib/unity-settings-daemon/unity-settings-daemon&lt;/code&gt; that
   have been calling &lt;code&gt;org.freedesktop.login1.Manager.Suspend()&lt;/code&gt;. Uninstalling
   &lt;code&gt;unity-settings-daemon&lt;/code&gt; eliminated the problem!&lt;/p&gt;
&lt;p&gt;5) (1) is important because otherwise I will have to do (4) after a reboot. By
   that time, the D-Bus sender addresses (e.g., &lt;code&gt;:1.67&lt;/code&gt;) will point to a
   different process.&lt;/p&gt;</description><category>home-lab</category><category>linux</category><category>ubuntu</category><guid>https://hiy.netlify.app/posts/troubleshooting-ubuntu-mysterious-suspend.html</guid><pubDate>Fri, 08 Aug 2025 03:19:28 GMT</pubDate></item><item><title>Vinegar cleaning solved double clicking problems on several mice!</title><link>https://hiy.netlify.app/posts/fix-double-clicking-mice-switches.html</link><dc:creator>author</dc:creator><description>&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Many mice I have have developed the double clicking issue,
including many models from Logitech, and others from Dell, Lenovo, and a few
no-name brands. They were mostly with the left button: one click would register
as two or holding the left button would release (registering a click) and
immediately hold again. One Lenovo mouse had an issue with the right button not
registering a click when you can hear a clear clicking sound.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Other problems solved by this trick&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;A Conair hair dryer becomes very weak unless pressure is kept on the button.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A 1st gen Google Home Mini that started to repeatedly say "the mic is on" and
"the mic is off" at times, as if the microphone switch is flipped on and off
rapidly.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Solutions that don't work&lt;/strong&gt;: Overtime I have tried a great number of solutions
from web articles and forum posts. I suspect they must have worked for some
scenarios, and anything involving physically manipulating the mice (e.g., [1]
&amp;amp; [2] below) may alleviate the symptoms initially, but none of these solutions
addressed my problems for more than a few days.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Cleaning debris: &lt;a href="https://www.reddit.com/r/MouseReview/comments/n12gun/solution_i_have_found_a_fix_to_the_mouse_double/"&gt;squeezing the
   buttons&lt;/a&gt;
   (perhaps while holding it upside down), shaking, and using compressed air to
   clean.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.instructables.com/Repair-mouse-with-double-click-problem/"&gt;Disassemble and bend the copper
   spring&lt;/a&gt;
   (image below taken from &lt;a href="https://www.tomshardware.com/reviews/hack-mouse-click-do-it-yourself,4458-2.html"&gt;Tom's
   Hardware&lt;/a&gt;).
   The idea is that the switch fails because of mechanical fatigue. However,
   many of my Logitech mice developed the double clicking issue in less than a
   year (and this solution didn't work for more than a few days; also see
   below).
&lt;img alt="switch internals" src="https://hiy.netlify.app/images/fix-double-clicking-mice-switches/switch-internal.webp"&gt;&lt;/li&gt;
&lt;li&gt;Software solutions, e.g., using AutoHotKey to ignore rapid consecutive
   clicks, are very hard to tune the sensitivity threshold.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Solutions that did work&lt;/strong&gt;: I don't fully understand why, but [2] worked for
my mice from all the different brands. The Logitech ones that failed in less
than a year have worked fine for two or three years now (Corrosion developed
quickly, but somehow the materials stabilized so a cleaning makes it last longer
than new?)&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Soldering on a new switch. Did this once and it worked perfectly.&lt;/li&gt;
&lt;li&gt;Disassemble and carefully remove the switch housing to expose the copper
   innards (see the picture above). I found using a dulled X-Acto knife very
   effective in prying open the clips on the side of the switch base that hold
   the black plastic housing. Try not to dislodge the copper spring. They can be
   tricky to put back (which involves bending &amp;amp; twisting..) Use a Q-tip to clean
   the four copper contact surfaces (two on the spring, and the top and bottom
   surfaces on the base) with vinegar. Dry and reassemble everything.&lt;ul&gt;
&lt;li&gt;Some models like Microsoft Wireless Mouse 1000 use Panasonic EVQ-P0E07K /
  EVQ-P0D07K style micro switches. The switches can be pried open but have
  to be super-glued back.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;</description><category>hardware</category><guid>https://hiy.netlify.app/posts/fix-double-clicking-mice-switches.html</guid><pubDate>Sun, 06 Jul 2025 16:04:47 GMT</pubDate></item><item><title>Dash cam hard wire install, no car tampering, automatically turn on/off with power button</title><link>https://hiy.netlify.app/posts/bolt-dash-cam-hardwiring.html</link><dc:creator>author</dc:creator><description>&lt;p&gt;I was installing a VIOFO A119 V3 Dash Cam on 2017 LT, but any Bolt with auto
dimming mirror should work. The mirror has a switched power so the dash cam will
turn on/off with the car.&lt;/p&gt;
&lt;p&gt;The basic idea is probably similar to &lt;a href="https://www.chevybolt.org/threads/dash-cam-install.9658/post-107874"&gt;this
post&lt;/a&gt;, but
the pictures there are no longer available and it seemed to require splicing the
wire. I found that you can just push a solid copper wire into the back of the
connector without having to tamper with any existing wiring.&lt;/p&gt;
&lt;p&gt;More details:&lt;/p&gt;
&lt;p&gt;1) Take out the cover for the rear view mirror. Thanks to this
&lt;a href="https://www.gm-volt.com/threads/dyi-auto-dimming-mirror-w-homelink-compass-installation.226593/"&gt;post&lt;/a&gt;
and this &lt;a href="https://youtu.be/Dl2ckPRBRdk?si=txyXyBqOoKOnhR7o"&gt;YouTube video&lt;/a&gt;, the
process was fairly straightforward. You don't need to take off the center piece.&lt;/p&gt;
&lt;p&gt;2) Use a 12V-&amp;gt;5V DC to DC converter (such as &lt;a href="https://www.aliexpress.us/item/2251832787141026.html"&gt;this
one&lt;/a&gt;). Mine has stranded
wires so I soldered a solid copper end to it. Stick the solid copper ends to the
brown/black slot (positive) and green/white slot (negative). Wrap the exposed
wires with heat shrink or electrical tape so that they don't short out.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://hiy.netlify.app/images/bolt-dash-cam-hardwiring/IMG_20231119_174241.jpg"&gt;&lt;img alt="Image" src="https://hiy.netlify.app/images/bolt-dash-cam-hardwiring/IMG_20231119_174241.thumbnail.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;3) And zip tie it for strain relief.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://hiy.netlify.app/images/bolt-dash-cam-hardwiring/IMG_20231119_180102.jpg"&gt;&lt;img alt="Image" src="https://hiy.netlify.app/images/bolt-dash-cam-hardwiring/IMG_20231119_180102.thumbnail.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;4) Route the wires to the top of the cover so that the cover won't pinch them.
You can further hide the DC converter, but for me the end result looks like&lt;/p&gt;
&lt;p&gt;&lt;a href="https://hiy.netlify.app/images/bolt-dash-cam-hardwiring/IMG_20231119_181242.jpg"&gt;&lt;img alt="this" src="https://hiy.netlify.app/images/bolt-dash-cam-hardwiring/IMG_20231119_181242.thumbnail.jpg"&gt;&lt;/a&gt;&lt;/p&gt;</description><category>auto</category><guid>https://hiy.netlify.app/posts/bolt-dash-cam-hardwiring.html</guid><pubDate>Mon, 20 Nov 2023 01:54:21 GMT</pubDate></item><item><title>Curious observations about efficient frontier calculations</title><link>https://hiy.netlify.app/posts/ef-calculation-questions.html</link><dc:creator>author</dc:creator><description>&lt;p&gt;I was using Portfolio Visualizer to try out a few efficient frontier
calculations. &lt;strong&gt;You can run the same calculation using this
&lt;a href="https://www.portfoliovisualizer.com/efficient-frontier?s=y&amp;amp;type=2&amp;amp;mode=1&amp;amp;startYear=1972&amp;amp;endYear=2022&amp;amp;robustOptimization=true&amp;amp;groupConstraints=false&amp;amp;excessReturns=false&amp;amp;benchmark=-1&amp;amp;geometric=false&amp;amp;minimumVarianceFrontier=false&amp;amp;asset1=LargeCapBlend&amp;amp;allocation1_1=10&amp;amp;ff1=true&amp;amp;sf1=true&amp;amp;asset2=IntlDeveloped&amp;amp;allocation2_1=10&amp;amp;ff2=true&amp;amp;sf2=true&amp;amp;asset3=EmergingMarket&amp;amp;allocation3_1=10&amp;amp;ff3=true&amp;amp;sf3=true&amp;amp;asset4=MidCapValue&amp;amp;allocation4_1=10&amp;amp;ff4=true&amp;amp;sf4=true&amp;amp;asset5=SmallCapValue&amp;amp;allocation5_1=10&amp;amp;ff5=true&amp;amp;sf5=true&amp;amp;asset6=IntlValue&amp;amp;allocation6_1=10&amp;amp;ff6=true&amp;amp;sf6=true&amp;amp;asset7=REIT&amp;amp;allocation7_1=10&amp;amp;ff7=true&amp;amp;sf7=true&amp;amp;asset8=MidCapBlend&amp;amp;allocation8_1=10&amp;amp;ff8=true&amp;amp;sf8=true&amp;amp;asset9=SmallCapBlend&amp;amp;allocation9_1=10&amp;amp;ff9=true&amp;amp;sf9=true&amp;amp;asset10=LongTreasury&amp;amp;allocation10_1=10&amp;amp;sf10=true"&gt;link&lt;/a&gt;.&lt;/strong&gt;
I find it quite curious: 1) What causes Portfolio 2 to stop at σ ~ 15%? In some
other portfolios I tried, the efficient frontier curves can sometimes be really
short. 2) How/Why would Portfolio 2, which is a superset of Portfolio 1, cross 1
from below?&lt;/p&gt;
&lt;p&gt;To illustrate this, I've attached four example runs below. Red is EF #2, while
blue is EF #1. EF #2 = EF #1 + one extra asset class. The region I was talking
about is where the two curves intersect. Most prominent are Run01 and Run02,
where the computed curves already intersect, while for the other two runs if the
EF #2 calculations were to extend to higher risk values, they would also be
below EF #2. My point was that &lt;strong&gt;by simply setting that extra asset class to 0%,
EF #2 would do at least equally well as EF #1 -- what am I missing here?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The app developer kindly replied on the brief inner workings of resampled
efficient frontier calculations, which is what one should expect for Monte Carlo
simulations. Since I didn't ask the permission, I'll just point to the
&lt;a href="https://www.portfoliovisualizer.com/faq"&gt;FAQ&lt;/a&gt; where some of the same references
are listed. &lt;strong&gt;My best understanding is this&lt;/strong&gt;: The algorithm first generates say
1000 simulated return series that include assets/asset classes from both
portfolios. Each return series is different, but sampled from the same joint
normal distribution with the same mean and covariance matrix as found for the
historical data. Now for each of the two portfolio, the algorithm computes the
efficient frontier for each return series and then averages, at each risk value,
the 1000 (risk, return) data to get the combined efficient frontier.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Run1" src="https://hiy.netlify.app/images/ef-calculation-questions/Run1.png"&gt;
&lt;img alt="Run2" src="https://hiy.netlify.app/images/ef-calculation-questions/Run2.png"&gt;
&lt;img alt="Run3" src="https://hiy.netlify.app/images/ef-calculation-questions/Run3.png"&gt;
&lt;img alt="Run4" src="https://hiy.netlify.app/images/ef-calculation-questions/Run4.png"&gt;&lt;/p&gt;</description><category>finance</category><category>investing</category><guid>https://hiy.netlify.app/posts/ef-calculation-questions.html</guid><pubDate>Wed, 18 Jan 2023 15:13:41 GMT</pubDate></item><item><title>DIY insect killers: Additives to mix with Bifen IT</title><link>https://hiy.netlify.app/posts/bifen-additives.html</link><dc:creator>author</dc:creator><description>&lt;p&gt;Following the suggestion &lt;a href="https://diy.stackexchange.com/a/224737"&gt;here&lt;/a&gt;,
I did a little research and found two options for bug spray: an &lt;a href="https://www.ortho.com/en-us/products/bugs/ortho-home-defense-insect-killer-indoor-perimeter2-refill"&gt;off the shelf
product&lt;/a&gt;
or &lt;a href="https://store.doyourownpestcontrol.com/bifen-it"&gt;DIY&lt;/a&gt;. In terms of per ounce
active ingredients, the off the shelf solution is about ~10 times more
expensive. I'm wondering if I go the DIY route, are there any additives I should
add to increase the retention/longevity of the active ingredients in the
perimeter barrier, like surfactants and ammonium sulfate for glyphosate?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Answer&lt;/strong&gt; With credits to
&lt;a href="https://www.reddit.com/r/pestcontrol/comments/nk2q6p/are_there_recommended_additives_for_mixing_bifen/"&gt;reddit&lt;/a&gt;,
there are a few adjuvants to mix with Bifen:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Insect_growth_regulator"&gt;Insect growth
  regulators&lt;/a&gt;:
  Pyriproxyfen (Nyguard), Methoprene (Precor).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Pesticide synergist: &lt;a href="https://en.wikipedia.org/wiki/Piperonyl_butoxide"&gt;piperonyl
  butoxide&lt;/a&gt; (Exponent).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.solutionsstores.com/wettable-powders"&gt;Wettable powders&lt;/a&gt;
  formulations are often longer lasting.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description><category>home-diy</category><guid>https://hiy.netlify.app/posts/bifen-additives.html</guid><pubDate>Sat, 29 May 2021 22:11:22 GMT</pubDate></item><item><title>Mansfield 4000 series outdoor frost-free faucet leaking from inside the stem tube</title><link>https://hiy.netlify.app/posts/mansfield-4000-frost-free-faucet-stem-leaking.html</link><dc:creator>author</dc:creator><description>&lt;p&gt;I have a 12-in Mansfield 4000 series outdoor frost-free faucet (according to
&lt;a href="https://www.prier.com/wp-content/uploads/2020/01/mansfield-stem.pdf"&gt;this&lt;/a&gt;).
It's leaking from inside the stem tube (labeled "1") only when water is turned
on. Removing the stem from the faucet, I cannot see light from the stem tube
end. However, when I carefully dripped water into the stem tube, a little of
that water came out from the holes labeled "2". This makes me suspect that there
might be a hole (I assume I have to replace the entire stem in this case) or a
deteriorated washer inside the stem. Is Prier a new owner of the Mansfield
brand? According to &lt;a href="https://www.prier.com/products/400-series/"&gt;them&lt;/a&gt;, the stem
should never leak this way.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://hiy.netlify.app/images/mansfield-4000-frost-free-faucet-stem-leaking/faucet-stem-close-up.jpg"&gt;&lt;img alt="faucet stem close-up" src="https://hiy.netlify.app/images/mansfield-4000-frost-free-faucet-stem-leaking/faucet-stem-close-up.thumbnail.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://hiy.netlify.app/images/mansfield-4000-frost-free-faucet-stem-leaking/faucet-stem.jpg"&gt;&lt;img alt="faucet stem" src="https://hiy.netlify.app/images/mansfield-4000-frost-free-faucet-stem-leaking/faucet-stem.thumbnail.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Answer&lt;/strong&gt; It turns out that an o-ring (400/500 Stem End O-Ring in the diagram
below) is completely absent. Since there is no leak when water is turned off,
the washers should have been fine. When water is turned on, the stem end will be
pushed against the thick copper part, thus closing the holes. With the o-ring
missing, water drips through the seam, into the holes, and out from the handle
thread.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://hiy.netlify.app/images/mansfield-4000-frost-free-faucet-stem-leaking/mansfield-400-series-assembly-diagram.jpg"&gt;&lt;img alt="Mansfield 400 Series Assembly Diagram" src="https://hiy.netlify.app/images/mansfield-4000-frost-free-faucet-stem-leaking/mansfield-400-series-assembly-diagram.thumbnail.jpg"&gt;&lt;/a&gt;&lt;/p&gt;</description><category>home-diy</category><guid>https://hiy.netlify.app/posts/mansfield-4000-frost-free-faucet-stem-leaking.html</guid><pubDate>Thu, 18 Jun 2020 00:35:56 GMT</pubDate></item><item><title>OpenVPN how to route Internet traffic through a client</title><link>https://hiy.netlify.app/posts/openvpn-route-traffic-through-client.html</link><dc:creator>author</dc:creator><description>&lt;p&gt;My use case: I want to route all Internet traffic from &lt;code&gt;machine B&lt;/code&gt; through
&lt;code&gt;machine A&lt;/code&gt;. However, I cannot simply install OpenVPN server on &lt;code&gt;machine A&lt;/code&gt; as
&lt;code&gt;machine A&lt;/code&gt; is behind layers of NATs/firewalls I don't control. My current
solution is to &lt;strong&gt;install OpenVPN server on &lt;code&gt;machine C&lt;/code&gt;&lt;/strong&gt;, and have &lt;strong&gt;both
&lt;code&gt;machines A&lt;/code&gt; and &lt;code&gt;B&lt;/code&gt; connect to &lt;code&gt;C&lt;/code&gt; as clients&lt;/strong&gt;. I'm trying to &lt;strong&gt;set up proper
routes so that all traffic from &lt;code&gt;B&lt;/code&gt; can be routed through &lt;code&gt;A&lt;/code&gt;&lt;/strong&gt;. The setup on
each machine and the steps I have attempted are detailed below and my remaining
problem is in the second to last paragraph.&lt;/p&gt;
&lt;p&gt;Now, &lt;code&gt;machine C&lt;/code&gt; runs Linux and OpenVPN server in a Docker container
(https://github.com/kylemanna/docker-openvpn). With &lt;code&gt;redirect-gateway def1&lt;/code&gt;,
both client machines can connect and route traffic through the server
(https://ipleak.net confirms the server IP). For the following tests though,
&lt;code&gt;redirect-gateway def1&lt;/code&gt; is removed, while &lt;code&gt;topology subnet&lt;/code&gt; and
&lt;code&gt;client-to-client&lt;/code&gt; are added. The server has subnet IP &lt;code&gt;192.168.255.1&lt;/code&gt; and
public IP &lt;code&gt;AAA.BBB.CCC.DDD&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;machine A&lt;/code&gt; runs Windows and has &lt;code&gt;IPEnabledRouter=1&lt;/code&gt; set in
&lt;code&gt;HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\&lt;/code&gt;, Service &lt;code&gt;Routing and
Remote Access&lt;/code&gt; set to &lt;code&gt;Automatic&lt;/code&gt; and running, and the network adapter with
Internet access set to allow sharing from the OpenVPN TAP adapter. It is
assigned &lt;code&gt;192.168.255.2&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;machine B&lt;/code&gt; runs Windows and is behind a router with IP &lt;code&gt;192.168.1.100&lt;/code&gt;. It is
assigned OpenVPN subnet IP &lt;code&gt;192.168.255.3&lt;/code&gt;. The following routes are added in
addition to what OpenVPN sets up automatically:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0        128.0.0.0    192.168.255.2    192.168.255.3    259
        128.0.0.0        128.0.0.0    192.168.255.2    192.168.255.3    259
  AAA.BBB.CCC.DDD  255.255.255.255      192.168.1.1    192.168.1.100    291
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;From &lt;code&gt;machine B&lt;/code&gt;, I can ping &lt;code&gt;machine A&lt;/code&gt; at &lt;code&gt;192.168.255.2&lt;/code&gt;, but &lt;strong&gt;Internet
traffic is still routed through the OpenVPN server&lt;/strong&gt; (ipleak shows
&lt;code&gt;AAA.BBB.CCC.DDD&lt;/code&gt;). I tried adding a route: &lt;code&gt;route add default gw 192.168.255.2
tun0&lt;/code&gt;, but this makes the clients unable to access Internet. The server route
table typically looks like:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         172.19.0.1      0.0.0.0         UG    0      0        0 eth0
172.19.0.0      0.0.0.0         255.255.0.0     U     0      0        0 eth0
192.168.254.0   192.168.255.2   255.255.255.0   UG    0      0        0 tun0
192.168.255.0   0.0.0.0         255.255.255.0   U     0      0        0 tun0
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;How can I make this work?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;[EDIT]&lt;/strong&gt; A little more context on the use case: I need to set up VPN for a
division so that their users' home computers &lt;code&gt;machine B&lt;/code&gt; can access third-party
resources that restrict access based on IP address. The access to &lt;code&gt;machine A&lt;/code&gt; is
not blocked, but there are at least two layers of NAT/firewalls up the
organization, whose admins do not want to change their setup to help with
incoming connections. We therefore want to devise a working solution using
`machine C** that may be a VPS as the VPN server. There is an official VPN
service but since it is open to certain outside members, the third-party vendor
does not wish to allow its IP access.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Network Diagram" src="https://hiy.netlify.app/images/openvpn-route-traffic-through-client/network-diagram.png"&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt; In principle, the setup should be similar to
&lt;a href="https://community.openvpn.net/openvpn/wiki/RoutedLans"&gt;RoutedLans&lt;/a&gt;, except that
we cannot simply set &lt;code&gt;machine A&lt;/code&gt; to handle &lt;code&gt;0.0.0.0&lt;/code&gt;. This SF
&lt;a href="https://serverfault.com/a/624988"&gt;answer&lt;/a&gt; explains why packets cannot be
sent through another client as the gateway using the TUN interface. However,
there is a workaround according to the first comment to this
&lt;a href="https://serverfault.com/a/875765"&gt;answer&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;On &lt;code&gt;machine C&lt;/code&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Add the following to the server configuration:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;topology subnet
client-to-client

route 1.0.0.0 255.0.0.0
route 2.0.0.0 254.0.0.0
route 4.0.0.0 252.0.0.0
route 8.0.0.0 248.0.0.0
route 16.0.0.0 240.0.0.0
route 32.0.0.0 224.0.0.0
route 64.0.0.0 192.0.0.0
route 128.0.0.0 128.0.0.0

push "route 1.0.0.0 255.0.0.0"
push "route 2.0.0.0 254.0.0.0"
push "route 4.0.0.0 252.0.0.0"
push "route 8.0.0.0 248.0.0.0"
push "route 16.0.0.0 240.0.0.0"
push "route 32.0.0.0 224.0.0.0"
push "route 64.0.0.0 192.0.0.0"
push "route 128.0.0.0 128.0.0.0"
&lt;/pre&gt;&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;Set iroutes and a static IP for &lt;code&gt;machine A&lt;/code&gt; in &lt;code&gt;client-config-dir&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;ifconfig-push 192.168.255.2 255.255.255.0
push "route 192.168.255.0 255.255.255.0 192.168.255.1"

iroute 1.0.0.0 255.0.0.0
iroute 2.0.0.0 254.0.0.0
iroute 4.0.0.0 252.0.0.0
iroute 8.0.0.0 248.0.0.0
iroute 16.0.0.0 240.0.0.0
iroute 32.0.0.0 224.0.0.0
iroute 64.0.0.0 192.0.0.0
iroute 128.0.0.0 128.0.0.0
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;On &lt;code&gt;machine A&lt;/code&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;In &lt;code&gt;HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\&lt;/code&gt;, set
   &lt;code&gt;IPEnableRouter=1&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Set service &lt;code&gt;Routing and Remote Access&lt;/code&gt; to &lt;code&gt;Automatic&lt;/code&gt; and make sure it is
   running.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Set the network adapter with Internet access to allow sharing from the
   OpenVPN TAP adapter. It appears that sharing has to be disabled and
   re-enabled every time the machine is rebooted.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;On &lt;code&gt;machine B&lt;/code&gt;: make sure &lt;code&gt;redirect-gateway def1&lt;/code&gt; is in the client
configuration.&lt;/p&gt;</description><category>home-lab</category><category>linux</category><category>networking</category><category>windows</category><guid>https://hiy.netlify.app/posts/openvpn-route-traffic-through-client.html</guid><pubDate>Sat, 17 Aug 2019 03:35:55 GMT</pubDate></item><item><title>How to rsync all folders present on the destination folder</title><link>https://hiy.netlify.app/posts/rsync-folders-present-on-destination.html</link><dc:creator>author</dc:creator><description>&lt;p&gt;I have two folders &lt;code&gt;FolderA&lt;/code&gt; and &lt;code&gt;FolderB&lt;/code&gt; as below. I want to &lt;code&gt;rsync&lt;/code&gt; the
common subfolders. For example, I can do &lt;code&gt;rsync -avzP /path/to/FolderB/*
/path/to/FolderA/&lt;/code&gt;, which will keep &lt;code&gt;SubFolder1&lt;/code&gt; and &lt;code&gt;SubFolder3&lt;/code&gt; mirrored. My
question is how I can achieve the same if &lt;code&gt;FolderB&lt;/code&gt; is the destination without
explicitly &lt;code&gt;--include&lt;/code&gt; or &lt;code&gt;--exclude&lt;/code&gt; individual subfolders (e.g., in case there
are too many of them).&lt;/p&gt;
&lt;p&gt;```
FolderA
|--SubFolder1
|--SubFolder2
|--SubFolder3
|--SubFolder4&lt;/p&gt;
&lt;p&gt;FolderB
|--SubFolder1
|--SubFolder3
``**&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Answer by &lt;a href="https://stackoverflow.com/a/57266415"&gt;David C. Rankin&lt;/a&gt;&lt;/strong&gt; If you
have a large number of folders under &lt;code&gt;FolderA&lt;/code&gt; that you do not want to sync
under &lt;code&gt;FolderB&lt;/code&gt;, then your other option is to create a text file holding the
&lt;em&gt;absolute path&lt;/em&gt; to only those &lt;code&gt;SubFolderX&lt;/code&gt; under &lt;code&gt;FolderA&lt;/code&gt; you want to &lt;code&gt;rsync&lt;/code&gt;
to &lt;code&gt;FolderB&lt;/code&gt; and then use the &lt;code&gt;--no-R&lt;/code&gt; and &lt;code&gt;--files-from=folderlist&lt;/code&gt; options to
only &lt;code&gt;rsync&lt;/code&gt; the wanted SubFolders. This will eliminate having to specify a
large number of &lt;code&gt;--filter&lt;/code&gt; options on the command line.&lt;/p&gt;
&lt;p&gt;For example, you can create your folderlist with:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="nx"&gt;find&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;FolderA&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;maxdepth&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;type&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;folderlist&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;(&lt;strong&gt;note:&lt;/strong&gt; specify the absolute path above and &lt;code&gt;find&lt;/code&gt; will produce the
&lt;code&gt;folderlist&lt;/code&gt; file containing absolute paths)&lt;/p&gt;
&lt;p&gt;Now edit your &lt;code&gt;folderlist&lt;/code&gt; file and remove the parent directory (e.g.
&lt;code&gt;/path/to/FolderA&lt;/code&gt;) and any SubFolders you don't want to sync under &lt;code&gt;FolderB&lt;/code&gt;.
You can now use the &lt;code&gt;folderlist&lt;/code&gt; file to control which SubFolders under
&lt;code&gt;FolderA&lt;/code&gt; are sync'ed to &lt;code&gt;FolderB&lt;/code&gt; without having to include a long list of
filters on the command line. Your command line then becomes&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;rsync -uai -r --no-R --files-from=folderlist / /path/to/FolderB
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;(&lt;strong&gt;note:&lt;/strong&gt; the &lt;code&gt;'/'&lt;/code&gt; as &lt;em&gt;source&lt;/em&gt; serves as a base for the paths contained in
&lt;code&gt;folderlist&lt;/code&gt;. You can change the &lt;code&gt;-i&lt;/code&gt; option to control the level of information
dumped to the screen, e.g. &lt;code&gt;-v&lt;/code&gt;, etc... or remove it altogether to suppress any
reporting other than errors)&lt;/p&gt;
&lt;p&gt;(&lt;strong&gt;also note:&lt;/strong&gt; when using &lt;code&gt;--files-from&lt;/code&gt;, &lt;code&gt;-a&lt;/code&gt; does not imply &lt;code&gt;-r&lt;/code&gt; (recursive),
so you will need to explicitly add &lt;code&gt;-r&lt;/code&gt; if you need a recursive transfer)&lt;/p&gt;</description><category>home-lab</category><category>linux</category><guid>https://hiy.netlify.app/posts/rsync-folders-present-on-destination.html</guid><pubDate>Sat, 03 Aug 2019 17:28:57 GMT</pubDate></item><item><title>How to force GPG to use console-mode pinentry for passwords</title><link>https://hiy.netlify.app/posts/force-gpg-console-pinentry.html</link><dc:creator>author</dc:creator><description>&lt;p&gt;Answer to &lt;a href="https://superuser.com/q/520980"&gt;this SU question&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;On Ubuntu 18.04, with the default installation of gpg 2.2.4, I have&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;/usr/bin/pinentry
/usr/bin/pinentry-gnome3
/usr/bin/pinentry-gtk-2
/usr/bin/pinentry-x11
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I was able to do the following to have a text-based PIN entry:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="k"&gt;export&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;GPG_TTY&lt;/span&gt;&lt;span class="o"&gt;=$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tty&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;gpg&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;connect&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;updatestartuptty&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;bye&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;gt;/&lt;/span&gt;&lt;span class="n"&gt;dev&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nb nb-Type"&gt;null&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;</description><category>linux</category><guid>https://hiy.netlify.app/posts/force-gpg-console-pinentry.html</guid><pubDate>Wed, 20 Feb 2019 03:41:41 GMT</pubDate></item></channel></rss>