2023,江端さんの技術メモ

UbuntuでFTPサーバを停止するには、サーバソフトウェアによって異なります。一般的に、Ubuntuでよく使われるFTPサーバソフトウェアはvsftpd(Very Secure FTP Daemon)です。以下に、vsftpdを停止する方法を説明します。もし他のFTPサーバーソフトウェアを使用している場合は、それに対応した手順を適用してください。

vsftpdを停止する手順:

  1. ターミナルを開きます。
  2. vsftpdサービスを停止します。次のコマンドを使用します:
    sudo systemctl stop vsftpd
  3. vsftpdサービスが停止したことを確認するために、次のコマンドを使用してサービスのステータスを確認します:
    sudo systemctl status vsftpd

    ステータスが「inactive」(非アクティブ)になっているはずです。

  4. vsftpdサービスが自動起動しないように設定したい場合、次のコマンドを使用して自動起動を無効にします:
    sudo systemctl disable vsftpd

これにより、システムの再起動時にvsftpdサービスが起動しないようになります。

以上の手順に従うことで、vsftpd FTPサーバーを停止し、必要に応じて自動起動を無効にできます。

2023,江端さんの技術メモ

/etc/vsftpd.conf

listen=NO
listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_file=/var/log/vsftpd.log
ascii_upload_enable=YES
ascii_download_enable=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO
utf8_filesystem=YES

2023,江端さんの忘備録

大学の講義の内容が厳しい。

The content of the university lectures is challenging.

英語の本を読んで、英語プレゼン発表1時間って ―― そういうのは「英語に愛されているエンジニア」の領分だと思う。

Reading an English book and presenting an English presentation for an hour -- I think that kind of thing is the domain of "engineers who are loved by the English language.

でも、必須単位取れないと、卒業できないしなぁ。

But if I don't get the required credits, I won't be able to graduate.

というか、卒業したらどうだというんだ? 就職に有利てか? もうリタイア目の前なのに?

However, what do I think about graduating? What about the job opportunities? Even though I'm about to retire?

―― あ、これは考えたらダメなやつだ

"Oh, I'm losing this one if I think about it."

と思ったので、もう止めます。

So, I stop it.

-----

私:「あのさ、『コモンズの悲劇』って知っている?」

Me: "Have you ever heard of The Tragedy of the Commons?"

嫁さん:「知らない。『ドーハの悲劇』なら知っているけど」

Wife: "I don't know. I know about the Doha Tragedy, though."

まあ、そうだろうな、と思いました。

Well, I thought, I guess so.

ちなみに、私が『ドーハの悲劇』というフレーズを知ったのは、ごく最近です

Incidentally, it was only recently that I learned the phrase "Doha Tragedy."

江端:「分かるも何も、ゲーム理論で、コラムを書いているくらいなんだが ―― 知らなかったか?」

2020,江端さんの忘備録

長女は、大学で心理学を専攻しています。

My eldest daughter majors in psychology at college.

心理学は文系とされていますが、実際のところ、理系より理系している学問です。

Psychology is considered a liberal arts, but it is a science that is more science than science.

データ収集と、それに基づく統計計算や有意検定などを、日常的に扱わなければならず、下手な理系よりも実践な、フィールドワークが必要とされているようです。

Psychology must deal with data collection, statistical calculations, and significance tests based on it daily. There seems to be a need for more practical fieldwork than poor science.

----

先日、その長女が珍しく、私の部屋にやってきて、頼み込んできました。

The other day, the eldest daughter came to my room and asked for it.

長女;「パパ、ゲーム理論って分かる?」

"Dad, do you know "game theory"?"

ゲーム理論は、心の数値化と定式化を可能とする優れた手法ですが、心理学の学生が、そのフィールドまで学ばねばならないとは、知りませんでした。

Game theory is a great way to quantify and formulate the human mind. However, I did not know that a psychology student had to learn the field.

Ebata: "I know, I'm writing a column in game theory. Didn't you know?"

長女:「知らなかった」

SD: "I didn't know."

まあ、家族といえども、父の著書に目を通す訳ではないので、仕方がないのですが。

Well, even my family can't help reading their father's articles.

江端:「とりあえず、"江端智一" & "ゲーム理論"でググってみろ」

Ebata: "Anyway, try to google with "Tomoichi Ebata" & "Game Theory"

と言っておきました。

I said to her.

-----

その後、長女から大学から配布されているゲーム理論に関するレジュメを見せて貰ったのですが、『こりゃ、分からんだろうなあぁ』と思いました。

After that, she showed me a resume on game theory distributed by the university. However, I thought, "Who can understand it by this resume?"

「囚人のジレンマ」は、ゲーム理論の概念の説明に過ぎませんし ―― なにより、つまらん。

The "prisoner's dilemma" is just an explanation of the concept of game theory. Above all, it is boring.

せめて、ゲール=シャプレーアルゴリズムをつかった、「実践的な結婚戦略」を教えるくらいのことすればいいのに、とか、まあ、いらんこと考えていました。

At the very least, the teacher should teach a "practical marriage strategy" using the Gale-Shapley algorithm; I was thinking about it.

2023,江端さんの忘備録

アメリカ同時多発テロ事件の時、米国に赴任していた私たち家族は、国外脱出ができませんでした ―― 全ての空港が閉鎖されていたからです。

At the time of the attacks, our family, who was posted to the U.S., could not leave the country -- all airports were closed.

あの時の恐怖は、よく覚えています。

I remember well the horror of that moment.

あの時、私たちは、本当にシンプルに『助けてくれ』と願っていました。

At that time, we asked for 'help.

そして、その当時、米国内の邦人(日本人)の救出について呑気にネットで議論しているやつらを、心底から憎悪していたことを覚えています。

And I remember that at that time, I hated with all my heart those discussing the rescue of Japanese citizens in the U.S. on the Internet.

-----

ですので ―― これから、確実に戦火に巻き込まれれることになる市民(非戦闘員)に対して、私は、語るべき言葉が、分からないのです。

So - I don't know what to say to the civilians (non-combatants) who will indeed be caught in the fire of war and killed.

2023,江端さんの技術メモ

pt@pt-desktop:~/www$ more docker-compose.yml
version: '3'

services:
  nginx:
    build: ./
    image: nginx
    ports:
      - 8888:80
    volumes:
      - ./src:/usr/share/nginx/html

    restart: always

の(ネストの位置に気をつけて)"restart: always"を付けた後、"$ docker compose build"をしておくこと。

以上

未分類

CREATE TABLE trips_test (
id serial PRIMARY KEY,
user_id integer,
distance double precision,
place point[],
speed double precision[],
prediction_type integer,
start_at timestamp,
end_at timestamp
);

INSERT INTO trips_test (user_id, distance, place) VALUES (1, 24.66249845798845, ARRAY[point '(34.7241, 135.1294)', point '(34.7241, 135.1294)', point '(34.7241, 135.1294)']);

moove=# INSERT INTO trips_test (user_id, distance, place)
moove-# VALUES (1, 24.66249845798845, ARRAY[point '(34.7241, 135.1294)', point '(34.7241, 135.1294)', point '(34.7241, 135.1294)']);
INSERT 0 1
moove=# select * from trips_test;
id | user_id | distance | place | speed | prediction_type | start_at | end_at
----+---------+-------------------+------------------------------------------------------------------+-------+-----------------+----------+--------
1 | 1 | 24.66249845798845 | {"(34.7241,135.1294)","(34.7241,135.1294)","(34.7241,135.1294)"} | | | |
(1 row)

 

上記のテーブルから、座標情報を一つ一つ取り出すにはどうしたら良いですか

 

SELECT id, user_id, unnest(place) AS single_point
FROM trips_test;

 

moove=# SELECT id, user_id, unnest(place) AS single_point
moove-# FROM trips_test;
id | user_id | single_point
----+---------+--------------------
1 | 1 | (34.7241,135.1294)
1 | 1 | (34.7241,135.1294)
1 | 1 | (34.7241,135.1294)

 

 

 

未分類

Ubuntu 22.04にdockerをインストールする

を参考にして頂きつつ、インストール実施中。

私は、根拠なく、

$ sudo apt-get install docker-ce=5:24.0.4-1~ubuntu.22.04~jammy

を選びました。

ラズパイ4、Ubuntu22.04、で"docker compose"も動いているようです ーー "docker-compose"は動きません。

 

2023,江端さんの忘備録

別に、日本全国の銀行振り込みシステムでなくとも、「システム障害」というのは血の気が引くものです。

Even if it is not a Japan-wide bank transfer system, a "system failure" is still a bloody good thing.

先程、私のメインのPCのドメインネームシステムが動かなくなり、青冷めていました。

I was blue-cold just now when the domain name system on my main PC stopped working.

最後の手段として、「ルータの再起動」を実施したのですが、人生でもっとも長い40秒の一つでした。

As a last resort, I implemented a "router reboot," which was one of the longest 40 seconds of my life.

『不調になった機械が、再起動で完全に動かなくなる』 ―― これまで、こんな修羅場に何度立ち会ってきたことか。

I can't tell you how many times I've been in the situation of "a machine that malfunctions and then completely stops working after a reboot.

-----

という訳で、私は病的なまでにバックアップを取るようにしているのですが、この「バックアップ」というのも、あまり当てになりません。

This is why I try to make morbid backups, but this "backup" is also unreliable.

OSを丸ごとイメージコピーしても、日進月歩でハードウェアのスペックも変化していくからです。

This is because even if the entire OS is image-copied, hardware specifications change ever-evolvingly.

「バックアップ」の有効期間というのは、私の感じでは、半年が限界。その後は、単なるハードディスクを消費するだけのファイルに成り果てます。

My feeling is that the maximum "backup" lifetime is six months. After that, they become mere complex disk-consuming files.

-----

それにしても訳が分からんのは、OSのバージョンを上げる度に、これまで問題なく動いてきたシステムファイルの構成を変えるOSSの開発者の頭の中です。

What is still incomprehensible to me is the mind of the OSS developers who change the configuration of system files that have been working without problems every time they upgrade the OS version.

- /etc/resolve.confを、dhcpの設定ファイルの方に寄せる必要って何?

- What is the need to move /etc/resolve.conf to the DHCP configuration file?

- GUIで提供するなら、全部一括できるようにデザインしておいて欲しい

- If you're going to provide it as a GUI, I'd like to see it designed so that it can all be done at once.

- というか、レガシーな設定を、OSのバージョンアップする度に変更していくバカは、一体どこの誰?

Who in the world is stupid enough to change legacy settings every time the OS is upgraded?

- DockerがマルチOS対応というのは結構ウソです(使ってみれば分かります)し、OSのバージョンによっては全く動かないし。

- It's pretty much a lie that Docker is multi-OS compatible (you'll see if you try it), and some OS versions don't work at all.

- ラズパイはチップを変更されただけで、問題がボロボロ出てくるし。

- And the Raspberry PI is just a chip that's been changed, and the problems are ragged out.

-----

私、自信をもって言えますが、システムへの脅威は「サイバーアタック」よりも、「システムリプレース」だと思っています。

I can confidently say that the threat to the system is more of a "system replacement" than a "cyber attack."

「システムリプレース」すれば、システムは高い確率で障害をおこします。

When a system is "replaced," there is a high probability that the system will fail.

あなたが、どれだけ怒号を撒き散らそうとも、動かんものは、動かん ―― コンピュータシステムとはそういうものです。

No matter how much you throw a tantrum, what doesn't work doesn't work -- that's how computer systems work.

これからも、銀行システムは停止し、飛行機は飛ばなくなり、コンサートチケットは取れなくなり、あなたの診療カルテが消えてなりなります。

The banking system will continue to shut down, airplanes will stop flying, concert tickets will not be available, and your medical records will disappear.

『デジタル化社会』というのは、つまるところそういうことであり、私たちは、そういう、システム停止を前提とした社会で生きることを覚悟しなければならない、ということです。

This is what a "digitalized society" is all about, and we must be prepared to live in such a society based on the premise that the system will stop working.

----

私は、『締切直前のシステムは止まる』『長期休暇明けのシステムは、必ず障害を起こす』と思って日々を生きています。

I live daily thinking, 'The system stops just before the deadline' and 'The system always fails after a long vacation.

この程度のことは、デジタルシステムの初歩の初歩です。

This level of detail is elementary to digital systems.

社会インフラに打撃を与えるのは、これまでは「地震」「火災」「台風」「洪水」などの天災でしたが、今や、ここに「サイバアタック」と「システムリプレース」の脅威が追加されているのです。

Until now, it was natural disasters such as "earthquakes," "fires," "typhoons," and "floods" that dealt a blow to social infrastructure, but now the threat of "cyberattacks" and "system replacements" have been added to this list.

まずは、これを義務教育過程で教える必要があると思います。

First, I think this must be taught in compulsory education.

あるいは、やれることはやって、それでも壊れる時には壊れるという『諦観』をするしかない、とも言えます ―― システム障害も自然災害も。

2023,江端さんの技術メモ

今の我が家は、アクセスポイント5、無線ネットワーク2、 有線ネットワーク1(ハブ区分で勘定であれば、10は軽く超える)という、IPネットワークのテストフィールドです。最近、ここにカメラ3台・・・いや、業務用と監視用を入れれば7台か。もうめちゃくちゃです。

そんでもって、できるだけ設定を変更せずに、システムを騙しながら、新しい実験システムを追加するのは、なかなかトリッキーな技が必要となります。

まあ、愚痴はさておき。

今、私の目の前には、設定をすっかり忘れた、TP-LINK / Archer C2300

ここを、細い棒で、10秒以上押し続ける。こうすると、

黄色のポートの方が、192.168.0.1/255.255.255.0が設定されるので、ブラウザから192.168.0.1を入力して、設定画面を出すことができる。

パスワードもリセットさせているので、再設定する必要がある。

現在の設定は、インターネットのポートに、江端家のメインネット192.168.0.*をDHCPで設定して、黄色のポートの方は、192.168.11.1としておいた(それ以外は何も設定しなかった)。

当然、設定後再起動した C2300 は、Webに表示されなくなるので、パソコンのNICを、192.168.11.10として、ブラウザから、192.168.11.1 で再度アクセスして確認する。

機器の裏面に記載されていた、この内容で無線LANの設定をしたら、192.168.11.* のIPアドレスで接続できることを確認した。

以上。

P.S. もう使う予定のないノートPCでも、こういう設定の時にはとても役に立つ(機器と直結すれば、他のネットワークの影響なく設定できるから)

江端家ネットワークのの192.168.0.*は変更できず、かつ、RTSPカメラのデフォルトIPの192.168.0.2を変更したくなくて、色々苦労しています。


RTSPカメラを接続すると、firefoxが動かなくなるという現象がでてきてこまっていたのですが、これは、デフォルトゲートウェイだな、とあたりをつけて、最小作業で構成変更しました。

cam@cam-desktop:~$ more /etc/netplan/99_config.yaml

 

~
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: false
addresses:
- 192.168.0.15/24
routes:
- to: default
via: 192.168.0.1
nameservers:
addresses: [192.168.0.1,8.8.8.8]
enx70886b8c8268:
dhcp4: false
addresses:
- 192.168.1.15/24

を、

network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: false
addresses:
- 192.168.0.15/24
enx70886b8c8268:
dhcp4: false
addresses:
- 192.168.1.15/24

wlan0:
dhcp4: false
addresses:
- 192.168.11.15/24
routes:
- to: default
via: 192.168.11.1
nameservers:
addresses: [192.168.11.1,8.8.8.8]

と変更しました。(8.8.8.8は多分不要です)。無線LANも192.168.1.15で固定しました。

$ sudo netplan apply

で設定を有効にします(エラーの場合、エラーの内容が表示されます)。

 

なお、上記はタブ(空白?)位置が崩れているので、設定する方は十分にタブ(空白?)位置を意識して変更してください。

これで、安定して起動する(?)と思います。
(嘘です。毎日安定して動きません。上記の内容毎日変わっています)


カメラの設定を変えたい時に、こういう手動の技が使えるようです。

192.168.0.2  admin/jvc でアクセスできます。


ところで、ブリッジモードにする場合、何もすることがありません(というか、"できません")

あたりまえなんですけどね、ブリッジモードとは、一言で言うと「ハブ」です。

ですので、装置にIPアドレスの付与なんで必要ないんですよね ―― なんでIPアドレスを設定できないのかで、たっぷり30分は悩んだ。ーーー 私はバカか。ハブにアドレス設定できるかアホ。

ここに結線すると、そのセグメント(e.g 192.168.11.0/255.255.248.0)が、黄色い有線ポートと無線LANに、そのまま拡張されるから。

ちなみに、DHCPとかその他の設定も、ベースとなるセグメントのネットワークの設定に従うだけだから、何もできません。