Top / CentOSにっき

もくじ

Cent OS7 でおえかきマシンを構築するよ. なるべく参考にしたページのアドレスを併記するようにしたいと思いますが, 漏れがあったらごめんなさい.

部品選定

お予算は10万円前後で.

CPUi7-479084w35151LGA1150
i7-4790s65w36480awstat
motherGA-H97-HD3H979028
DDR3x4
PCIe x16 x2
PCIe x4 x1
PCIe x1 x2
PCI x2
SPDIF out
GA-H97-D3HH97
DDR3x4
PCIe x16 x1
PCIe x4 x1
PCIe x1 x2
PCI x3
SPDIF out
GA-Z97X-SLIZ9711556限定数完売
DDR3x4
SPDIF out
PCIe x16 x1
PCIe x8 x1
PCIe x1 x3
PCI x2
GA-Z97X-UD3H Z9715223
memAD3U1600W8G11-2DDR313871
1600 8Gx2
SSDIntel SSD 730 SSDSC2BP240G4R5240G19426
Intel SSD 530 SSDSC2BW240A401240G20352
casecoolmaster横置き8480tsukumo
Elite 361 RC-361-KKN1-JP
幅 150mm x
奥行き 368mm x
高さ 464mm
CPU クーラーの高さ:122mm まで
ビデオカードの長さ:
227mm まで(HDD ケージ搭載時)
312mm まで(HDD ケージ取り外し時)
前部:80mm ファン x 1(オプション)
後部:80mm ファン x 2(オプション)
上部:120mm ファン x 1
(90mm ファン x 1または
80mm ファン x 1 に換装可能)
左側面:120mm ファン x 1
または 90mm ファン x 1または
80mm ファン x 1(オプション)
SilverStone SST-GD10B横置き13912
Grandia SST-GD08B横置き21060
powerSF-500P14FGファンレス11556
500W
cpu coolerCoolMaster Xdream i1172297
CoolMaster Vortex PlusH83.5mm2993
RR-VTPS-28PK-R2
case fanDEEPCOOL Xfan 80 191
case fanDEEPCOOL Xfan 80 191
snd
合計103142

備考(選定基準とか):

selinux

  /etc/sysconfig/selinux

xfce

  yum install epel-release.noarch
  /etc/yum.conf
  group_package_types=default,mandatory
  yum --enablerepo=epel groups install Xfce
  yum groups install "X Window System"
  $ startxfce4

で起動確認

  yum install gdm

ランレベル変更

  $ sudo systemctl set-default graphical.target

theme

  http://xfce-look.org/content/show.php/Win3x?content=169112
  169112-win3x.tar.gz
  /usr/share/themes

にコピー

  settings -> window manager

で変更

  https://www.xfce-look.org/p/1012363/
  https://sourceforge.net/projects/classic95-p/
  /usr/share/icons

にコピー

  settings -> 外観

で変更

ログアウト時にセッションを保存しない

  settings -> セッションと起動

これだけだったか自信がない...

英字配列

  /etc/vconsole.conf
  KEYPAM="us"

wget

  $ sudo yum install wget

vivaldi

  wget https://vivaldi.com/download/Vivaldi_TP3.1.0.162.9-1.x86_64.rpm
  $ sudo yum install lsb

音声が再生されないときは,とりあえず/usr/bin/pulseaudioをKILL. 以下は影響なしでした.

vivaldi --alsa-output-device=hw:1,1 --alsa-fixed-output-sample-rate=44100

sudo ln -s /usr/bin/xfce4-terminal /usr/bin/terminal

しんだとき

  $ ps aux | grep vivaldi | sort | head -n 1 | sed 's/ \+/ /g' | cut -d' ' -f2 

あと,XcreenSaverかなにかを依存関係で追加したけど,忘れてしまいました.. 不足ファイルについては

yum provides "*.so" 

のようにして,提供パッケージを確認.

terminal

  xfce4-terminal
  sudo ln -s /usr/bin/xfce4-terminal /usr/bin/terminal

cifs

動作確認

  sudo mount.cifs \\\\10.0.0.1\\storage \
  /mnt/storage -o user=kosame

オートマウント

  fstab:
  //10.0.0.1/storage /mnt/storage/ cifs username=user,password=*  0 0

unzip

  $ sudo yum install unzip

uim

uimのskkが使いたいのです

yum localinstall で以下をインストール

  uim-1.8.6-6.fc22.x86_64.rpm
  uim-gtk2-1.8.6-6.fc22.x86_64.rpm
  eb-4.4.3-3.fc22.i686.rpm
  libskk-1.0.2-1.fc22.x86_64.rpm
  sudo yum install gtk2*
  sudo yum install gtk3*

ひさしぶりに実施したら以下も必要と言われたけど, rpmforgeのリンクが切れてる...

  libgcroots.so.0

とおもったら,URLをftp->httpに変更したらいけた.

  libgcroots-0.2.38.fc22.x86_64
  uim-skk-1.8.6-6.fc22.x86_64

その他ちゅういじこう

uim設定

settings -> セッションと起動 -> 自動開始アプリケーションで, 以下を追加

  name: uim
  desc: uim
  command:
  /usr/bin/imsettings-switch uim.conf

もひとつ追加

  name: uim-toolbar
  desc: uim-toolbar
  command: /usr/bin/uim-toolbar-gtk

"入力メソッドのスターター"は無効にしておく.

ibus-skk

いつごろからかわからないけど,Vivaldiでuim-skkから日本語の入力ができなくなってしまいました.. (現:1.13.1008.40) しょーがないので,ibus-skkに変更します.

1. ひつようなパッケージのインストール

sudo yum install "Input Methods"

2. 環境変数設定

export GTK_IM_MODULE="ibus"
export XMODIFIERS=@im="ibus"
export QT_IM_MODULE="ibus"

3. デーモンの起動設定

Menu -> 設定 -> セッションと起動 -> 自動開始アプリケーション -> 追加

ibus-daemon -rdx
# --replace
# --daemonize
# --xim (execute ibus XIM server.)

4. 設定 ibus-setup -> 入力メソッド -> 入力メソッドの選択 -> 日本語 ("日本語"の部分にカーソルを合わせたままにしておくと, 右側にkkcなどの候補があらわれる.ちょっとわかりにくかった.)

5.そのほか ibusを起動していると,emacsのskkと,Ctrl-jがコンフリクトするのか, emacsのskkでCtrl-jで確定できなくなった. Ctrl-Mで確定できるけど,めどい..

6.やっぱりSKKが使いたい

sudo yum localinstall libskk-1.0.2-6.fc27.x86_64.rpm
sudo yum localinstall ibus-skk-1.4.2-5.fc26.x86_64.rpm

7.stickyにしたい 参考 https://uwabami.junkhub.org/log/20141025.html

ちょっとパスを修正

/usr/share/libskk/rules/

できた!わーい.

caps->ctrl

settings -> セッションと起動 -> 自動開始アプリケーション で以下を追加

  name: CapsLock2Ctrl
  desc: CapsLock2Ctrl
  command: /usr/bin/setxkbmap -option -option 'ctrl:nocaps'

しかし,上記だとemacsでshiftも押されたみたいになっちゃう(表現しにくい..)& コンソールで有効でないので以下をためしてみる.

  http://lambdalisue.hatenablog.com/entry/2013/09/27/212118
  sudo mkdir -p /usr/share/keymaps
  sudo dumpkeys | head -1 | sudo tee /usr/share/keymaps/Caps2Ctrl.map

以下を追加する

  keycode 58    = Control      # CapsLock act as Ctrl
  ## keycode 29 = Caps_Lock    # Ctrl act as CapsLock
  ## alt_is_meta               # Fix the Alt key
  /etc/systemd/system
  sudo touch caps2ctrl.service
  [Unit]
  Type=simple
  Description=Caps2Ctrl
  After=network.target
  [Service]
  ExecStart=/usr/bin/loadkeys /usr/share/keymaps/Caps2Ctrl.map
  [Install]
  WantedBy=multi-user.target
  http://tire-retire.blogspot.jp/2014/12/centos7rclocal.html

有効化

  # systemctl enable caps2ctrl.service

開始

  # systemctl start caps2ctrl.service

上記に加えて,xでの対応が必要なのですが, ~/.xmodmaprc などを 使用した手法が,どうもうまくいかないのです.. スクリプトの起動はしているようなので,そのあとにuimが起動した際, 設定がちゃらになっていると予想しました.

そこで実験として,自動開始アプリケーションに,uim関連のプロセスが起動しきるのを 待ったあとで,xmodmapを実行するスクリプトを追加してみました.

結果として,期待どおりCapsLock->Ctrlが実現できました.

とりあえず所望のことが実現できたので,あまり考察はしてませんが...

なお,以下のスクリプトの ps で grep した結果の数の確認を, 3より大きいかどうかで判定しているのは,uim関連のプロセスと思われるものがが3つあったからです. (起動後にps aux | grep -i uim で調べただけですが..)

ついでに,GUIログイン直後にCapcLockを連打していると Capsが有効になった瞬間にコマンドが実行されて, ひどい目にあったりします(CapsLockが解除できなくなる..)

以下を作って,Settings -> セッションと起動にスクリプトを登録しました. chmod +x もわすれずに.

http://www.yukun.info/blog/2008/01/shell-script-kill-process.html

  ~/xmodmapAfterUim.sh
  #!/usr/bin/sh
  inter=2 #
  wait=5  #
  while true
  do
    isAliveSev=`ps aux | grep "uim" |
                grep -v grep | wc -l`
    if [ $isAliveSev -gt 3 ]; then
      echo "uim alive"
      xmodmap ~/.xmodmap
      exit
    else
      echo "no uim"
    fi
    sleep $inter
  done

あと,変換もCtrlにする場合(keycode 100)

remove Lock = Caps_Lock
keysym Caps_Lock = Control_L
keycode 100 = Control_R
add Control = Control_L Control_R

emacs

  emacs-24.5.tar.xz
  patch-bgex_20150515_0-emacs-24.5.tar.xz

特に問題なくパッチがあたりました.

  ./configure --prefix=/opt/emacs-25.2 --with-x-toolkit=gtk
  make
  sudo make install

ほそく

  libXaw-devel
  libjpeg-turbo-devel
  libpng-devel
  gifflib-devel
  libtiff-devel
  ncurses-devel

ddskk

make what-where EMACS=/opt/emacs-24.5/bin/emacs-24.5
make install    EMACS=/opt/emacs-24.5/bin/emacs-24.5

w3m

cvs版 -> autoconf

./configure --with-emacs=/opt/emacs-24.5/bin/emacs-24.5
$ ./configure --with-emacs=/opt/emacs-25.2/bin/emacs \
              --with-lispdir=/opt/emacs-25.2/share/emacs/25.2/site-lisp
checking for /opt/emacs-25.2/bin/emacs... /opt/emacs-25.2/bin/emacs
checking what a flavor does /opt/emacs-25.2/bin/emacs have... Emacs 25.2
checking prefix for /opt/emacs-25.2/bin/emacs... /opt/emacs-25.2
checking where lisp files should go... /opt/emacs-25.2/share/emacs/25.2/site-lisp/
checking where icon files should go... $(prefix)/share/emacs/25.2/etc/images/w3m

リポジトリ追加_nux-dextop,rpmforge

 sudo yum localinstall http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
 sudo yum localinstall http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm

optsndout

  $ sudo yum install pulseaudio
  $ sudo yum install alsa-plugins-pulseaudio

mixer

  xfce4-mixer

SPDIFから出力したいと思います. まず,cat /proc/asound/cardsでカード番号を確認

次に,/etc/asound.confに以下を追記.

  pcm.!default {
       type hw
       card 1
       device 0
  }

参考 http://alsa.opensrc.org/DigitalOut

   aplay -L

の出力を眺めるのも楽しいです.

flash install, vlc

http://ufuso.jp/wp/?p=15419

yum -y --enablerepo=rpmforge install flash-plugin

vlc

ツール -> 設定 -> オーディオで,出力モジュール : ALSAオーディオ出力 を選択します. 使用可能な場合,S/PDIFを使用を有効化します. デバイスは,S/PDIFを選択します.

global

  global-6.2.12-4.fc21.x86_64.rpm

mewインストール

sudo yum install autoconf stunnel cvs

どっとこんふぃぎゃー

  ./configure --prefix=/opt/emacs-24.5/                 \
  --with-emacs=/opt/emacs-24.5/bin/emacs                \
  --with-elispdir=/opt/emacs-24.5/share/emacs/site-lisp \
  --with-etcdir=/opt/emacs-24.5/share/emacs/24.5/etc    \
  --localstatedir=/opt/emacs-24.5/var                   \
  --infodir=/opt/emacs-24.5/share/info                  \
  --mandir=/opt/emacs-24.5/share/man

けっか

 ***************************
  Mew configuration results
 ***************************
 
 use emacs             : /opt/emacs-24.5/bin/emacs
 elisp files should go : /opt/emacs-24.5/share/emacs/site-lisp/
 etc files should go   : /opt/emacs-24.5/share/emacs/24.5/etc
 exec files should go  : /opt/emacs-24.5/bin
 info files should go  : /opt/emacs-24.5/share/info
 man files should go   : /opt/emacs-24.5/share/man/man1
 

xclock

  yum install xclock
  xclock -bg gray -fg white -hd white -padding 0 -render -geometry 80x80+1920-0

コマンドでディスプレイをスタンバイにしたい

 http://www.xmisao.com/2014/02/17/how-to-pub-screen-into-standby-on-linux.html
 sleep 2; xset dpms force standby

ターミナルで実行する場合sleepを入れないと,(おそらく)xsetを入力したときの キー入力(RET)に反応してしまって,ディスプレイがOFF->ONとなってしまいました.

ThinkPad USB トラックポイントキーボード

http://www.mazn.net/blog/2012/07/01/778.html

スキャナ(GT-S630)

https://wiki.archlinuxjp.org/index.php/Sane

 sudo yum install xsane xsane-common xsane-gimp
 sudo yum install sane-backends-drivers-scanners

http://download.ebz.epson.net/dsc/search/01/search/searchModule

 iscan-2.30.1-1.usb0.1.ltdl7.x86_64.rpm
 iscan-data-1.36.0-1.noarch.rpm
 esci-interpreter-perfection-v330-0.2.0-1.x86_64.rpm
 $ scanimage -L
 device `epkowa:interpreter:003:007' is a Epson (unknown model) flatbed scanner

モデル名が"unknown model"となっていますが, sudo scanimage -Lしたら正しく表示されました.

 $ sudo scanimage -L
 device `epkowa:interpreter:003:007' is a Epson GT-S630 flatbed scanner

USBを挿抜したところ,一般ユーザーでもモデル名が表示されるようになりました. その状態で'xsane'コマンドを実行したところ,期待通り動作しました.

Intuos 4

Intuos4のホイールは誤爆しやすいわりに使う機会が少ないので無効にします.

# xsetwacom --version
0.23.0
# xsetwacom set "Wacom Intuos4 6x9 pad" AbsWheelDown  "0"
# xsetwacom set "Wacom Intuos4 6x9 pad" AbsWheelUp    "0"
# xsetwacom set "Wacom Intuos4 6x9 pad" AbsWheel2Down "0"
# xsetwacom set "Wacom Intuos4 6x9 pad" AbsWheel2Up   "0"

動作確認して意図通り動作したら,下記で自動化...しようと思ったけど反映されない...

# cat /etc/X11/xorg.conf.d/52-wacom-options.conf 

Section "InputClass"
    Identifier "Wacom Intuos4 6x9 pad options"
    MatchDriver "wacom"
    MatchProduct "pad"
    
    # Setting up buttons
    Option "AbsWheelUp"    "+0 "
    Option "AbsWheelDown"  "+0 "
    Option "AbsWheel2Up"   "+0 "
    Option "AbsWheel2Down" "+0 "
EndSection

特定のUSBデバイスだけ、スリープからの復帰を無効にする

 kosame@mizore /etc/udev/rules.d
 $ cat 80-pm.rules 
 ACTION=="add", SUBSYSTEM=="usb", \
   ATTRS{idVendor}=="045e",       \
   ATTRS{idProduct}=="07b2",      \
   ATTR{power/wakeup}="disabled", \
   RUN+="/bin/sh -c 'echo disabled > /sys$env{DEVPATH}/../../power/wakeup'"

やりたいこと:キーボードでスタンバイから復帰して,マウスでは復帰しない.

(参考)最初にヒットしたのは下記の方法でした.

su -
echo EHC1 > /proc/acpi/wakeup 

この方法だと,コントローラ単位でしか制御できないのでキーボードもマウスも,両方同時に無効になってしまう..

追記: /var/log/messages みたら,以下のメッセージが残ってたので,RUN+... は不要っぽい

Oct 14 23:01:55 mizore systemd-udevd: error opening ATTR{/sys/devices/(中略)/wakeup} for writing:
No such file or directory
Oct 14 23:01:55 mizore systemd-udevd: error opening ATTR{/sys/devices/(中略)/wakeup} for writing:
No such file or directory
Oct 14 23:01:55 mizore systemd-udevd: error opening ATTR{/sys/devices/(中略)/wakeup} for writing:
No such file or directory

→なくても、期待通り動作した.

ショートカット?とか

デフォルトの.bash_profileによって~/binにパスが通っている。

/bin以下にリンクを作っておけば,Alt+F2したときに拾ってくれる

 ~/bin/emacs    -> /opt/emacs-24.5/bin/emacs
 ~/bin/terminal -> /usr/bin/xfce4-terminal

バッテリ充電閾値の設定@x201

おおむね以下のとおり.本家より使い勝手がよい...

http://www.thinkwiki.org/wiki/Tp_smapi

https://github.com/evgeni/tp_smapi

# tar xzvf tp_smapi-0.40.tgz
# cd tp_smapi-0.40

てすと

# make load
# echo 60 > /sys/devices/platform/smapi/BAT0/start_charge_thresh
# echo 70 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh
# echo 60 > /sys/devices/platform/smapi/BAT1/start_charge_thresh
# echo 70 > /sys/devices/platform/smapi/BAT1/stop_charge_thresh

うまくいったので本番

# make install

あとこれも

/etc/modules-load.d/tp_smapi.conf
thinkpad_ec
tp_smapi
yum install sysfsutils
/etc/sysfs.conf
devices/platform/smapi/BAT0/start_charge_thresh = 60
devices/platform/smapi/BAT0/stop_charge_thresh = 75
devices/platform/smapi/BAT1/start_charge_thresh = 60
devices/platform/smapi/BAT1/stop_charge_thresh = 75

X270

https://github.com/teleshoes/tpacpi-bat

modprobeするタイミングで"Required key not available"とでたら, いけないことと思いつつ BIOS->Security->Secure Boot->Secure Boot->Disable とする。

sudo ./install.pl
[kosame@hotaru systemd_fixed_threshold]$ cat /usr/lib/systemd/system/tpacpi.service 
[Unit]
Description=sets battery thresholds

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/tpacpi-bat -s ST 0 60
ExecStart=/usr/bin/tpacpi-bat -s SP 0 75 

[Install]
WantedBy=multi-user.target
[kosame@hotaru ~]$ sudo systemctl enable tpacpi.service
Created symlink from /etc/systemd/system/multi-user.target.wants/tpacpi.service to 
/usr/lib/systemd/system/tpacpi.service.
[kosame@hotaru ~]$ sudo systemctl start tpacpi.service

無線の電源を切る

以下より

gnome-control-center
gnome-bluetooth

plugin

その他

Fedoraにっき

スリープから復帰したときにTrackPointが反応しない@X270

xinput --disable 6 ; xinput --enable 6

TrackPoint

[kosame@hotaru xorg.conf.d]$ ls
0-layout.conf  00-keyboard.conf  20-thinkpad.conf  60-trackpoint.conf
[kosame@hotaru xorg.conf.d]$ cat 0-layout.conf 
Section "ServerLayout"
  Identifier "X270TrackPoint"
  InputDevice "TrackPoint"
EndSection
[kosame@hotaru xorg.conf.d]$ cat 20-thinkpad.conf 
Section "InputClass"
	Identifier	"Trackpoint Wheel Emulation"
	MatchProduct	"TPPS/2 IBM TrackPoint|DualPoint Stick|Synaptics Inc. Composite TouchPad / 
TrackPoint|ThinkPad USB Keyboard with TrackPoint|USB Trackpoint pointing device|Composite TouchPad / 
TrackPoint"
awstat	MatchDevicePath	"/dev/input/event*"
	Option		"EmulateWheel"		"true"
	Option		"EmulateWheelButton"	"2"
	Option		"Emulate3Buttons"	"false"
	Option		"XAxisMapping"		"6 7"
	Option		"YAxisMapping"		"4 5"
EndSection
[kosame@hotaru xorg.conf.d]$ cat 60-trackpoint.conf 
Section "InputDevice"
    Identifier     "TrackPoint"
    Driver         "evdev"
    Option         "Device" "/dev/input/event12"
    Option         "EmulateWheel" "true"
    Option         "EmulateWheelTimeOut" "200"
    Option         "EmulateWheelButton" "2"
    Option         "Emulate3Buttons" "false"
    Option         "XAxisMappint" "6 7"
    Option         "YAxisMappint" "4 5"
EndSection
[kosame@hotaru X11]$ cat xorg.conf
Section "InputClass"
Identifier "Trackpoint Wheel Emulation"
MatchProduct "TPPS/2 IBM TrackPoint|DualPoint Stick|Synaptics Inc. Composite TouchPad / TrackPoint"
MatchDevicePath "/dev/input/event*"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "2"
Option "Emulate3Buttons" "false"
Option "XAxisMapping" "6 7"
Option "YAxisMapping" "4 5"
EndSection

ぷろんぷと

$ echo $PS1
\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$

トラブルシューティング

音声が途切れる

途切れた際に,サスペンドほにゃほにゃというメッセージを残す.

$ aplay -D hw:1,1 01_hoge.wav
再生中 WAVE '01_hoge.wav' : Signed 16 bit Little Endian, レート 44100 Hz, ステレオ
サスペンド中です。レジュームします。失敗しました。ストリームを再スタートします。終了

$ aplay -D hw:1,1 01_hoge.wav
Playing WAVE '01_hoge.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
Suspended. Trying resume. Failed. Restarting stream. Done.

サスペンドモジュールを無効にしてみる.

$ sudo vim /etc/pulse/default.pa
# load-module module-suspend-on-idle

なおった.

Site admin: kam1610, PukiWiki 1.4.7 Copyright © 2001-2006 PukiWiki Developers Team. License is GPL.
Based on "PukiWiki" 1.3 by yu-ji. Powered by PHP 5.2.17.