2018/11/07

BL17 iMacの画面が点滅

回復方法
SMRのリセット
iMac Pro をお使いの場合は、お使いの Mac に関するセクションまで進んでください。
iMac、Mac mini、Mac Pro、Xserve については、以下の手順でリセットしてください。
Apple メニュー >「システム終了」の順に選択します。
Mac がシステム終了したら、電源コードを外します。
15 秒間待ちます。
電源コードを元通りにつなぎます。
5 秒間待ってから、再び電源ボタンを押して Mac の電源を入れます。
Intel 搭載の Xserve コンピュータが応答しない場合は、ローカルでシステム終了するか、リモートコマンドを使ってシステム終了します。または、電源ボタンを 5 秒間長押しします。

Warning in auth.log

Dec 7 16:46:00 anago sshd[18920]: rexec line 19: Deprecated option KeyRegenerationInterval
Dec 7 16:46:00 anago sshd[18920]: rexec line 20: Deprecated option ServerKeyBits
Dec 7 16:46:00 anago sshd[18920]: rexec line 32: Deprecated option RSAAuthentication
Dec 7 16:46:00 anago sshd[18920]: rexec line 39: Deprecated option RhostsRSAAuthentication

対策
sed -i ‘/KeyRegenerationInterval/d’ /etc/ssh/sshd_config
sed -i ‘/ServerKeyBits/d’ /etc/ssh/sshd_config
sed -i ‘/RSAAuthentication/d’ /etc/ssh/sshd_config
sed -i ‘/RhostsRSAAuthentication/d’ /etc/ssh/sshd_config
And restart SSH daemon: systemctl restart sshd

@anago ~ $ diff /etc/ssh/sshd_config /data-stock4/rsnapshot/hourly.0/anago/etc/ssh/sshd_config
18a19,20
> KeyRegenerationInterval 3600
> ServerKeyBits 1024
29a32
> RSAAuthentication yes
35a39
> RhostsRSAAuthentication no
37a42
> # Uncomment if you don’t trust ~/.ssh/known_hosts for RhostsRSAAuthentication
@anago ~ $

macport update from Sierra to High Sierra

please follow the migration instructions: https://trac.macports.org/wiki/Migration

1. ​Install the latest version of Xcode.
2. run xcode-select –install in Terminal
3. After updating the development tools, install the base MacPorts system.
MacPorts-2.4.2-10.13-HighSierra.pkg
4. port -qv installed > myports.txt
5. port echo requested | cut -d ‘ ‘ -f 1 > requested.txt
6. sudo rm -rf /opt/local/var/macports/build/*
7.

curl –location –remote-name \
https://github.com/macports/macports-contrib/raw/master/restore_ports/restore_ports.tcl
chmod +x restore_ports.tcl
sudo ./restore_ports.tcl myports.txt

8.

sudo port unsetrequested installed
xargs sudo port setrequested < requested.txt

Latex thebibliographyの行間を詰める方法

プリアンブルに以下を挿入
編集中のsame.texのファイルの
\documentclass[11pt,a4j]{jarticle}の直後

\makeatletter
\renewenvironment{thebibliography}[1]
{\section*{\refname\@mkboth{\refname}{\refname}}%
\list{\@biblabel{\@arabic\c@enumiv}}%
{\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
\advance\leftmargin\labelsep
\setlength\itemsep{-0.2zh}% ここの数値を調整(行間)
\setlength\baselineskip{9pt}% ここの数値を調整(文字)
\@openbib@code
\usecounter{enumiv}%
\let\p@enumiv\@empty
\renewcommand\theenumiv{\@arabic\c@enumiv}}%
\sloppy
\clubpenalty4000
\@clubpenalty\clubpenalty
\widowpenalty4000%
\sfcode`\.\@m}
{\def\@noitemerr
{\@latex@warning{Empty `thebibliography’ environment}}%
\endlist}
\makeatother

The error “X11 forwarding request failed on channel 0” in macos Sierra

The error ‘X11 forwarding request failed on channel 0’

  1. Edit /etc/ssh/sshd_config by adding the following lines.
# Tanaka added following 4 lines to delete the error message. 2017/July/7
# X11 forwarding request failed on channel 0
#   "/usr/X11/bin/xauth" or "/opt/X11/bin/xauth"
#
X11Forwarding yes
XauthLocation /opt/X11/bin/xauth
XauthLocation /usr/X11R6/bin/xauth
X11DisplayOffset 10
X11UseLocalhost no

The command

ssh -Y owner@lp.harima.riken.jp

gives no warning, but, once this command described in a shell file, like

-rwxr-xr-x 1 owner staff 35 10 22 2015 ~/bin/lp 

has the following line

ssh -Y owner@lp.harima.riken.jp

then, this shell command gives

Warning: No xauth data; using fake authentication data for X11 forwarding.

This warning goes out if you add

XauthLocation /opt/X11/bin/xauth
XauthLocation /usr/X11R6/bin/xauth

in the file /etc/ssh/ssh_config.