2023,江端さんの忘備録

暗号に関するミステリーというのは面白いです。

It is interesting to have a mystery about cryptography.

でも多くのミステリーは、「暗号」の意味を取り違えていると思います ―― もちろん、著者も読者も分かっていることではありますが。

But I think many mysteries misunderstand the meaning of "code" -- something both authors and readers know, of course.

暗号とは、

A cipher is a message that

(1)全世界に公開される方法でしか運ぶことができないメッセージ

(1) can only be carried in a way that is open to the entire world,

であるにも関わらず、

yet

(2)特定の人物にのみが復号できるメッセージ

(2) can only be decrypted by a specific person.

のことです。

上記(1)の公開メッセージ中に、(2)の復号のヒントが含まれていれば、その暗号はその目的を達成することはできません。

The cipher cannot achieve its purpose if the public message in (1) above contains the decryption hint in (2).

また、その人間の資質(能力)によってのみ解読できるものであるなら、それは特定の人物に向けたメッセージではないので、暗号とは言えません。

Also, if it can only be deciphered by the qualities (abilities) of the person, it is not a cipher because it is not a message to a specific person.

そして、それが誰にも復号できないのであれば、それは「暗号」ですらありません。ただの文字列です。

And if no one can decrypt it, it is not even a "cipher." It is just a string of characters.

つまり、厳密な意味では、小説やドラマや映画で登場する暗号は『暗号ではない』のです。

In other words, in a strict sense, the ciphers that appear in novels, dramas, and movies are not 'ciphers.

-----

YouTubeで、ドラマ「ミステリと言う勿れ」のダイジェストを見ています。

I am watching a digest of the drama "Not to Mention Mystery" on YouTube.

私は、『一緒にドラマ見ている人に、こういう話をするべきではない』し、ましてや、『RAS暗号の原理などを得意気に語るべきではない』ということだけは分かっています。

All I know is that 'I shouldn't talk about these things to people I'm watching drama with,' much less 'I shouldn't talk about the principles of the RAS cipher in a way that I'm good at.

―― ママ友は、暗号を使ってメール通信を行っている

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."

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

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.

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