wslでnerves その14

# 概要
wsl(wsl2じゃない)でnervesやってみる。
qemu(x86_64エミュレータ、ラズパイじゃない)でやってみた。
練習問題やってみた。

# 練習問題
paiza.ioで開発したプログラムが、nervesで動作することを確認せよ。

# 参考にしたページ。

https://qiita.com/ohisama@github/items/6146d89c1c588a841b6c

# 実行手順

- qemu起動
- ssh接続
- ソースをコピー(ctrl+c)
- ソースを貼り付け(マウス右クリック)

# 実行結果

```
$ ssh -p 10022 localhost
Interactive Elixir (1.13.4) - press Ctrl+C to exit (type h() ENTER for help)
████▄▄    ▐███
█▌  ▀▀██▄▄  ▐█
█▌  ▄▄  ▀▀  ▐█   N  E  R  V  E  S
█▌  ▀▀██▄▄  ▐█
███▌    ▀▀████
hello_nerves 0.1.0 (7b5b34a4-8bc2-5144-5f98-58be2e2464a2) x86_64 x86_64
  Uptime       : 1 minutes and 55 seconds
  Clock        : 2023-01-18 22:28:29 UTC

  Firmware     : Valid (A)               Applications : 38 started
  Memory usage : 57 MB (50%)             Part usage   : 0 MB (0%)
  Hostname     : nerves-3456             Load average : 1.01 0.38 0.14

  eth0         : 10.0.2.15/24, fec0::5054:ff:fe12:3456/64, fe80::5054:ff:fe12:3456/64

Nerves CLI help: https://hexdocs.pm/nerves/iex-with-nerves.html

Toolshed imported. Run h(Toolshed) for more info.
iex(1)>
nil
iex(2)>
nil
iex(3)> :inets.start
{:error, {:already_started, :inets}}
iex(4)> :ssl.start
:ok
iex(5)> query = "Hello World!"
"Hello World!"
iex(6)> {:ok, {{_, _, _}, _, body}} = :httpc.request(:post, {'https://textbox.kokoa.dev/ohisama/elixir/test', [], ['text/plain'], query}, [], [])
{:ok,
 {{'HTTP/1.1', 200, 'OK'},
  [
    {'connection', 'keep-alive'},
    {'date', 'Wed, 18 Jan 2023 22:28:48 GMT'},
    {'server', 'cloudflare'},
    {'content-length', '12'},
    {'content-type', 'text/html; charset=utf-8'},
    {'x-powered-by', 'Express'},
    {'access-control-allow-origin', '*'},
    {'access-control-allow-methods', 'POST, GET, OPTIONS'},
    {'access-control-allow-headers', 'Origin, Authorization, Accept'},
    {'access-control-allow-credentials', 'true'},
    {'cf-cache-status', 'DYNAMIC'},
    {'report-to',
     '{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=QaW3VOrLUF8wOc33HM0yo0Jslm60FeEFBRsDvh5b%2BZIjpjARkfHVS9iuJb5vQprNStGWxbWzfcvbF0JXmb0gLaPm2hPsfq7rdjYU8jkvQagJiupJmjaabGg4koY0kQ4oUJSpmA%3D%3D"}],"group":"cf-nel","max_age":604800}'},
    {'nel', '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}'},
    {'cf-ray', '78bac40d68e5f5fd-NRT'},
    {'alt-svc', 'h3=":443"; ma=86400, h3-29=":443"; ma=86400'}
  ], 'Hello World!'}}
iex(7)> IO.puts(body)
Hello World!
:ok
iex(8)> {:ok, {_status, _headers, body}} = :httpc.request('https://textbox.kokoa.dev/ohisama/elixir/test')
{:ok,
 {{'HTTP/1.1', 200, 'OK'},
  [
    {'connection', 'keep-alive'},
    {'date', 'Wed, 18 Jan 2023 22:28:49 GMT'},
    {'server', 'cloudflare'},
    {'content-length', '12'},
    {'content-type', 'text/html; charset=utf-8'},
    {'x-powered-by', 'Express'},
    {'access-control-allow-origin', '*'},
    {'access-control-allow-methods', 'POST, GET, OPTIONS'},
    {'access-control-allow-headers', 'Origin, Authorization, Accept'},
    {'access-control-allow-credentials', 'true'},
    {'cf-cache-status', 'DYNAMIC'},
    {'report-to',
     '{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=0%2B0%2BbMXMrP0BjvUNS8Fqd1M3FGUiWADZq2ak0fjZFLBXQHfbveEvdmyR42D9j77vEqHo9O5rxJByBddxniYxoseZt3bgya734CwiSqMzhaZu1vorHxdXsmZWo1YxAhKD7jNEuQ%3D%3D"}],"group":"cf-nel","max_age":604800}'},
    {'nel', '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}'},
    {'cf-ray', '78bac4105b61f5fd-NRT'},
    {'alt-svc', 'h3=":443"; ma=86400, h3-29=":443"; ma=86400'}
  ], 'Hello World!'}}
iex(9)> IO.puts(body)
Hello World!
:ok
iex(10)>
nil
iex(11)>
nil
iex(12)> exit
Connection to localhost closed.
```


以上。