底辺

ゑ?

エンジニアとして世界の最前線で働く選択肢 2024/1/24 読了

読みました。

IT界の名だたる大企業・スタートアップのひしめく米国で、エンジニアとして働くことに興味がある人向けの本です。米国企業に就職するためにはどうしたら良いのか、実際に米国企業で働くとはどういう感じか、等がまとめてあります。著者は現在MicrosoftでSenior SWEとして活躍されている竜盛博氏です。

 

自分は普段から海外企業を視野に入れて情報収集しているため、自分としては知っている内容が多かったです

ただ、これだけ海外(米国)で働きたいエンジニア向けとして情報がまとまっている資料は貴重な気がします。

自分としても改めて実際に海外で長く活躍されている方からの情報として確認になったのと、目新しい情報もぽろぽろ有り、参考になりました

また、リアルな経験が語られるコラムはとても面白かったです(外国人の同僚と仲良くなる方法、初めてシリコンバレーの会社を受けた時の経験、レイオフされた時の経験、等)

米国に合う人合わない人いること、米国就職のメリットばかりでなくデメリットにも焦点が当てられており、なるべくフラットな目線で語られているところも良いと思いました。

 

200ページくらいの分量ですが数時間あれば読めます

これから情報を集め始めるエンジニアにも、海外就職の情報をすでに集めているエンジニアにもお勧めします。

新しいシェルプログラミングの教科書 読了 2024/1/21

 

 

最近仕事でもシェルスクリプトを読み書きすることが非常に多くなってきたため、一度しっかりと勉強してみようと思い読んでみた。

結果、最初の1冊として学ぶのにとても良い本のように思う。読み書きともに、早速実務でこの本で得た知識が役立っている。

少なくとも自分の感覚では実務で必要な内容はカバーしているように思われ、最初の1冊として良いと書いたけど、ここに書いてある内容をちゃんとマスターしているなら実務でのシェルスクリプトの読み書きで手が止まることはあまり無い気がする。とりあえずシェルスクリプトの体系的な勉強としては一旦満足した。

しばらくこの本について細かいところ含め復習する。

バイオRE4で学ぶ英会話 Chapter1前半

バイオRE4で学ぶ英会話シリーズ

 

前回:バイオRE4で学ぶ英会話 Chapter0 - 底辺

 

スクリプト使用元:Resident Evil 4 REMAKE Full Transcript

 

Chapter1前半開始します

 

以下、ネタバレを含む

 

 

 

 

 

Chapter1前半

[After a few minutes of wandering around, Leon never finds the policeman.]

Leon: How far could he have gone?

[Along the way he finds a rotting cow corpse, and then a house with light in the windows. Leon decides to go inside. The house seems empty.]

Leon: Anyone home?

[When Leon walks into the back room of the dirty and dilapidated house, he meets a bearded man who appears to be the owner of the house. The man says something in Spanish.]

  • [Along the way he finds a rotting cow corpse, and then a house with light in the windows. Leon decides to go inside. The house seems empty.]
    • a rotting cow corpse:腐敗した牛の死骸
  • [When Leon walks into the back room of the dirty and dilapidated house, he meets a bearded man who appears to be the owner of the house. The man says something in Spanish.]
    • dilapidated:老朽化した

 

Leon: Uh, sorry to barge in like this. (In Spanish) I'm looking for a police officer. Did he come this way?

[The bearded man pays no attention to him and goes over to the stove to put some wood on it. He keeps muttering something to himself in Spanish. Leon looks closely and sees the policeman's badge on the floor. It’s stained in blood. At that moment, a bearded man attacks him from behind with an axe. Leon blocks the blow and throws the man to the floor pulling out his gun. The bearded man breaks his neck as he falls, and he appears to be dead. There are some voices coming from upstairs.]

  • Leon: Uh, sorry to barge in like this. (In Spanish) I'm looking for a police officer. Did he come this way?
    • barge in:押し入る
  • He keeps muttering something to himself in Spanish.
    • mutter:ぶつぶつ言う、つぶやく

 

Leon: This is not good…

[Leon picks up the Hunter's Lodge Key from the bearded man's body and comes to see what he was cooking in his fireplace. The cauldron boils a swamp-colored slurry and gurgles disgustingly.]

Leon: Man, that stinks.

[Leon uses the key to examine the basement of the house. There is clearly something bad going on. There he finds the gory corpse of a policeman. His death was clearly not an easy one. A worried voice comes from the walkie-talkie on his chest. Leon grabs it and answers.]

Leon: I read you! What's your situation!?

[All that comes out of the walkie-talkie is a groan of pain. Leon drops the walkie-talkie.]

  • There he finds the gory corpse of a policeman.
    • gory corpse:血みどろの死体
  • A worried voice comes from the walkie-talkie on his chest. Leon grabs it and answers.
    • walkie-talkie:トランシーバー、無線機
  • Leon: I read you! What's your situation!?
    • I read you.:無線などで相手の声が聞こえてわかっていることを示す決まり文句。

 

Leon: The hell is going on?

[There is a creaking floor from above.]

Leon: What was that?

[The dead bearded man with a broken neck comes down into the basement.]

Leon: No fucking way!

[He immediately opens fire pointing at his head. Ganado dies rather quickly.]

Leon: This just keeps getting worse…

  • [There is a creaking floor from above.]
    • 上階から床がきしむ音が聞こえる。
  • Leon: No fucking way!
    • まさか!
    • レオンの「冗談だろ」系セリフのバリエーション。

 

[He goes up to the attic of the house where he finds several pictures pinned to the wall. Leon locks the attic door. In one of the pictures, he sees a girl who looks like Ashley. Leon puts his finger to the portable transmitter in his ear.]

Leon: Roost, this is Condor One.

[A young girl with glasses answers him.]

Hunnigan: Hunnigan here. What's your sitrep?
Leon: The president's daughter—Baby Eagle. It's likely she's in this village.
Hunnigan: Our intel was correct, then. Well done.
Leon: Need a location on a nearby lake. She may have been taken there.
Hunnigan: Copy that. I'll see what I can find.
Leon: Hurry up. Something's happened to the people here. My escorts are—

  • He goes up to the attic of the house where he finds several pictures pinned to the wall.
    • attic:屋根裏部屋
  • Leon: Roost, this is Condor One.
    • レオンはコードネーム「Condor One」を使い、通信基地「Roost」と通信を試みる
  • Hunnigan: Hunnigan here. What's your sitrep?
    • sitrep:状況報告。situation reportの略。
  • Hunnigan: Our intel was correct, then. Well done.
    • intel:(敵国の軍事機密に関する)情報

 

[He hears footsteps quickly approaching. Someone is breaking through the door to the attic with an axe.]

Leon: Gotta go. Talk later.

[Three villagers enter the room, also obviously ganados.]

Leon: I'll let myself out!

[He jumps out the window and tries to get as far away from the cursed place as possible. His path winds through several dilapidated houses that lead him to the central square of the village, where the locals burn the young policeman on a pole. He screams and writhing in pain. Leon watches it all through binoculars.]

Leon: Holy shit…

  • Leon: Gotta go. Talk later.
    • Gotta go:行かなくては。
      • gotta = have got to
      • 「~しなければならない」の表現として気軽に使えるフレーズであり、ネイティブも多用する。
      • *2
  • Leon: I'll let myself out!
    • 邪魔したな!(自分で出るよ!)
  • His path winds through several dilapidated houses that lead him to the central square of the village, where the locals burn the young policeman on a pole.
    • the locals:地元住民
  • He screams and writhing in pain. Leon watches it all through binoculars.
    • writhe:身もだえする
    • binoculars:双眼鏡

 

[He goes to the central square, trying to be as careful as possible, and kills the inhabitants quietly one by one, but they still manage to find him. He locks himself in one of the houses.]

Leon: Here we go.

[Through the window does he see a distraught ganado wearing a bag mask and carrying a chainsaw walking toward him.]

Leon: You gotta be kidding me.

[Ganados is already setting up ladders to the house.]

Leon: It's my lucky day.

[He tries to barricade himself additionally by moving furniture. Ganados on all sides are doing their best to get in!]

Leon: Oh, nice.


[He begins to fight off the ganados attacking from all sides. To save ammunition he tries to shoot only to stop them, then kicks them with a spin. A full scale battle ensues! The whole village wants Leon dead! He tries not to sit in one place. One of the ganados grabs him and another with a chainsaw runs towards him.]

Leon: You're shitting me!

  • He locks himself in one of the houses.
    • 家の一つに閉じこもる
  • [Through the window does he see a distraught ganado wearing a bag mask and carrying a chainsaw walking toward him.]
    • distraught:取り乱した、錯乱した、狂気の
  • Leon: You gotta be kidding me.
  •  
  • [He checks his ammo supply and finds a shotgun hanging on the wall on the second floor of the house.]
    • ammo supply:弾薬
  • A full scale battle ensues!
    • 全面戦争が始まる!
  • He tries not to sit in one place.
    • 一か所に留まらないようにする
  • Leon: You're shitting me!

 

[He manages to break free of his grip and shoot the ganado with the chainsaw. He continues to fight killing the ganados one by one, but they don't seem to end.]

Leon: You've gotta be kidding me!

[He throws down the ladder with a ganado climbing it with a leg kick.]

Leon: Oh, sorry!

[After some time of fierce fighting, the sound of the bell from the central tower in the square is heard. The ganados instantly cease their interest in Leon and disperse to their homes. They whisper something in Spanish, dropping their weapons.]

Leon: Huh?

[The village is completely empty.]


Leon: Where's everyone going? Bingo?

  • The ganados instantly cease their interest in Leon and disperse to their homes.
    • disperse:(群衆などを)追い散らす、解散する
  • Leon: Where's everyone going? Bingo?
    • みんなどこに行くんだ?ビンゴ?

 

Chapter1後半へ続く...

直近で他にやりたいことが多いため次の更新はしばらく先かも

 

(おまけ)

参考文献のリンクは脚注にしたかったけど出来る条件がわからん。出来たり出来んかったりする

バイオRE4で学ぶ英会話 Chapter0

バイオハザードRE4というゲームがあります。

www.residentevil.com

 

自分はリメイク前のオリジナル版からバイオ4が大好きで、バイオハザードはナンバリングタイトルはほとんどの作品やったけど最もプレイしたのが4。

で、バイオをプレイするときは英語音声でやりたいというこだわりがあるのだけど 意味があまりわからなかったセリフもそこそこあるわけですよ

なので、改めてその英語音声に注目し、そこからリアルな(?)英語を学んでやろうという試みをやります。

自分の学びを中心にメモ程度のものを載せていくくらいのつもりで、全セリフに触れるわけではなく学びのあるものをピックアップしていきます。

1Chapterずつ記事にまとめていく予定ですが多かったら分割します。

全Chapter(16個)やるかはこれをやっていて楽しいか次第ですけど、まぁゆっくりやっていければ良いなと...(先は長い)。今のところは楽しいです

 

ちなみに、このような試みをインターネット上で行うにあたり、カプコンガイドラインを探すと動画投稿については見つかりました。

今回は動画ではなくブログですけど、たぶんこれには抵触しないと思うので、ゲーム内で撮ったスクショも随時使っていきます(もし怒られたら記事消す、)

カプコン動画ガイドライン(個人向け) | カプコン 製品・サービス情報 | CAPCOM

 

また、スクリプトは以下のサイトからお借りしました。

Resident Evil 4 REMAKE Full Transcript

以下のDisclaimerにあるとおり英語学習者のために非営利で運営されているものらしいです。使って良いかメールで聞いたら快諾してくれました

ありがたや

Disclaimer

This blog exists for informational and educational purposes only and is not for commercial gain. My main goal is to help people. This includes quoting accurately in context; researching texts; learning English; helping people who do not speak English learn the plot; helping people with disabilities understand their games and so on. The texts are manually transcribed from video walkthroughs publicly available on YouTube. All rights belong to their legitimate and respected owners. If you would like me to remove any of the texts, email me.

 

前置きはこのくらいにして、一応バイオ4とはこんな話です。(バイオ4を知らない人がこの記事を読むかわからないけど)

公式から引用したあらすじ

未曽有の生物災害“ラクーン事件”から 6年―。
事件を生き延びた、レオン・S・ケネディ
その能力を買われ、大統領直属のエージェントとなっていた。

任務を重ね、経験をつんだレオンのもとへ舞い込む誘拐された大統領令嬢の救出任務。
彼女の消息を追って ヨーロッパの閑村へと向かったレオン
そこで目にしたのは 狂気を湛えた村人たちだった。

いま 過酷な救出劇(サバイバルホラー)の幕が上がる―。

 

ということで始めます。

今回の記事ではChapter1に入る前の主人公レオンの語り~村へ向かう車内の会話をChapter0として、対象とします。

 

 

以下、ネタバレを含む

 

 

Chapter0

Leon: (offscreen) September 30, 1998… It's a day I'll never forget. The cop inside me died that day. And that night, Raccoon City was wiped out. Thanks to the bioweapons created by Umbrella. Somehow, I made it out. But too many others...weren't so lucky. I was "asked" later to join a top-secret government program. Not that I had a choice. The training, the punishing missions nearly killed me. But at least they kept my mind off everything. If I could just forget what happened that night, the pain—even for a second. This time, it can be different. It has to.

  • wiped out
    • 全滅した、殲滅された、破壊された
  • make it out
    • ある経験(通常、危険なこと)を生き抜く
  • The training, the punishing missions nearly killed me.
    • 訓練と過酷な任務がとても厳しく、ほとんど命にかかわるほどだった。
    • punishing:へとへとに疲れさせる、過酷な
  • But at least they kept my mind off everything.
    • しかし、少なくとも(それらは)他の全てのことから心を逸らすことができた。
  • If I could just forget what happened that night, the pain—even for a second.
    • もし、あの夜に起きたことやその痛みを一瞬でも忘れることができたら。
  • This time, it can be different. It has to.
    • 今回は、違うことができるはずだ。そうならなければならない。

 

[Nighttime. Leon rides in the car with his head propped up by his arm, along with two policemen. He has an indifferent expression on his face. He pulls out a picture of Ashley, the girl he needs to find.]
Old Policeman: So, tell me, Yanqui (Yankee)… why did you come to this horrible place? As close to nowhere that I've ever seen? (laughs)
Leon: Let's just say—looking for someone.
  • prop up
    • 支える(support by placing against something solid or rigid)
  • indifferent
    • 無関心な
  • Old Policeman: So, tell me, Yanqui (Yankee)… why did you come to this horrible place? As close to nowhere that I've ever seen? (laughs)
    • 教えてくれ、ヤンキー...なぜこんなひどい場所に来たんだ?今まで見たこともないような場所に?
    • Yanqui(Yankee):アメリカ北部出身者を指すことが多い
  • Leon: Let's just say—looking for someone.
    • とりあえず、誰かを探しているということにしよう。
    • Let's just say:「とりあえず~と言っておこう」という詳細を話すつもりがない時に使える表現。

 

Old Policeman: That someone must be very important, eh? The chief gave the orders himself. "Help him," he said.
Leon: Well, I'm sure you boys didn't come all the way out here to roast marshmallows. (Old Policeman laughs) ...Or maybe you did.
Old Policeman: You have a strange sense of humor. I'm gonna let you in on a little secret. Just between us. A lot of people have gone missing around here. And it's been that way for a while now.
Leon: Well, then...should be just another day in the office, right?
Old Policeman: I mean, last week there was a search for some missing hikers. (laughs)
Leon: I'm sure you'll do your best to help me…

  • Leon: Well, I'm sure you boys didn't come all the way out here to roast marshmallows. ...Or maybe you did.
    • まぁ、君たちがわざわざここまで来たのは、マシュマロを焼くためじゃないだろうな。…まぁ、そうかもしれないが。
  • Leon: Well, then...should be just another day in the office, right?
    • なら、オフィスでの普通の日だろうな。

 

[The police car pulls up to a village lost in the woods.]

Young Policeman: I think this is it.
Old Policeman: Nature calls, eh? I'll be right back.

[He gets out of the car and walks toward the woods.]

Old Policeman: (In Spanish) Freezing out here.
Young Policeman: (In Spanish) You drink the whole bar?
Old Policeman: Tssshhr.

[The young policeman takes a pack of cigarettes out of his pocket.]

Young Policeman: You smoke?


[He offers a cigarette to Leon, but he just waves. He stares into the night forest. Meanwhile, the policeman stands back and unzips his fly.]

  • pull up: 車が停まる
  • He offers a cigarette to Leon, but he just waves. :レオンは手で振り払ってタバコが要らないことを示す。
  • fly:(ズボンの前の)前開き

 

Old Policeman: (In Spanish) This is one hell of a gloomy place.

[He notices someone nearby.]

Old Policeman: (In Spanish) Hey? Anyone there?

[He goes in the direction of the sound he hears to check it out. Meanwhile, the young policeman in the car, waiting for his partner, turns on the radio, which emits only a crackling sound.]

Young Policeman: He sure is taking his time. Did he fall in? Maybe you better go and take a look?

[Leon gets out of the car in silence.]

Young Policeman: I'll watch the car. Wouldn't want to get a parking ticket.
Leon: So much for helping me.

[He goes deeper into the night forest where an abandoned village is located.]

  • crackling:ぱちぱちと音を立てること
  • Leon: So much for helping me.
    • 「助けてくれると言ったって、これだけか」レオンっぽいセリフ。

 

Chapter1に続く...

dockerコンテナ内で非rootユーザを使用する

dockerコンテナはデフォルトではrootで実行される。

そのため、コンテナ内でファイル生成したりすると、ホスト側の非rootユーザから削除できないなどの問題が起こる。

そもそもrootが必要無いのなら、dockerコンテナ内のユーザは非rootにしておいたほうが良い。

(ちなみに、macではこのファイルのパーミッション問題は起きない。)

 
 
Dockerfile
FROM hoge:1.0.0
 
# ビルド引数としてUIDを受け取る
ARG USER_UID
 
# 必要な設定等
RUN apt update -y
 
 
# コンテナ用の非rootユーザーを作成
RUN useradd -u $USER_UID myuser
USER myuser
 
WORKDIR /work
Dockerfileではコンテナ用の非rootユーザを作成し、そのユーザでコンテナ実行されるようにすればよい。ビルド引数としてuidを受け取れるようにしておく。
 
docker-compose.yml
hoge-service:
    container_name: hoge
    build:
        context: ..
        dockerfile: ./docker/Dockerfile
        args:
            USER_UID: ${USER_UID}
    volumes:
        - ..:/work
USER_UIDをuidとしてビルド引数に設定
 
# コンテナ起動前の下準備等
 
# imageのビルドが発生する時用。
# コンテナ内のユーザのUIDをホストマシンと合わせることで
# コンテナ・ホストマシン間でのpermission問題に対処
USER_UID=$(id -u)
export USER_UID
 
# コンテナを起動し、コンテナ内でなんらかの処理
cd "${work_dir}"/docker
docker-compose run —rm hoge-service /bin/bash -c “hoge/fuga.sh $num”
 
# コンテナ実行後の後処理等
 
 

imageのビルド時にコンテナ内のユーザのUIDが決まるので、ビルドされたimage自体のポータビリティは低下する。

しかし、imageを複数のマシンで使用したい場合は、コンテナを実行したいマシン上でimageをビルドすれば良い。

上記に示した例で、ローカルのmacLinuxサーバ両方でコンテナが問題なく動作し非root権限でもコンテナ内で生成したファイルを削除できることを確認済み

ある日突然現れるGPGエラーを解消する

2023/12/15

ある日突然airflowのdocker imageをベースイメージに使用しているリポジトリのCIが通らなくなった

https://hub.docker.com/r/apache/airflow/tags

 

...
 
14:00:24 [91m+ apt-get -y update
14:00:24 [0mGet:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
14:00:24 Get:2 http://repo.mysql.com/apt/debian bullseye InRelease [17.9 kB]
14:00:24 Get:3 http://deb.debian.org/debian-security bullseye-security InRelease [48.4 kB]
14:00:24 Get:4 http://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]
14:00:24 Err:2 http://repo.mysql.com/apt/debian bullseye InRelease
14:00:24 The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B7B3B788A8D3785C
14:00:24 Get:5 https://packages.microsoft.com/debian/11/prod bullseye InRelease [3649 B]
14:00:25 Get:6 http://deb.debian.org/debian bullseye/main amd64 Packages [8062 kB]
14:00:25 Get:7 http://deb.debian.org/debian-security bullseye-security/main amd64 Packages [260 kB]
14:00:25 Get:8 http://deb.debian.org/debian bullseye-updates/main amd64 Packages [17.7 kB]
14:00:25 Get:9 https://packages.microsoft.com/debian/11/prod bullseye/main armhf Packages [24.9 kB]
14:00:26 Get:10 https://packages.microsoft.com/debian/11/prod bullseye/main all Packages [1214 B]
14:00:26 Get:11 https://packages.microsoft.com/debian/11/prod bullseye/main arm64 Packages [27.5 kB]
14:00:26 Get:12 https://packages.microsoft.com/debian/11/prod bullseye/main amd64 Packages [131 kB]
14:00:26 Get:13 https://apt.postgresql.org/pub/repos/apt bullseye-pgdg InRelease [123 kB]
14:00:26 Get:14 https://apt.postgresql.org/pub/repos/apt bullseye-pgdg/main amd64 Packages [305 kB]
14:00:28 Reading package lists...
14:00:28 [91mW: GPG error: http://repo.mysql.com/apt/debian bullseye InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B7B3B788A8D3785C
14:00:28 E: The repository 'http://repo.mysql.com/apt/debian bullseye InRelease' is not signed.
 
...

 

↑のように、GPGエラーが出ている。

そもそもこのエラーが何かというと、リポジトリの正当性を証明するためのGPGキー(公開鍵)が無効になっているというもの。

今回で言うと、mysqlリポジトリのGPGキーが無効になっている。

なぜいきなりこんなことが起きるかというと、mysql側がリポジトリのキーを(いきなり?)更新したけど、airflowのイメージにはそれが反映されていないため。

なのでとりあえずairflowのissueを確認してみる。

→ドンピシャのissueが立っている。

 

github.com

内容を読むと、やはり12/14でmysqlのrepoのGPGキーがexpireしているとのこと。
で、aiflowメンテナの人がimageの更新をしてくれるらしい。
少し待つと、imageを更新してくれていたので、こちら側で再度imageをpullすることで、解決。
再び問題無くCIは通るようになった。
 
(おまけ)
mysqlチームがこんなことをしたせいで対応する羽目になったairflowのメンテナの方はブチギレていた

https://github.com/apache/airflow/issues/36231#issuecomment-1858714018

 

HHKBキーボード掃除

冬休みを機にHHKBの掃除をした

キーの合間にけっこうゴミが入る。。

 

これを使ってキーを外す

 

掃除前の画像はキー裏にホコリや髪の毛がたくさん入り込んでて汚いので自粛。

 

掃除後

完全に綺麗にするのは難しかったけど、綿棒やらウェットティッシュやら使ってある程度は綺麗に出来て満足した。

 

キー自体も拭きながら戻しておわり。

ちなみにスペースキーだけ逆向きに付けてるのはわざと(打ちやすい気がする)