たまに掃除は必要!熱暴走…

イメージ
 そんなに暑くないのに… 本日、午前中にオンラインで打合せをしていると、突然マシンがダウン。 一瞬、停電か?と思ったもののディスプレイの電源は入っている。 あれっ?と思い、すぐさまノートで打合せを継続。 その間に、再度マシンの電源を投入。 問題なく起動する。 でも、CPU温度がたまたま目に入り、95℃を超えて徐々に上昇していく。 105℃あたりで再度マシンダウン。 これは、熱暴走によるダウンの可能性が高い。 以前、CPUをRyzen7→9にした頃は、60℃〜70℃程度だった記憶がある。 本当はGW中にSSDの載せ替えを行う予定だったけれど、忙しくて先延ばしにしていた。 その時やっていれば、多分掃除もしただろうに…。 ということで、午後からマシンを解体し、掃除をすることに。 ケース本体のFANはホコリがかなり溜まっている。 GPUのFANは問題ない。 電源とCPU FANはひどい。 一旦、CPU FANを取り外し、きれいにする。ついでにCPUグリスも塗り直しセット。 動作確認すると、投入直後で40℃台。 そりゃ、熱暴走も起こすわけだ。 せっかくバラしたので、SSDの載せ替えを実施。 OSは500GBで、ユーザ領域(/home)は1TBを使用しているもののAIのmodelをいくつも落としていたり、DockerのImageが多種置いてあるため、結構容量を食っている。 今回、2TBのSSD( Hanye SSD ¥17,800- で入手済)を用意してあるので、 1TB→2TB, 500GB→1TBと玉突きで移動させることを計画していたので実施する。 本当は、ddコマンドで移すつもりだったのだけれど、3月にお客さんのところで使いそうだったので、 ORICOのクローン機能付SSDアダプタ を入手済。 裸族のSSD版ですね…。1万円程度の品です。 これに、新品のSSDとこれまでの1TBのSSDを差し込んでクローン開始。 そこそこ時間はかかるものの、放置でOK。 ただ、HanyeのSSDについているヒートシンクが引っかかるため、一旦取り外してクローン後取り付ける必要があった。 続いて、500GB→先程の1TBに書き込み。 ただ、1TB(samsungの980pro)が、先程のクローンでかなり熱くなっていたため、速度低下が激しい感じ。1TB→2TBよりも時間がかかった感じ。 ...

久しぶりで、使い方を忘れてた…(Perl)

Perlでプログラムをガシガシと

昨年納品したプログラムの、追加機能の要求が上がったので、見直しを行っていた。

今回は、DBを使うほど件数が増えそうにもない。
履歴を見て登録されているユーザか、そうでないかを判別するだけなので、ハッシュをファイルに紐付けて、簡易のDBとして使うことにする。

 昔なら、メモリがパンクするんじゃ?とかディスク遅いっすとか思ったりして躊躇するんだろうけど、今どきはドンドンメモリ使っちゃおう!ファイル使っちゃおう!なんて思ったりもする。

さて、前回利用したモジュールは
Jcode;
MIME::Parser;
MIME::WordDecoder;
File::Basename;
File::Path;
Fcntl;
File::Temp;
書き出してみるとこんなにもあった。

でもって、今回新たに Storable;

当然、稼働しているプログラムなので、直接いじるわけにはいかない。
とりあえず、ローカルでテストをする。

ソースを取り出して、修正内容を細かく分割。
それぞれテストして、組み立て…。

と、最初のテストで躓いた。

ローカルの環境が、この春に14.04で準備したNewマシンなので、モジュールが入っていない!

モジュールのインストール

そもそも、最初のuse Jcode;でエラー吐いているし…

ということで、インストールしようとしたが、コマンドを全く思い出せない。
あれれ? どうやら老化と共にやってくるアレか?
# perl -MCPAN -e shell
これが思い出せずに、仕方なくググりました。
いやぁ、外部記憶に入れておいて良かったゎ(泣) というか、内部記憶から消去されている模様。

忘れないように、自分を戒めるために記録しておく。

作業自体は、コマンド入力して完了するのに1分もかからないというのに、思い出そうとした時間の方が長いとは…。

root@X200:~# perl -MCPAN -e shell

CPAN.pm requires configuration, but most of it can be done automatically.
If you answer 'no' below, you will enter an interactive dialog for each
configuration option instead.

Would you like to configure as much as possible automatically? [yes] 

Autoconfigured everything but 'urllist'.

Now you need to choose your CPAN mirror sites.  You can let me
pick mirrors for you, you can select them from a list or you
can enter them by hand.

Would you like me to autoroot@X200:~# perl -MCPAN -e shell

CPAN.pm requires configuration, but most of it can be done automatically.
If you answer 'no' below, you will enter an interactive dialog for each
configuration option instead.

Would you like to configure as much as possible automatically? [yes] 

Autoconfigured everything but 'urllist'.

Now you need to choose your CPAN mirror sites.  You can let me
pick mirrors for you, you can select them from a list or you
can enter them by hand.

Would you like me to automatically choose some CPAN mirror
sites for you? (This means connecting to the Internet) [yes] 
Trying to fetch a mirror list from the Internet
Fetching with LWP:
http://www.perl.org/CPAN/MIRRORED.BY

Looking for CPAN mirrors near you (please be patient)
.......................... done!

New urllist
  http://cpan.develooper.com/
  http://mirrors.gossamer-threads.com/CPAN/
  http://mirror.team-cymru.org/CPAN/

Autoconfiguration complete.

commit: wrote '/home/satoshi/.cpan/CPAN/MyConfig.pm'

You can re-run configuration any time with 'o conf init' in the CPAN shell
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v2.00)
Enter 'h' for help.

cpan[1]> install Jcode
Fetching with LWP:
http://cpan.develooper.com/authors/01mailrc.txt.gz
Reading '/home/satoshi/.cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
Fetching with LWP:
http://cpan.develooper.com/modules/02packages.details.txt.gz
Reading '/home/satoshi/.cpan/sources/modules/02packages.details.txt.gz'
  Database was generated on Tue, 09 Sep 2014 13:53:17 GMT
..............
  New CPAN.pm version (v2.05) available.
  [Currently running version is v2.00]
  You might want to try
    install CPAN
    reload cpan
  to both upgrade CPAN.pm and run the new version without leaving
  the current session.


..............................................................DONE
Fetching with LWP:
http://cpan.develooper.com/modules/03modlist.data.gz
Reading '/home/satoshi/.cpan/sources/modules/03modlist.data.gz'
DONE
Writing /home/satoshi/.cpan/Metadata
Running install for module 'Jcode'
Running make for D/DA/DANKOGAI/Jcode-2.07.tar.gz
Fetching with LWP:
http://cpan.develooper.com/authors/id/D/DA/DANKOGAI/Jcode-2.07.tar.gz
Fetching with LWP:
http://cpan.develooper.com/authors/id/D/DA/DANKOGAI/CHECKSUMS
Checksum for /home/satoshi/.cpan/sources/authors/id/D/DA/DANKOGAI/Jcode-2.07.tar.gz ok
Scanning cache /home/satoshi/.cpan/build for sizes
DONE

  CPAN.pm: Building D/DA/DANKOGAI/Jcode-2.07.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for Jcode
Writing MYMETA.yml and MYMETA.json
cp Jcode/Nihongo.pod blib/lib/Jcode/Nihongo.pod
cp Jcode.pm blib/lib/Jcode.pm
Manifying blib/man3/Jcode::Nihongo.3pm
Manifying blib/man3/Jcode.3pm
  DANKOGAI/Jcode-2.07.tar.gz
  /usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/append.t ... ok     
t/convert.t .. ok     
t/getcode.t .. ok   
t/h2z.t ...... ok   
t/jfold.t .... ok   
t/length.t ... ok   
t/mime.t ..... ok     
t/new.t ...... ok     
t/perl581.t .. ok   
t/regex.t .... ok   
t/tr.t ....... ok     
All tests successful.
Files=11, Tests=244,  1 wallclock secs ( 0.08 usr  0.01 sys +  1.20 cusr  0.02 csys =  1.31 CPU)
Result: PASS
  DANKOGAI/Jcode-2.07.tar.gz
  /usr/bin/make test -- OK
Running make install
Manifying blib/man3/Jcode::Nihongo.3pm
Installing /usr/local/share/perl/5.18.2/Jcode.pm
Installing /usr/local/share/perl/5.18.2/Jcode/Nihongo.pod
Installing /usr/local/man/man3/Jcode::Nihongo.3pm
Installing /usr/local/man/man3/Jcode.3pm
Appending installation info to /usr/local/lib/perl/5.18.2/perllocal.pod
  DANKOGAI/Jcode-2.07.tar.gz
  /usr/bin/make install  -- OK

cpan[2]> Terminal does not support GetHistory.
Lockfile removed.
matically choose some CPAN mirror
sites for you? (This means connecting to the Internet) [yes] 
Trying to fetch a mirror list from the Internet
Fetching with LWP:
http://www.perl.org/CPAN/MIRRORED.BY

Looking for CPAN mirrors near you (please be patient)
.......................... done!

New urllist
  http://cpan.develooper.com/
  http://mirrors.gossamer-threads.com/CPAN/
  http://mirror.team-cymru.org/CPAN/

Autoconfiguration complete.

commit: wrote '/home/satoshi/.cpan/CPAN/MyConfig.pm'

You can re-run configuration any time with 'o conf init' in the CPAN shell
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v2.00)
Enter 'h' for help.

cpan[1]> install Jcode
Fetching with LWP:
http://cpan.develooper.com/authors/01mailrc.txt.gz
Reading '/home/satoshi/.cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
Fetching with LWP:
http://cpan.develooper.com/modules/02packages.details.txt.gz
Reading '/home/satoshi/.cpan/sources/modules/02packages.details.txt.gz'
  Database was generated on Tue, 09 Sep 2014 13:53:17 GMT
..............
  New CPAN.pm version (v2.05) available.
  [Currently running version is v2.00]
  You might want to try
    install CPAN
    reload cpan
  to both upgrade CPAN.pm and run the new version without leaving
  the current session.


..............................................................DONE
Fetching with LWP:
http://cpan.develooper.com/modules/03modlist.data.gz
Reading '/home/satoshi/.cpan/sources/modules/03modlist.data.gz'
DONE
Writing /home/satoshi/.cpan/Metadata
Running install for module 'Jcode'
Running make for D/DA/DANKOGAI/Jcode-2.07.tar.gz
Fetching with LWP:
http://cpan.develooper.com/authors/id/D/DA/DANKOGAI/Jcode-2.07.tar.gz
Fetching with LWP:
http://cpan.develooper.com/authors/id/D/DA/DANKOGAI/CHECKSUMS
Checksum for /home/satoshi/.cpan/sources/authors/id/D/DA/DANKOGAI/Jcode-2.07.tar.gz ok
Scanning cache /home/satoshi/.cpan/build for sizes
DONE

  CPAN.pm: Building D/DA/DANKOGAI/Jcode-2.07.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for Jcode
Writing MYMETA.yml and MYMETA.json
cp Jcode/Nihongo.pod blib/lib/Jcode/Nihongo.pod
cp Jcode.pm blib/lib/Jcode.pm
Manifying blib/man3/Jcode::Nihongo.3pm
Manifying blib/man3/Jcode.3pm
  DANKOGAI/Jcode-2.07.tar.gz
  /usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/append.t ... ok     
t/convert.t .. ok     
t/getcode.t .. ok   
t/h2z.t ...... ok   
t/jfold.t .... ok   
t/length.t ... ok   
t/mime.t ..... ok     
t/new.t ...... ok     
t/perl581.t .. ok   
t/regex.t .... ok   
t/tr.t ....... ok     
All tests successful.
Files=11, Tests=244,  1 wallclock secs ( 0.08 usr  0.01 sys +  1.20 cusr  0.02 csys =  1.31 CPU)
Result: PASS
  DANKOGAI/Jcode-2.07.tar.gz
  /usr/bin/make test -- OK
Running make install
Manifying blib/man3/Jcode::Nihongo.3pm
Installing /usr/local/share/perl/5.18.2/Jcode.pm
Installing /usr/local/share/perl/5.18.2/Jcode/Nihongo.pod
Installing /usr/local/man/man3/Jcode::Nihongo.3pm
Installing /usr/local/man/man3/Jcode.3pm
Appending installation info to /usr/local/lib/perl/5.18.2/perllocal.pod
  DANKOGAI/Jcode-2.07.tar.gz
  /usr/bin/make install  -- OK

cpan[2]> Terminal does not support GetHistory.
Lockfile removed.

はい! 無事作業が終わって、コードは動きましたとさ。

しかし、ちょっと前まで、使っていたはずなのになぁ。
ボケてきたんだろうか?

コメント

このブログの人気の投稿

Ubuntu24.04 でGUIが死んだ

VirtualBoxが異常

MEGAにも弱点があった?