SVX日記
2004-09-08(Wed) メビウス復活!! 問題解決!!
さて、今日は朝から仕事をサボって松戸のシャープに届いているメビウスのヒンジの部品を取りにいく。今日もSVXはバリバリMaxHeat!! ホントに熱い車……いや、暑い車だぜ。エアコンが勝手にONになる症状が出ないだけマシだが、早く治さなきゃなぁ。途中、暑さに耐えられなくなりエアコンをONにしCool側のボタンを押し続けつつ運転して松戸のシャープに到着。
松戸のシャープは想像と違って事務所だけでなく、流通拠点である倉庫のようなデカい建物であった。入ってスグ横のサービスセンタに入って、おばちゃんに部品を取りに来た旨を告げる。古田を吉田に間違えられており(よくあるんだ)ちょっと手間取ったが、部品は無事到着していた。壊れた部品を持参しているので形状が同じかどうか確認させてもらうと……ちがうじゃんかよッ!! ……じゃなくて、パーツが左右逆なのだ。するとそこへ、先日電話で対応してもらった、さとう玉緒似の声のお姉さんが現れた。
おぉ、声はさとう玉緒似だけど、ルックスは柴咲コウ似ではないか!! などと一瞬違う世界に旅立っているうちに、おばちゃんが伝票を左だけのパーツに修正し始める。……いや、決して柴咲玉緒ちゃん(仮名)にクラッときたわけではないが、両方購入させてもらうことにした。右側のパーツも勤続(7年)疲労が溜まっていそうだし、いざ目の前にあるならやっぱり買いたくなってしまうのである。手持ちがギリギリだったが、片側2,415円、両側で4,830円(税込み)。た、高い……が、このパーツは軸の部分も込みなので、ある程度しかたないか。しかし、玉緒っちのちょっと気の利いた対応はうれしかったなぁ。やるな、シャープ!!
余談だがサービスセンタにいる間、奥のほうで断片的に「HDDの中身が消えたから、新製品に交換するようにいわれてて……訴訟するならそれはお客様の自由ですので……内容証明で送れと……ですから、同型の製品との交換しかできないと……」とか、いう打ち合わせする声が……まさしくクレーマーの話題である。そーだよねー。サービスセンタといえばクレーマーとの戦場でもある。クレーマーまでいかなくても、ヒドいこと言われることが多いんだろうなぁ(そういや、おいらも以前にちょっとキレたことがあったなぁ、チト反省)。
さて、シャープに行ったら他の壊れそうな部品が壊れた時にすぐ電話で注文できるよう、部品番号をカタログでチェックさせてもらうつもりだったので、その旨を聞いてみた。結局MN-7860そのもののカタログはなかったので、似たようなPCの部品図を見ながら指定し、天板とCPUファンの部品番号と価格を調べ、折り返し連絡をもらうことにした。しばらくして電話があり、該当品が判明しましたということで話を聞いてみると……天板は8,100円(税別)……こ、これは以前に9,000円と聞いていたのでダメージは小さかったのだが、ジャカジャンッ!! CPUファンはヒートシンク込みで17,000円(税別)!! ぐわゎ〜ん……私の購入価格15,000円を軽く飛び越すお値段、出てまいましたッ!! 今回のヒンジのパーツでさえ5,000円弱と私にとってはギリギリの線だったので、いざファンが壊れた日には適当なファンを買ってきて(当然治す!!)ムリヤリひっつけることになりそうである。
さて、午後から行った仕事から帰宅して、すぐにメビウスの修理に取り掛かった。まずは、パネルの枠のパーツを外し、ヒンジのカバーを外す。どちらもかなり固くツメで固定されていて、かなりのコツと勇気が必要だ。ヒンジが露出したら、ネジを外して左側のプレートの破損パーツを取り除く。
柴咲玉緒ちゃん(仮名)にくらっときて、右側のプレートも購入してしまった(ん?)ので、右側も交換する。LCDパネルを止めている4本のネジを外し、手前にひっくり返す……と、ゲッ!! 右の雌ネジも左と同じようにポッキリ逝ってる……なんなんだよー、設計強度不足じゃねーのかよコレ。プレートは3箇所で止まるようになっているため、根元の部分に力が集中しやすい反面、残りの2箇所で十分に支持できるというのも確か。適当に接着剤でひっつけておこう、ムダだとは思うけど。
右のプレートは上をバックライトを点灯するインバータの高圧線が通過するため、保護のプラ板が貼ってあった。剥がして同じように新しいプレートに貼り付けて、取り付ける。後は各カバーをパチパチとハメて、ネジを締めたら、修理完了ッ!! メビウス完全復活である……うれしい……。性能的にはもはやどーしよーもないPCであるが、いろいろ手をかけているのでカワイイヤツである。これからも元気で働いておくれよ。うるうる。
さて、今日はネタが盛りだくさんである。メビウスが治ったところで、メビウスのシリアルポート内の負荷抵抗を調べてみるのである。RS-232Cの規格では3〜7kΩとなっているが、ホントにそうなのか? 調べるためには、以下のような回路をブレッドボード上に構築し、メビウスのシリアルポートに接続、各場所の電圧と流れた電流を測定した。
結果、内部の負荷抵抗5kΩ弱であると推測される。確かに規格の3〜7kΩ内のちょうど中間値である。こう考えると、RS-232Cという通信回路は極めてシンプルな回路であることがわかる。今となってはレガシーなポートではあるが、このシンプルさこそが、今日もシブとく生き残っている理由なのだろう。
で、最後にアナログメータの製作の続きである。テスト基板からPCへの通信はできたのだが、PCからテスト基板への通信がさっぱりできない。そこで原因として閃いたのは「消費電流が多すぎではないか」ということだ。現在、テスト基板はPC側のRTS-CTSからの電圧のみで稼動しているが、もしかすると電流を引き出しすぎていて、PC側の送信電圧を食ってしまっているのではと考えたのだ。とすれば、テスト基板を外部電源で動かせばよいことになる。
2016-09-08(Thu) RubyGems環境をなんとかする
個人的にCUI好きなのだが、GUIが必要な時もある。そんな時はcursesだ。リモートコンソール上でセミGUIが使える。作るのもラクだし、動作も軽快。てなわけで、これまで、これやら、これやら、これやらを作って、実用に供している。
んが、いつしかRubyの標準添付ライブラリにcursesが含まれなくなってしまった。Fedoraのrubygem-xxxシリーズでの提供もない。別途、RubyGemsで入れろ、ということらしい。むぅ。
ところが、たまにしかやらないし、ちょくちょくディストリの仕様側が変わるので、いつも試行錯誤になってしまう。そこで、現時点において、うまいことRubyGemsの環境を構築できた方法を「考え方つきで」メモしておくことにした。目的は「gem install curses」を成功させること。今回はFedora24で実行している。
[root@xxx ~]# gem install curses
-bash: gem: command not found
[root@xxx ~]# dnf install rubygems
[root@xxx ~]# gem install curses
……沈黙
[root@xxx ~]# export http_proxy=http://proxy.example.com:8080/
[root@xxx ~]# export https_proxy=http://proxy.example.com:8080/
[root@xxx ~]# gem install curses
Fetching: curses-1.0.2.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing curses:
ERROR: Failed to build gem native extension.
current directory: /usr/local/share/gems/gems/curses-1.0.2/ext/curses
/usr/bin/ruby -r ./siteconf20160909-3344-15aufht.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h ★
extconf failed, exit code 1
Gem files will remain installed in /usr/local/share/gems/gems/curses-1.0.2 for inspection.
Results logged to /usr/local/lib64/gems/ruby/curses-1.0.2/gem_make.out
[root@xxx ~]# dnf install ruby-devel
[root@xxx ~]# gem install curses
Building native extensions. This could take a while...
ERROR: Error installing curses:
ERROR: Failed to build gem native extension.
current directory: /usr/local/share/gems/gems/curses-1.0.2/ext/curses
/usr/bin/ruby -r ./siteconf20160909-3373-17xujbr.rb extconf.rb
checking for tgetent() in -ltinfo... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
<略>
/usr/share/ruby/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first. ★
from /usr/share/ruby/mkmf.rb:541:in `try_link0'
<略>
from extconf.rb:29:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/usr/local/lib64/gems/ruby/curses-1.0.2/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /usr/local/share/gems/gems/curses-1.0.2 for inspection.
Results logged to /usr/local/lib64/gems/ruby/curses-1.0.2/gem_make.out
[root@xxx ~]# dnf install gcc
[root@xxx ~]# gem install curses
Building native extensions. This could take a while...
ERROR: Error installing curses:
ERROR: Failed to build gem native extension.
current directory: /usr/local/share/gems/gems/curses-1.0.2/ext/curses
/usr/bin/ruby -r ./siteconf20160909-3509-162u4n0.rb extconf.rb
checking for tgetent() in -ltinfo... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
<略>
/usr/share/ruby/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/share/ruby/mkmf.rb:541:in `try_link0'
<略>
from extconf.rb:29:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/usr/local/lib64/gems/ruby/curses-1.0.2/mkmf.log ★
extconf failed, exit code 1
Gem files will remain installed in /usr/local/share/gems/gems/curses-1.0.2 for inspection.
Results logged to /usr/local/lib64/gems/ruby/curses-1.0.2/gem_make.out
[root@xxx ~]# cat /usr/local/lib64/gems/ruby/curses-1.0.2/mkmf.log
"gcc -o conftest -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I. -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -mtune=generic -fPIC conftest.c -L. -L/usr/lib64 -L. -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fstack-protector -rdynamic -Wl,-export-dynamic -m64 -lruby -lpthread -ldl -lcrypt -lm -lc"
gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory ★
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
[root@xxx ~]# dnf provides /usr/lib/rpm/redhat/redhat-hardened-cc1
redhat-rpm-config-40-2.fc24.noarch : Red Hat specific rpm configuration files ★
Repo : fedora
redhat-rpm-config-41-2.fc24.noarch : Red Hat specific rpm configuration files ★
Repo : updates
[root@xxx ~]# dnf install redhat-rpm-config
[root@xxx ~]# gem install curses
Building native extensions. This could take a while...
ERROR: Error installing curses:
ERROR: Failed to build gem native extension.
current directory: /usr/local/share/gems/gems/curses-1.0.2/ext/curses
/usr/bin/ruby -r ./siteconf20160909-3658-cnj5ie.rb extconf.rb
checking for tgetent() in -ltinfo... no
checking for tgetent() in -ltermcap... no
checking for ncurses.h... no
checking for ncurses/curses.h... no
checking for ncursesw/curses.h... no
checking for curses_colr/curses.h... no
checking for curses.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
<略>
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/usr/local/lib64/gems/ruby/curses-1.0.2/mkmf.log ★
extconf failed, exit code 1
Gem files will remain installed in /usr/local/share/gems/gems/curses-1.0.2 for inspection.
Results logged to /usr/local/lib64/gems/ruby/curses-1.0.2/gem_make.out
[root@xxx ~]# cat /usr/local/lib64/gems/ruby/curses-1.0.2/mkmf.log
:
:
have_header: checking for curses.h... -------------------- no
"gcc -E -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I. -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -mtune=generic -fPIC conftest.c -o conftest.i"
conftest.c:3:20: fatal error: curses.h: No such file or directory
#include <curses.h>
^
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <curses.h>
/* end */
--------------------
[root@xxx ~]# dnf install ncurses-devel
[root@xxx ~]# gem install curses
Building native extensions. This could take a while...
ERROR: Error installing curses:
ERROR: Failed to build gem native extension.
current directory: /usr/local/share/gems/gems/curses-1.0.2/ext/curses
/usr/bin/ruby -r ./siteconf20160909-4359-1h9o77p.rb extconf.rb
checking for tgetent() in -ltinfo... yes
checking for ncurses.h... yes
checking for initscr() in -lncursesw... yes
header: ncurses.h
library: ncursesw
<略>
checking for function curses_version in ncurses.h... yes
checking for variable curses_version in ncurses.h... no
creating Makefile
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/usr/local/lib64/gems/ruby/curses-1.0.2/mkmf.log
current directory: /usr/local/share/gems/gems/curses-1.0.2/ext/curses
make "DESTDIR=" clean
sh: make: command not found ★
current directory: /usr/local/share/gems/gems/curses-1.0.2/ext/curses
make "DESTDIR="
sh: make: command not found ★
make failed, exit code 127
Gem files will remain installed in /usr/local/share/gems/gems/curses-1.0.2 for inspection.
Results logged to /usr/local/lib64/gems/ruby/curses-1.0.2/gem_make.out
[root@xxx ~]# dnf install make
[root@xxx ~]# gem install curses
Building native extensions. This could take a while...
Successfully installed curses-1.0.2
Parsing documentation for curses-1.0.2
Installing ri documentation for curses-1.0.2
Done installing documentation for curses after 1 seconds
1 gem installed