<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Dog Tera]]></title><description><![CDATA[Cat is a tech blog with has nothing to do with cat.]]></description><link>https://blog.kclass.work</link><generator>RSS for Node</generator><lastBuildDate>Sat, 02 May 2026 13:22:56 GMT</lastBuildDate><atom:link href="https://blog.kclass.work/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[SSH into Boxes VM from Host]]></title><description><![CDATA[In guest VM (Ubuntu)
# Optional, tmux is convinient for long running task
sudo apt install tmux 

# Start a tmux session
tmux

# Creates a reverse SSH tunnel from the host (_gateway) 
# back to your VM, mapping the host port 2222 to VM port 22, 
# al...]]></description><link>https://blog.kclass.work/ssh-into-boxes-vm-from-host</link><guid isPermaLink="true">https://blog.kclass.work/ssh-into-boxes-vm-from-host</guid><category><![CDATA[ssh]]></category><category><![CDATA[Linux]]></category><dc:creator><![CDATA[Gu]]></dc:creator><pubDate>Wed, 08 Oct 2025 23:18:38 GMT</pubDate><content:encoded><![CDATA[<p>In guest VM (Ubuntu)</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Optional, tmux is convinient for long running task</span>
sudo apt install tmux 

<span class="hljs-comment"># Start a tmux session</span>
tmux

<span class="hljs-comment"># Creates a reverse SSH tunnel from the host (_gateway) </span>
<span class="hljs-comment"># back to your VM, mapping the host port 2222 to VM port 22, </span>
<span class="hljs-comment"># allowing SSH access to VM through the gateway. </span>
<span class="hljs-comment"># Need to change host_user_name </span>
ssh -NT -R 2222:localhost:22 host_user_name@_gateway

<span class="hljs-comment"># Detach tmux session</span>
<span class="hljs-comment"># Ctrl+b then d</span>

<span class="hljs-comment"># Optional, to bring tmux session back </span>
tmux attach
<span class="hljs-comment"># or list session and bring session with certain ID</span>
tmux ls
<span class="hljs-comment"># 0 is the session id from previous output</span>
tmux a -t 0
</code></pre>
<p>In host</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Need to change guest_user_name</span>
ssh -p 2222 guest_user_name@localhost
</code></pre>
<p>Reference</p>
<p><a target="_blank" href="https://unix.stackexchange.com/questions/627187/ssh-into-gnome-boxes-os">https://unix.stackexchange.com/questions/627187/ssh-into-gnome-boxes-os</a></p>
]]></content:encoded></item><item><title><![CDATA[My Git Cheat Sheet]]></title><description><![CDATA[How to merge upstream changes to my branch
git remote add upstream git@gitlab.com:CentOS/automotive/demos/ffi-demo.git

git fetch upstream
git checkout a_branch
git rebase upstream/a_branch

Reference
https://www.atlassian.com/git/tutorials/git-forks...]]></description><link>https://blog.kclass.work/my-git-cheat-sheet</link><guid isPermaLink="true">https://blog.kclass.work/my-git-cheat-sheet</guid><category><![CDATA[tools]]></category><dc:creator><![CDATA[Gu]]></dc:creator><pubDate>Wed, 07 May 2025 02:40:29 GMT</pubDate><content:encoded><![CDATA[<p>How to merge upstream changes to my branch</p>
<pre><code class="lang-bash">git remote add upstream git@gitlab.com:CentOS/automotive/demos/ffi-demo.git

git fetch upstream
git checkout a_branch
git rebase upstream/a_branch
</code></pre>
<p>Reference</p>
<p><a target="_blank" href="https://www.atlassian.com/git/tutorials/git-forks-and-upstreams">https://www.atlassian.com/git/tutorials/git-forks-and-upstreams</a></p>
]]></content:encoded></item><item><title><![CDATA[HTTP3 Notes]]></title><description><![CDATA[https://hub.docker.com/r/ymuski/curl-http3
$ docker run -it --rm ymuski/curl-http3 curl -V

$ docker run -it --rm ymuski/curl-http3 curl -svo /dev/null https://lf19-c10.bytedgame.com/ --http3

*   Trying 151.101.110.73:443...
* Connect socket 5 over ...]]></description><link>https://blog.kclass.work/http3-notes</link><guid isPermaLink="true">https://blog.kclass.work/http3-notes</guid><dc:creator><![CDATA[Gu]]></dc:creator><pubDate>Wed, 12 Mar 2025 11:05:58 GMT</pubDate><content:encoded><![CDATA[<p>https://hub.docker.com/r/ymuski/curl-http3</p>
<pre><code class="lang-plaintext">$ docker run -it --rm ymuski/curl-http3 curl -V

$ docker run -it --rm ymuski/curl-http3 curl -svo /dev/null https://lf19-c10.bytedgame.com/ --http3

*   Trying 151.101.110.73:443...
* Connect socket 5 over QUIC to 151.101.110.73:443
* Sent QUIC client Initial, ALPN: h3-29,h3-28,h3-27
* Connected to lf19-c10.bytedgame.com () port 443 (#0)
* h3 [:method: GET]
* h3 [:path: /]
* h3 [:scheme: https]
* h3 [:authority: lf19-c10.bytedgame.com]
* h3 [user-agent: curl/7.76.1-DEV]
* h3 [accept: */*]
* Using HTTP/3 Stream ID: 0 (easy handle 0x40002371e0)
&gt; GET / HTTP/3
&gt; Host: lf19-c10.bytedgame.com
&gt; user-agent: curl/7.76.1-DEV
&gt; accept: */*
&gt;
&lt; HTTP/3 403
</code></pre>
<h1 id="heading-reference">Reference</h1>
<p>https://developers.cloudflare.com/http3/tutorials/curl-brew https://developers.cloudflare.com/http3/tutorials/chrome</p>
]]></content:encoded></item><item><title><![CDATA[My Python Environment Cheat Sheet]]></title><description><![CDATA[Install pyenv
Mac
brew update
brew install pyenv

echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init -)"' >> ~/.zshrc

Linux
curl -fsSL https...]]></description><link>https://blog.kclass.work/my-python-environment-cheat-sheet</link><guid isPermaLink="true">https://blog.kclass.work/my-python-environment-cheat-sheet</guid><category><![CDATA[Python]]></category><dc:creator><![CDATA[Gu]]></dc:creator><pubDate>Mon, 22 Jul 2024 07:39:21 GMT</pubDate><content:encoded><![CDATA[<h1 id="heading-install-pyenv">Install pyenv</h1>
<h2 id="heading-mac">Mac</h2>
<pre><code class="lang-bash">brew update
brew install pyenv

<span class="hljs-built_in">echo</span> <span class="hljs-string">'export PYENV_ROOT="$HOME/.pyenv"'</span> &gt;&gt; ~/.zshrc
<span class="hljs-built_in">echo</span> <span class="hljs-string">'[[ -d $PYENV_ROOT/bin ]] &amp;&amp; export PATH="$PYENV_ROOT/bin:$PATH"'</span> &gt;&gt; ~/.zshrc
<span class="hljs-built_in">echo</span> <span class="hljs-string">'eval "$(pyenv init -)"'</span> &gt;&gt; ~/.zshrc
</code></pre>
<h2 id="heading-linux">Linux</h2>
<pre><code class="lang-bash">curl -fsSL https://pyenv.run | bash

sudo dnf builddep python3

<span class="hljs-built_in">export</span> PYENV_ROOT=<span class="hljs-string">"<span class="hljs-variable">$HOME</span>/.pyenv"</span>
[[ -d <span class="hljs-variable">$PYENV_ROOT</span>/bin ]] &amp;&amp; <span class="hljs-built_in">export</span> PATH=<span class="hljs-string">"<span class="hljs-variable">$PYENV_ROOT</span>/bin:<span class="hljs-variable">$PATH</span>"</span>
<span class="hljs-built_in">eval</span> <span class="hljs-string">"<span class="hljs-subst">$(pyenv init - bash)</span>"</span>
</code></pre>
<p>Add below to .bash_rc to enable venv</p>
<pre><code class="lang-bash"><span class="hljs-built_in">eval</span> <span class="hljs-string">"<span class="hljs-subst">$(pyenv virtualenv-init -)</span>"</span>
</code></pre>
<h1 id="heading-commands">Commands</h1>
<h2 id="heading-pyenv">pyenv</h2>
<pre><code class="lang-bash"><span class="hljs-comment"># List available versions</span>
<span class="hljs-comment"># https://www.python.org/doc/versions/</span>
pyenv install -l

<span class="hljs-comment"># Install a python version</span>
pyenv install 3.12.10

<span class="hljs-comment"># List currently installed python version</span>
pyenv versions

<span class="hljs-comment"># Set global python version</span>
pyenv global 3.12.10

<span class="hljs-comment"># Set python version for a directory</span>
<span class="hljs-comment"># cd into a directory </span>
pyenv <span class="hljs-built_in">local</span> 3.12.10

<span class="hljs-comment"># Set current shell python</span>
pyenv shell 3.12.10

<span class="hljs-comment"># Remove installation</span>
pyenv uninstall 3.10.10

<span class="hljs-comment"># Check you current python version</span>
python --version
</code></pre>
<h2 id="heading-venv">venv</h2>
<pre><code class="lang-bash">mkdir some_dir; <span class="hljs-built_in">cd</span> some_dir
python -m venv .venv
<span class="hljs-built_in">source</span> .venv/bin/activate
</code></pre>
<h1 id="heading-reference">Reference</h1>
<p><a target="_blank" href="https://github.com/pyenv/pyenv">https://github.com/pyenv/pyenv</a></p>
<p><a target="_blank" href="https://opensource.com/article/19/5/python-3-default-mac">https://opensource.com/article/19/5/python-3-default-mac</a></p>
<p><a target="_blank" href="https://github.com/pyenv/pyenv">https://github.com/pyenv/pyenv</a></p>
<p><a target="_blank" href="https://dev.to/veer66/pyenv-and-pipenv-on-fedora-13m2">https://dev.to/veer66/pyenv-and-pipenv-on-fedora-13m2</a></p>
]]></content:encoded></item><item><title><![CDATA[Test TLS Resumption]]></title><description><![CDATA[Session Ticket Resumption
new connection
Session parameter will be saved in /tmp/ssl_s 
openssl s_client -connect t3.fastly.work:443 -sess_out /tmp/ssl_s -servername t3.fastly.work
output 
---
SSL handshake has read 4654 bytes and written 304 bytes
-...]]></description><link>https://blog.kclass.work/test-tls-resumption</link><guid isPermaLink="true">https://blog.kclass.work/test-tls-resumption</guid><category><![CDATA[TLS]]></category><category><![CDATA[https]]></category><dc:creator><![CDATA[Gu]]></dc:creator><pubDate>Sat, 09 Apr 2022 11:40:11 GMT</pubDate><content:encoded><![CDATA[<h1 id="heading-session-ticket-resumption">Session Ticket Resumption</h1>
<h2 id="heading-new-connection">new connection</h2>
<p>Session parameter will be saved in /tmp/ssl_s </p>
<pre><code>openssl s_client <span class="hljs-operator">-</span>connect t3.fastly.work:<span class="hljs-number">443</span> <span class="hljs-operator">-</span>sess_out <span class="hljs-operator">/</span>tmp<span class="hljs-operator">/</span>ssl_s <span class="hljs-operator">-</span>servername t3.fastly.work
</code></pre><p>output </p>
<pre><code><span class="hljs-meta">---</span>
<span class="hljs-string">SSL</span> <span class="hljs-string">handshake</span> <span class="hljs-string">has</span> <span class="hljs-string">read</span> <span class="hljs-number">4654 </span><span class="hljs-string">bytes</span> <span class="hljs-string">and</span> <span class="hljs-string">written</span> <span class="hljs-number">304</span> <span class="hljs-string">bytes</span>
<span class="hljs-meta">---</span>
<span class="hljs-string">New,</span> <span class="hljs-string">TLSv1/SSLv3,</span> <span class="hljs-string">Cipher</span> <span class="hljs-string">is</span> <span class="hljs-string">ECDHE-RSA-CHACHA20-POLY1305</span>
<span class="hljs-string">Server</span> <span class="hljs-string">public</span> <span class="hljs-string">key</span> <span class="hljs-string">is</span> <span class="hljs-number">2048 </span><span class="hljs-string">bit</span>
<span class="hljs-string">Secure</span> <span class="hljs-string">Renegotiation</span> <span class="hljs-string">IS</span> <span class="hljs-string">supported</span>
<span class="hljs-attr">Compression:</span> <span class="hljs-string">NONE</span>
<span class="hljs-attr">Expansion:</span> <span class="hljs-string">NONE</span>
<span class="hljs-literal">No</span> <span class="hljs-string">ALPN</span> <span class="hljs-string">negotiated</span>
<span class="hljs-attr">SSL-Session:</span>
    <span class="hljs-attr">Protocol  :</span> <span class="hljs-string">TLSv1.2</span>
    <span class="hljs-attr">Cipher    :</span> <span class="hljs-string">ECDHE-RSA-CHACHA20-POLY1305</span>
    <span class="hljs-attr">Session-ID:</span> <span class="hljs-string">401ABB1C964A75FC5DBC283F963B841AC567FF5CAAC2EEA7645989DB8174A362</span>
    <span class="hljs-attr">Session-ID-ctx:</span>
    <span class="hljs-attr">Master-Key:</span> <span class="hljs-string">9C76B3A6773C989D0E092F154C8212F0297EB7D2B7AF5886836D770B4CB3912E521847EE4B878CE88CD44D59C4CC3F51</span>
    <span class="hljs-attr">TLS session ticket lifetime hint:</span> <span class="hljs-number">7200</span> <span class="hljs-string">(seconds)</span>
    <span class="hljs-attr">TLS session ticket:</span>
</code></pre><p>Issue a http command (extra newline needed) to verify if https works</p>
<pre><code><span class="hljs-keyword">GET</span> <span class="hljs-string">/status/200</span> HTTP/1.1
<span class="hljs-attribute">Host</span>: t3.fastly.work
</code></pre><h2 id="heading-resumption">resumption</h2>
<p>Session parameter saved in /tmp/ssl_s will be used</p>
<pre><code>openssl s_client <span class="hljs-operator">-</span>connect t3.fastly.work:<span class="hljs-number">443</span> <span class="hljs-operator">-</span>sess_in <span class="hljs-operator">/</span>tmp<span class="hljs-operator">/</span>ssl_s <span class="hljs-operator">-</span>servername t3.fastly.work
</code></pre><p>output</p>
<pre><code><span class="hljs-meta">---</span>
<span class="hljs-string">SSL</span> <span class="hljs-string">handshake</span> <span class="hljs-string">has</span> <span class="hljs-string">read</span> <span class="hljs-number">129</span> <span class="hljs-string">bytes</span> <span class="hljs-string">and</span> <span class="hljs-string">written</span> <span class="hljs-number">470</span> <span class="hljs-string">bytes</span>
<span class="hljs-meta">---</span>
<span class="hljs-string">Reused,</span> <span class="hljs-string">TLSv1/SSLv3,</span> <span class="hljs-string">Cipher</span> <span class="hljs-string">is</span> <span class="hljs-string">ECDHE-RSA-CHACHA20-POLY1305</span>
<span class="hljs-string">Server</span> <span class="hljs-string">public</span> <span class="hljs-string">key</span> <span class="hljs-string">is</span> <span class="hljs-number">2048 </span><span class="hljs-string">bit</span>
<span class="hljs-string">Secure</span> <span class="hljs-string">Renegotiation</span> <span class="hljs-string">IS</span> <span class="hljs-string">supported</span>
<span class="hljs-attr">Compression:</span> <span class="hljs-string">NONE</span>
<span class="hljs-attr">Expansion:</span> <span class="hljs-string">NONE</span>
<span class="hljs-literal">No</span> <span class="hljs-string">ALPN</span> <span class="hljs-string">negotiated</span>
<span class="hljs-attr">SSL-Session:</span>
    <span class="hljs-attr">Protocol  :</span> <span class="hljs-string">TLSv1.2</span>
    <span class="hljs-attr">Cipher    :</span> <span class="hljs-string">ECDHE-RSA-CHACHA20-POLY1305</span>
    <span class="hljs-attr">Session-ID:</span> <span class="hljs-string">401ABB1C964A75FC5DBC283F963B841AC567FF5CAAC2EEA7645989DB8174A362</span>
    <span class="hljs-attr">Session-ID-ctx:</span>
    <span class="hljs-attr">Master-Key:</span> <span class="hljs-string">9C76B3A6773C989D0E092F154C8212F0297EB7D2B7AF5886836D770B4CB3912E521847EE4B878CE88CD44D59C4CC3F51</span>
    <span class="hljs-attr">TLS session ticket lifetime hint:</span> <span class="hljs-number">7200</span> <span class="hljs-string">(seconds)</span>
    <span class="hljs-attr">TLS session ticket:</span>
</code></pre><p>Notice only 129 bytes is read for resumption, compared to 4654 bytes for new connection</p>
<p>Issue a http command (extra newline needed) to verify if https still works. (and YES)</p>
<pre><code><span class="hljs-keyword">GET</span> <span class="hljs-string">/status/200</span> HTTP/1.1
<span class="hljs-attribute">Host</span>: t3.fastly.work
</code></pre><h1 id="heading-session-id-resumption">Session ID Resumption</h1>
<p>we can add -no_ticket to test session ID resumption like below.  </p>
<h2 id="heading-new-connection">new connection</h2>
<pre><code>openssl s_client <span class="hljs-operator">-</span>connect t3.fastly.work:<span class="hljs-number">443</span> <span class="hljs-operator">-</span>no_ticket <span class="hljs-operator">-</span>sess_out <span class="hljs-operator">/</span>tmp<span class="hljs-operator">/</span>ssl_s <span class="hljs-operator">-</span>servername t3.fastly.work
</code></pre><h2 id="heading-resumption">resumption</h2>
<pre><code>openssl s_client <span class="hljs-operator">-</span>connect t3.fastly.work:<span class="hljs-number">443</span> <span class="hljs-operator">-</span>no_ticket <span class="hljs-operator">-</span>sess_in <span class="hljs-operator">/</span>tmp<span class="hljs-operator">/</span>ssl_s <span class="hljs-operator">-</span>servername t3.fastly.work
</code></pre><h1 id="heading-reference">Reference</h1>
<p>https://serverfault.com/questions/345891/how-should-i-check-if-ssl-session-resumption-is-working-or-not</p>
]]></content:encoded></item><item><title><![CDATA[Wireshark's TLS 0-RTT Early-Data Capture]]></title><description><![CDATA[This article shows how to capture TLS1.3 0-RTT early-data from Chrome browser by wireshark on Mac.
Close all your Chrome instances and start a new instance which will output SSL key to a log file.
SSLKEYLOGFILE=~/temp/sslkeylog.log /Applications/Goog...]]></description><link>https://blog.kclass.work/wiresharks-tls-0-rtt-early-data-capture</link><guid isPermaLink="true">https://blog.kclass.work/wiresharks-tls-0-rtt-early-data-capture</guid><category><![CDATA[TLS]]></category><dc:creator><![CDATA[Gu]]></dc:creator><pubDate>Tue, 22 Feb 2022 12:27:43 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1645532629022/TYte2joJ7.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This article shows how to capture TLS1.3 0-RTT early-data from Chrome browser by wireshark on Mac.</p>
<p>Close all your Chrome instances and start a new instance which will output SSL key to a log file.</p>
<pre><code>SSLKEYLOGFILE<span class="hljs-operator">=</span><span class="hljs-operator">~</span><span class="hljs-operator">/</span>temp<span class="hljs-operator">/</span>sslkeylog.log <span class="hljs-operator">/</span>Applications<span class="hljs-operator">/</span>Google\ Chrome.app/Contents<span class="hljs-operator">/</span>MacOS<span class="hljs-operator">/</span>Google\ Chrome
</code></pre><p>Next, we need to enable the 0-RTT feature on Chrome, according to the introduction <a target="_blank" href="https://qiita.com/flano_yuki/items/e77036d21a6671d9a2c2">here</a><br /><em>Enter <code>chrome://flags</code>  to address bar, then find「TLS 1.3 Early Data」flag and enable it.</em>
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645532629022/TYte2joJ7.png" alt="image.png" /></p>
<p>Let Wireshark know where is the SSL Key locates, put path of SSL key log file in below dialog<br />Wireshark --&gt; Preference --&gt; Protocols --&gt; TLS --&gt; (Pre)-Master-Secret log filename
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645344589333/jqJSjQk4_.png" alt="image.png" /></p>
<p>Now we can start Wireshark's capture<br />Optionally, you may want to set a capture filter to only capture IP ranges of server you cares to reduce noises, like</p>
<pre><code><span class="hljs-string">net</span> <span class="hljs-number">151.101</span><span class="hljs-number">.0</span><span class="hljs-number">.0</span><span class="hljs-string">/16</span>
</code></pre><p>Now from browser access a site like https://httpbin.fastly.work/html which supports TLS1.3 0-RTT  </p>
<p>And you will get capture on wireshark like this, the green part are decrypted messages
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645344670363/yk1574yzw.png" alt="image.png" /></p>
<p>Wait for few minutes, make sure from Wireshark that connection is closed, then access https://httpbin.fastly.work/html again, you will find new TLS connection's <code>Client Hello</code>, will come with the early-data. </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646182781513/Ow9bSPMHS.png" alt="image.png" /></p>
]]></content:encoded></item><item><title><![CDATA[Build AMD64 Docker on M1]]></title><description><![CDATA[I plan to verify 0-RTT capability using sslyze as mentioned in here on M1:
python -m sslyze --early_data www.fastly.com
I got below error:
ImportError: dlopen(/Users/gu/.pyenv/versions/3.10.1/lib/python3.10/site-packages/nassl/_nassl.cpython-310-darw...]]></description><link>https://blog.kclass.work/build-amd64-docker-on-m1</link><guid isPermaLink="true">https://blog.kclass.work/build-amd64-docker-on-m1</guid><category><![CDATA[Docker]]></category><dc:creator><![CDATA[Gu]]></dc:creator><pubDate>Thu, 17 Feb 2022 07:46:17 GMT</pubDate><content:encoded><![CDATA[<p>I plan to verify 0-RTT capability using <a target="_blank" href="https://github.com/nabla-c0d3/sslyze">sslyze</a> as mentioned in <a target="_blank" href="https://ahmedjama.com/blog/2020/07/how-to-test-0-rtt-using-sslyze/">here</a> on M1:</p>
<pre><code>python <span class="hljs-operator">-</span>m sslyze <span class="hljs-operator">-</span><span class="hljs-operator">-</span>early_data www.fastly.com
</code></pre><p>I got below error:</p>
<pre><code>ImportError: dlopen(<span class="hljs-operator">/</span>Users<span class="hljs-operator">/</span>gu<span class="hljs-operator">/</span>.pyenv/versions<span class="hljs-operator">/</span><span class="hljs-number">3.10</span><span class="hljs-number">.1</span><span class="hljs-operator">/</span>lib<span class="hljs-operator">/</span>python3<span class="hljs-number">.10</span><span class="hljs-operator">/</span>site<span class="hljs-operator">-</span>packages<span class="hljs-operator">/</span>nassl<span class="hljs-operator">/</span>_nassl.cpython-<span class="hljs-number">310</span><span class="hljs-operator">-</span>darwin.so, <span class="hljs-number">0x0002</span>): symbol not found in flat namespace <span class="hljs-string">'_PEM_write_bio_X509'</span>
</code></pre><p>It happens because on my Mac M1, installed Python tool-chain is built in ARM64 and one required package has no ARM64 build. This error is mentioned in this post, and one commented:</p>
<blockquote>
<p>I’m just going to use docker containers for my development purposes instead of messing with dual installations of homebrew/python</p>
</blockquote>
<p>This is how to build a docker container of AMD64 architecture Python environment (if you do not want to use pre-built ones like nablac0d3/sslyze:5.0.0).</p>
<p>Create a requirement.txt to list Python package needed for your environment.</p>
<pre><code><span class="hljs-attribute">sslyze</span>
requests
<span class="hljs-comment"># other packages ...</span>
</code></pre><p>Create a Dockerfile, the first line force the docker to pull an AMD64 image.</p>
<pre><code><span class="hljs-keyword">FROM</span> <span class="hljs-comment">--platform=amd64 python:3</span>
WORKDIR /usr/src/app
<span class="hljs-keyword">COPY</span> requirements.txt ./
RUN pip install <span class="hljs-comment">--no-cache-dir -r requirements.txt</span>
# un-<span class="hljs-keyword">comment</span> below <span class="hljs-keyword">if</span> needs <span class="hljs-keyword">to</span> run <span class="hljs-keyword">some</span> script
# <span class="hljs-keyword">COPY</span> my_script.py .
# CMD [ "python", "./my_script.py" ]
</code></pre><p>Build docker image</p>
<pre><code>$ docker build <span class="hljs-operator">-</span>t python<span class="hljs-operator">-</span>env .
</code></pre><p>Start a bash terminal</p>
<pre><code><span class="hljs-string">$</span> <span class="hljs-string">docker</span> <span class="hljs-string">run</span> <span class="hljs-string">-it</span> <span class="hljs-string">python-env</span> <span class="hljs-string">bash</span>
<span class="hljs-attr">WARNING:</span> <span class="hljs-string">The</span> <span class="hljs-string">requested</span> <span class="hljs-string">image's</span> <span class="hljs-string">platform</span> <span class="hljs-string">(linux/amd64)</span> <span class="hljs-string">does</span> <span class="hljs-string">not</span> <span class="hljs-string">match</span> <span class="hljs-string">the</span> <span class="hljs-string">detected</span> <span class="hljs-string">host</span> <span class="hljs-string">platform</span> <span class="hljs-string">(linux/arm64/v8)</span> <span class="hljs-string">and</span> <span class="hljs-literal">no</span> <span class="hljs-string">specific</span> <span class="hljs-string">platform</span> <span class="hljs-string">was</span> <span class="hljs-string">requested</span>
<span class="hljs-string">/usr/src/app#</span>
</code></pre><p>We get some warning but it can be safely ignored, and we can run sslyze like below</p>
<pre><code>/usr/src/app<span class="hljs-comment"># python -m sslyze --early_data www.fastly.com</span>
</code></pre><p>If you do not want to build your own python AMD64 docker image to run sslyze, you can use pre-built one like</p>
<pre><code>docker run <span class="hljs-operator">-</span><span class="hljs-operator">-</span>rm <span class="hljs-operator">-</span>it nablac0d3<span class="hljs-operator">/</span>sslyze:<span class="hljs-number">5.0</span><span class="hljs-number">.0</span> <span class="hljs-operator">-</span><span class="hljs-operator">-</span>early_data www.fastly.com
</code></pre>]]></content:encoded></item></channel></rss>