2017年10月25日水曜日

「もう一度Windowsへのサインインを求めるまでの時間」が 変更できない

以下のように、Windows 10で[設定]→[アカウント]→[サインインオプション]を開いた時に、[サインインを求める」の「しばらく操作しなかった場合に、「もう一度Windowsへのサインインを求めるまでの時間」が 変更できなくなっていることがあります。
 
これは、Surface Pro 3に「Surface Pro 3/4向けの指紋センサー付きタイプカバー」を取り付けている場合の画面です。このキーボードは以下で紹介されています。
指紋センサー付きのSurface Pro 4タイプカバーが国内販売
https://pc.watch.impress.co.jp/docs/news/747161.html
この下にある「指紋認証」を「削除」すると以下のように、時間を選ぶことができるようになります。
このような関係があるのは不思議です。また、時間を指定したい場合、どのようにすればいいのかわからないユーザーインターフェースはいまいちです。

MacOSとWindows 10で、アプリケーションをキー操作で起動する

MacOSでDockに入れていないアプリケーションを起動するには、
  1. ファインダーでアプリケーションフォルダを開く
  2. その中からアプリケーションを見つけてクリック
という手順が必要です。当たり前の手順ですが、最近、すこしめんどうになってきました。もう少し簡単にならないかと思って、検索エンジンで探してみると、以下のブログを見つけました。

【Mac】アプリケーションを素早く起動する方法 http://c-through.blogto.jp/archives/22254015.html
引用します。
  1. Spotlight 機能を使います。デフォルトだと 「Control + スペース」キーで Spotlight 検索ウィンドウが開きます。
  2. Spotlight メニューが表示されたら、そこに起動させたいアプリケーションの名前 を打ち込みます。打ち込むとそのアプリケーションが候補に表示されますので、一番上に表示されれば「return」キーですぐアプリケーションを起動できます。
これだと、キー操作だけでアプリケーションを起動することができます。

私は、「Control+スペース」をかな漢字変換のon/offに割り当てているので、このブログにあるように [システム環境設定]→[キーボード]→[ショートカット]から、Spotlightの起動を「Option+スペース」に割り当てています。

Windows 10でもコルタナの機能を使って同じように、キーボード操作でアプリケーションを起動することができます。
コルタナを呼びかけやショートカットですばやく起動できようにしたい!https://forest.watch.impress.co.jp/docs/serial/win10tips/1070835.html
「Windows+C」でコルタナを起動し、そこでアプリケーション名を入れ、returnキーを押すとアプリケーションを起動できます。

最近のOSは細かいところまで作り込まれていて便利です。

FreeBSD 11.1でのmailmanとpostfix

FreeBSD 11.1でpkgを使ってpostfixとmailmanを入れると、以下のようなエラーになります。
Mailman mail-wrapper: Group mismatch error.  Mailman expected the mail wrapper script to be executed as group "mailnull", but the system's mail server executed the mail script as group "mailman".  Try tweaking the mail server to run the script as group "mailnull", or re-run configure,  providing the command line option `--with-mail-gid=mailman'.
調べるとportsでconfigを指定してmailmanを作る必要があるようです。
# /usr/ports/japanese/mailman
# make config

「(*) POSTFIX   for use  with postfix」を有効にする

# make 

# make reinstall
make resinstallの前に、念のために
/usr/local/mailman/Mailman/mm_cfg.py
を別名で保存しておくほうがよいでしょう。

これでテストすると動くように見えます。なので、maimanをpkgでアップデートしてしまうのを防ぐために以下のようにロックします。

$ pkg info -x mailman
ja-mailman-2.1.14.j7_2,1
$ pkg info -I ja-mailman
ja-mailman-2.1.14.j7_2,1       Japanized mailman which is a mailing list manager with a web front-end
$ sudo pkg lock ja-mailman
パスワード:
ja-mailman-2.1.14.j7_2,1: lock this package? [y/N]: y
Locking ja-mailman-2.1.14.j7_2,1
$ pkg lock -l
Currently locked packages:
ja-mailman-2.1.14.j7_2,1
$

旅先でマルチディスプレイ

私が旅行をする場合、ほとんどが出張です。その場合、宿泊先でPCを使った仕事をすることが多いのですが、会社や自宅とは違って、ディスプレイが手元のノートPCの画面だけになってしまい、作業が効率がいまいちに感じます。

同じようなことを考える人は多いらしく、以下のブログではなかなか大胆なことをされています。
山田祥平のRe:config.sys
モバイルディスプレイ、定義がダメなら定理でいこう
山田 祥平 2017年1月6日 00:00
https://pc.watch.impress.co.jp/docs/column/config/1037805.html
以下のように書かれています。
製品は、LGの「24MP88HV-S」という製品で、特にモバイル用途をアピールした製品ではないが、本体のみで2.9kg、取り外しができるスタンドが300gという圧倒的な軽さ、そして、狭額縁を気に入って導入したものだ。メーカー側は想定していないだろうけれど、驚異的なモビリティを感じる製品だ。スタンドを取り外せるし、そのスタンドも2パーツに分解できて余分なスペースを占有しないというのもいい。年末の座談会で、2.9kg、スーツケースに入るからこれはモバイルディスプレイだと言い張ったのが裏目に出たのかもしれない……。
「長期の旅行のときには…」と一瞬思いましたが、3kgほどの重さと破損の可能性を考えるとちょっとむりです。

このディスプレイが壊れたときには部屋のTVをモニタにされているようです。
今回は、幸いにもホテルの部屋に設置されていたTVが42型の液晶だった。 …HDMI 1からセットトップボックスからのケーブルを抜き、自分のケーブルを装着してPCまで配線した。こういうこともあろうかと、3mの長尺HDMIケーブルがいつもスーツケース内に入っている。
私もホテルに泊まるときには、このようにしてTVをモニタ代わりにしています。部屋によってはTVの位置が悪く、HDMIケーブルでうまく配線できないときに備えて、
新しい Wireless Display Adapter (ワイヤレス ディスプレイ アダプター)
型番: P3Q-00009
参考価格 (税抜) ¥6,980

https://www.microsoft.com/accessories/ja-jp/products/adapters/wireless-display-adapter-2/p3q-00009
も持っています。文字はやや滲んでしまうことがありますが、WWWページを見るぐらいであれば問題はありません。

旅先でマルチディスプレイが必須なときには、iPadとDuet Displayを使っています。
サブディスプレイアプリ「Duet Display」が進化、iPad Proをペンタブレットとして使用可能にhttps://internet.watch.impress.co.jp/docs/yajiuma/1026880.html
またこのblogではおもしろいツールが紹介されていました。
RZ4のスペックは今となってはかなり遅く感じるが、大画面にいくつものウィンドウを開いて表示させっぱなしにしていればそれもさほど気にならない。それに、メインの作業は、ほかに持ち込んでいる2台PCを使うので問題ない。ちなみに、これら3台のPCは、一組のマウスとキーボードで使えるように、Microsoft Garage Mouse without Bordersというフリーソフトウェアで制御している。
これならば、ノートPCと軽量なタブレットPCを持っていって、このツールを使ってマルチディスプレイもいいかもしれません。紹介されている「Microsoft Garage Mouse without Borders」は以下のWWWページからダウンロードできます。
https://www.microsoft.com/en-us/download/details.aspx?id=35460
もしくは、Windows 10であれば、PCのディスプレイを共有する仕組みがあるので、こちらも使えそうです。
HP PC - Miracast を使用して画面を共有(Windows 10)
https://support.hp.com/jp-ja/document/c05209268

Windows 10マシンが無線ディスプレイになる「接続」アプリを試してみた
https://pc.watch.impress.co.jp/docs/topic/review/752171.html

2017年10月22日日曜日

トイレのタンク内の玉鎖とレバー部分の交換

トイレのタンク内の玉鎖をひっかけるレバー部分が壊れてしまいました。壊れた部分は、以下のブログのページにある写真にあります。
水のトラブル 玉鎖がきれた
http://blog.livedoor.jp/akibaranger/archives/50771451.html
1枚目の写真の上の部分にある白い部品の、灰色の鎖をひっかける穴が壊れてしまいました。

この写真では鎖はプラスチック製です。しかし、私の方は15年ほど前に設置されたもののせいか金属製です。そのため、数年に一度は腐食で切れてしまうということも起こっていました。そのときは、切れてしまった部分取り除いて、残った部分をひっかけていました。

「白い部品」だけを取り寄せようと思ったのですが、この部品の名称がわかりません。そこで、このブログにあるように、「タンクの型番 排水弁」で検索してみると、同じ部品番号の「HH08008Z」が対応するようです。日本のアマゾンで探してみると販売されており、「対応本体品番」のところに使用している本体の型番がありました。

ここで、型番「HH08008Z」でもう少し探してみると、部品図が見つかりました。
HH08008Z
http://search.toto.jp/scale_cnv/20_HH08008Z.pdf
こわれた部品の番号(HH07047R)がわかったのでこれで探してみると
HH07047R
https://www.onlinejp.net/product/3216
で売られていることがわかりました、部品代と送料を足すと、「HH08008Z」の半額ぐらいです。悩みましたが、納期が謎なので日本のアマゾンで購入しました。

アマゾンのプライム会員なので注文した翌日に届き、付属の指示書に従って取り付けを始めました。最初はレバーだけ交換するつもりだったのですが、既存の部品のようすを確認しようと思い、これらを取り外してみました。すると、パッキンなどがかなり劣化していることがわかり、排水弁全体を交換しました。作業時間は15分ぐらいでした。

結果としては、レバー部分以外も劣化していたので、排水弁全体を購入したほうがよかったようです。

2017年10月20日金曜日

ネットワーク上のディレクトリをマウントする(Windows 10 Fall Creators Update - Bash on Ubuntu on Windows)

Windows 10 Fall Creators UpdateのBash on Ubuntu on Windowsでネットワーク上のファイルを利用できるようになりました。以下に解説がありました。
File System Improvements to the Windows Subsystem for Linux
https://blogs.msdn.microsoft.com/wsl/2017/04/18/file-system-improvements-to-the-windows-subsystem-for-linux/

When you wish to mount a network location, you can of course create a mapped network drive in Windows and mount that as indicated above. However, it's also possible to mount them directly using a UNC path:
$ sudo mount -t drvfs '\\server\share' /mnt/share
試してみました。
surface$ cd /mnt
surface$ ls
c
surface$ sudo mkdir remote
surface$ ls
c  remote
surface$ sudo mount -t drvfs '\\fileserver\folder' /mnt/remote
surface$ cd /mnt/remote
surface$ ls
Doc                    Mail                   memo.txt

surface$
これは便利です。

2017年10月11日水曜日

FreeBSD11+Apache 2.4でLet's Encryptを使いhttpsを有効にする

FreeBSD11+Apache 2.4でLet's Encryptを使いhttpsを有効にしてみました。この作業には以下のWWWページを参考にしました。
FreeBSD 11にて、Apache + SSL(Let's Encrypt) + HTTP/2を動かす。
http://blog.goo.ne.jp/low-electric-mouse/e/912c459b71887d3ca025509f7ea9897b

Let's Encrypt Closed Betaのメモ
http://www.fkimura.com/letsencrypt-a0.html
以下が手順です。まず必要なパッケージをインストールします。
$ sudo pkg install certbot

$
次に証明書を取り込みます。
$ sudo /usr/local/etc/rc.d/apache24 status
パスワード:
apache24 is running as pid 19178.
dandelion$ sudo /usr/local/etc/rc.d/apache24 stop
パスワード:
Stopping apache24.
Waiting for PIDS: 19178.
dandelion$ sudo certbot certonly
パスワード:
Saving debug log to /var/log/letsencrypt/letsencrypt.log

How would you like to authenticate with the ACME CA?
-----------------------------------------------------------------
1: Spin up a temporary webserver (standalone)
2: Place files in webroot directory (webroot)
-----------------------------------------------------------------
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 1
Plugins selected: Authenticator standalone, Installer None
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): admin@example.com

-----------------------------------------------------------------
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.1.1-August-1-2016.pdf. You must agree
in order to register with the ACME server at
https://acme-v01.api.letsencrypt.org/directory
-----------------------------------------------------------------
(A)gree/(C)ancel: A

-----------------------------------------------------------------
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about EFF and
our work to encrypt the web, protect its users and defend digital rights.
-----------------------------------------------------------------
(Y)es/(N)o: N
Please enter in your domain name(s) (comma and/or space separated)  (Enter 'c'
to cancel): www.example.com
Obtaining a new certificate
Performing the following challenges:
tls-sni-01 challenge for www.example.com
Waiting for verification...
Cleaning up challenges

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /usr/local/etc/letsencrypt/live/www.example.com/fullchain.pem
   Your key file has been saved at:
   /usr/local/etc/letsencrypt/live/www.example.com/privkey.pem
   Your cert will expire on 2018-01-08. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot
   again. To non-interactively renew *all* of your certificates, run
   "certbot renew"
 - Your account credentials have been saved in your Certbot
   configuration directory at /usr/local/etc/letsencrypt. You should
   make a secure backup of this folder now. This configuration
   directory will also contain certificates and private keys obtained
   by Certbot so making regular backups of this folder is ideal.
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

$
これをhttpdに読み込むように設定します。最初にhttp.conf。
$ sudo vi http.conf

LoadModule socache_shmcb_module libexec/apache24/mod_socache_shmcb.so
LoadModule ssl_module libexec/apache24/mod_ssl.so


# Secure (SSL/TLS) connections
Include etc/apache24/extra/httpd-ssl.conf


$
次にextra/httpd-ssl.conf。
sudo vi  extra/httpd-ssl.conf

DocumentRoot "/usr/local/www/apache24/data"
ServerName www.example.com:443
ServerAdmin admin@www.example.com

#   SSL Engine Switch:
#   Enable/Disable SSL for this virtual host.
SSLEngine on

SSLCertificateFile "/usr/local/etc/letsencrypt/live/www.example.com/cert.pem"
SSLCertificateKeyFile "/usr/local/etc/letsencrypt/live/www.example.com/privkey.pem"
SSLCertificateChainFile "/usr/local/etc/letsencrypt/live/www.example.com/chain.pem"

$
そしてhttpへのアクセスをhttpsに書き換えてしまうようにします。
$ sudo vi http.conf

LoadModule rewrite_module libexec/apache24/mod_rewrite.so

$ sudo vi Includes/mod_rewrite.conf 

<IfModule mod_rewrite.c>
        RewriteEngine On
        LogLevel alert rewrite:trace3
        RewriteCond %{HTTPS} off
        RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R]
</IfModule>
$
そしてhttpdを再起動して動作を確かめます。

次に、証明書の自動更新を設定します。まずは--dry-runで動作を確認します。
$ sudo  certbot renew --webroot -w /usr/local/www/apache24/data/ --renew-by-default --dry-run
パスワード:
Saving debug log to /var/log/letsencrypt/letsencrypt.log

-----------------------------------------------------------------
Processing /usr/local/etc/letsencrypt/renewal/www.example.com.conf
-----------------------------------------------------------------
Plugins selected: Authenticator webroot, Installer None
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for www.example.com
Using the webroot path /usr/local/www/apache24/data for all unmatched domains.
Waiting for verification...
Cleaning up challenges

-----------------------------------------------------------------
new certificate deployed without reload, fullchain is
/usr/local/etc/letsencrypt/live/www.example.com/fullchain.pem
-----------------------------------------------------------------

-----------------------------------------------------------------
** DRY RUN: simulating 'certbot renew' close to cert expiry
**          (The test certificates below have not been saved.)

Congratulations, all renewals succeeded. The following certs have been renewed:
  /usr/local/etc/letsencrypt/live/www.example.com/fullchain.pem (success)
** DRY RUN: simulating 'certbot renew' close to cert expiry
**          (The test certificates above have not been saved.)
-----------------------------------------------------------------

IMPORTANT NOTES:
 - Your account credentials have been saved in your Certbot
   configuration directory at /usr/local/etc/letsencrypt. You should
   make a secure backup of this folder now. This configuration
   directory will also contain certificates and private keys obtained
   by Certbot so making regular backups of this folder is ideal.
次に実際に証明書を更新してみます。
$ sudo certbot renew --webroot -w /usr/local/www/apache24/data/ --renew-by-default
パスワード:
Saving debug log to /var/log/letsencrypt/letsencrypt.log

-----------------------------------------------------------------
Processing /usr/local/etc/letsencrypt/renewal/www.example.com.conf
-----------------------------------------------------------------
Plugins selected: Authenticator webroot, Installer None
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for www.example.com
Using the webroot path /usr/local/www/apache24/data for all unmatched domains.
Waiting for verification...
Cleaning up challenges

-----------------------------------------------------------------
new certificate deployed without reload, fullchain is
/usr/local/etc/letsencrypt/live/www.example.com/fullchain.pem
-----------------------------------------------------------------

-----------------------------------------------------------------

Congratulations, all renewals succeeded. The following certs have been renewed:
  /usr/local/etc/letsencrypt/live/blog.iot.ipsj.or.jp/fullchain.pem (success)
-----------------------------------------------------------------
$
証明書のファイルを見ると日付が今日になっています。
$ sudo ls -lR /usr/local/etc/letsencrypt/live/
パスワード:
total 17
drwxr-xr-x  2 root  wheel  7 10月 11 11:11 www.example.com

/usr/local/etc/letsencrypt/live/www.example.com:
total 13
lrwxr-xr-x  1 root  wheel   43 10月 11 11:11 cert.pem -> ../../archive/www.example.com/cert2.pem
lrwxr-xr-x  1 root  wheel   44 10月 11 11:11 chain.pem -> ../../archive/www.example.com/chain2.pem
lrwxr-xr-x  1 root  wheel   48 10月 11 11:11 fullchain.pem -> ../../archive/www.example.com/fullchain2.pem
lrwxr-xr-x  1 root  wheel   46 10月 11 11:11 privkey.pem -> ../../archive/www.example.com/privkey2.pem
-rw-r--r--  1 root  wheel  543 10月 10 16:18 README

$
動作することがわかったので、cronで定期的に、たとえば1日に1回ほど、以下のシェルスクリプトを実行することにします。
$ cat /usr/local/sbin/renew-letsencrypt.sh
#!/bin/sh
export LANG=C

(date;  \
 /usr/local/bin/certbot renew --webroot  -w /usr/local/www/apache24/data/       \
 --renew-by-default ;   \
 /usr/local/etc/rc.d/apache24 reload) 2>&1 |     \
 mailx -s "Renew the certifcate" admin@example.com

$

2017年10月10日火曜日

FreeBSD 11にmailmanをインストールする

FreeBSD 11にmailmanをインストールしたので、その経過を以下にまとめます。
$ pkg install apache24

$ pkg install ja-mailman
apache24が動作するように最低限の設定をしておきます。そしてmailmanの設定です。

まず
/usr/local/mailman/Mailman/cfg_mm.py
に以下を追加します。
SMTPHOST = 'mail.example.com'
DEFAULT_URL_HOST = 'mail.example.com'
DEFAULT_EMAIL_HOST = 'mail.example.com'

add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
このほか、必要に応じて、以下のような設定を追加します。設定できるパラメータは
/usr/local/mailman/Mailman/Defaults.py
記述があります。これは、メーリングリストを作るたびにいつも設定をしていたパラメータで、めんどくさいのでデフォルトの値を変更することにしました。
# What shold happen to non-member posts which are do not match explicit
# non-member actions?
# 0 = Accept
# 1 = Hold
# 2 = Reject
# 3 = Discard
DEFAULT_GENERIC_NONMEMBER_ACTION = 0

# Are archives on or off by default?
DEFAULT_ARCHIVE = No

# Are archives public or private by default?
# 0=public, 1=private
DEFAULT_ARCHIVE_PRIVATE = 1

# Should a list, by default be advertised?  What is the default maximum number
# of explicit recipients allowed?  What is the default maximum message size
# allowed?
DEFAULT_LIST_ADVERTISED = No
DEFAULT_MAX_NUM_RECIPIENTS = 20
DEFAULT_MAX_MESSAGE_SIZE = 100000           # KB

# Private_roster == 0: anyone can see, 1: members only, 2: admin only.
DEFAULT_PRIVATE_ROSTER = 2

# These format strings will be expanded w.r.t. the dictionary for the
# mailing list instance.
# DEFAULT_SUBJECT_PREFIX  = "[%(real_name)s] "
DEFAULT_SUBJECT_PREFIX = "[%(real_name)s %%d]" # for numbering
DEFAULT_MSG_HEADER = ""
DEFAULT_MSG_FOOTER = ""

# See "Bitfield for user options" below; make this a sum of those options, to
# make all new members of lists start with those options flagged.  We assume
# by default that people don't want to receive two copies of posts.  Note
# however that the member moderation flag's initial value is controlled by the
# list's config variable default_member_moderation.
DEFAULT_NEW_MEMBER_OPTIONS = 0

# # Bitfield for user options.  See DEFAULT_NEW_MEMBER_OPTIONS above to set
# defaults for all new lists.
# Digests             = 0 # handled by other mechanism, doesn't need a flag.
# DisableDelivery     = 1 # Obsolete; use set/getDeliveryStatus()
# DontReceiveOwnPosts = 2 # Non-digesters only
# AcknowledgePosts    = 4
# DisableMime         = 8 # Digesters only
# ConcealSubscription = 16
# SuppressPasswordReminder = 32
# ReceiveNonmatchingTopics = 64
# Moderate = 128
# DontReceiveDuplicates = 256

# Mailman can be configured to "munge" Reply-To: headers for any passing
# messages.  One the one hand, there are a lot of good reasons not to munge
# Reply-To: but on the other, people really seem to want this feature.  See
# the help for reply_goes_to_list in the web UI for links discussing the
# issue.
# 0 - Reply-To: not munged
# 1 - Reply-To: set back to the list
# 2 - Reply-To: set to an explicit value (reply_to_address)
DEFAULT_REPLY_GOES_TO_LIST = 1

# Set this variable to Yes to allow list owners to delete their own mailing
# lists.  You may not want to give them this power, in which case, setting
# this variable to No instead requires list removal to be done by the site
# administrator, via the command line script bin/rmlist.
OWNERS_CAN_DELETE_THEIR_OWN_LISTS = Yes
次にWeb UIでアイコンが欠損しているのでこれを補います。「FreeBSD powerd logo」を検索して
/usr/local/mailman/icons/powerlogo.gif
に置きます。この後、Web インターフェース用のパスワードを設定します。
# LANC=C /usr/local/mailman/bin/mmsitepass
パスワード: XXXXX
#
そしてmailman管理用メーリングリストを作ります。
# /usr/local/mailman/bin/newlist mailman
パスワード: XXXX
管理者: system@mail.example.com
mailman用の alias ファイルを作成します。
# /usr/local/mailman/bin/genaliases
(/usr/local/mailman/data/aliasとalias.dbが作成される)
mailman用のファイル・ディレクトリ権限を設定します。 
# /usr/local/mailman/bin/check_perms -f -v
そして次は、apache24の設定です。
$ cd /usr/local/etc/apache24/Includes/
$ vi mailman.conf 


ScriptAlias     /mailman        "/usr/local/mailman/cgi-bin"
Alias           /icons          "/usr/local/mailman/icons"

LoadModule cgid_module libexec/apache24/mod_cgid.so

<Directory "/usr/local/mailman">
        Options +ExecCGI 
        AllowOverride None
        Require all granted
</Directory>

$
cgid.soと+ExecCGIはCGIを有効にするための、 そして「Required all granted」はこのディレクトリへのアクセスを可能にするためのものです。

2017年10月6日金曜日

FreeBSD 11にpkgを使ってwordpressをインストールする

先日、必要があってFreeBSD 11にpkgを使ってwordpressをインストールしたので、その時を記録を以下に示します。

このインストールには以下のWWWページを参照しました。
How to Install WordPress on FreeBSD 11 with Apache, PHP and MySQL
https://linoxide.com/webserver/install-wordpress-freebsd-11-apache-php-mysql/
以下がその記録です。

まずapache24とmqsql56-serverをインストールします。
$ sudo pkg install apache24

$ sudo pkg install mysql56-server


$
これらのサーバーを起動します。
$ sudo sysrc apache24_enable=YES mysql_enable=YES
$ sudo service apache24 start

$ sudo service mysql-server start


$
mysqlにパスワードなどを設定します。
$ sudo mysql_secure_installation

Securing the MySQL server deployment.
Connecting to MySQL server using password in '/root/.mysql_secret'
VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?
Press y|Y for Yes, any other key for No: n
Using existing password for root.
Change the password for root ? ((Press y|Y for Yes, any other key for No) :  n

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y

$ sudo mysql -u root -p
Password: xxxxx
Enter password: yyyyy
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 18
Server version: 5.7.19-log Source distribution
...
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

root@localhost [(none)]> CREATE DATABASE wordpressdb;
Query OK, 1 row affected (0.01 sec)

root@localhost [(none)]> CREATE USER wordpressuser@localhost IDENTIFIED BY 'IotIpsj_2017';
Query OK, 0 rows affected (0.00 sec)

root@localhost [(none)]> GRANT ALL PRIVILEGES ON wordpressdb.* TO 'wordpressuser'@'localhost';
Query OK, 0 rows affected (0.01 sec)

root@localhost [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

root@localhost [(none)]> EXIT;
Bye
$
WordPressとmod_phpをインストールします。これで必要なパッケージはインストールされるはずです。
$ sudo pkg install ja-wordpress

$ sudo pkg install mod_php56
次にPHPの設定ファイルを置きます。
$ sudo cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini
そしてapcheでPHPを取り扱えるようにします。
$ sudo vi /usr/local/etc/apache24/Includes/php.conf

    <IfModule dir_module>
        DirectoryIndex index.php index.html
        <FilesMatch "\.php$">
            SetHandler application/x-httpd-php
        </FilesMatch>
        <FilesMatch "\.phps$">
            SetHandler application/x-httpd-php-source
        </FilesMatch>
    </IfModule>
これらの設定後、インストールしたWordPressのサイトをWWWブラウザで開きます。
$ firefox http://www.example.com/wordpress
そして現れた画面で必要な設定をしていきます。まず[さあ、始めましょう]をクリックして以下の値を設定します。
データベース名: wordpressdb
ユーザー名: wordpressuser
パスワード: xxxx
データベースのホスト名: localhost
テーブル接頭辞: wp_

そして[送信]を押します。すると、うまく書き込めないというエラーメッセージが出たので、画面の指示に従って、設定をviなどで書き込みます。
$ sudo vi wp-config.php

現れた画面をcopy&paste

$ sudo chown www:www wp-config.php
そして、次の画面に進み、またサイトの情報を入力します。
サイトのタイトル: Web Pages
ユーザー名: adminuser
パスワード: xxxxxxx
メールアドレス: abc@example.com
検索エンジンでの表示>   [ ]
これでほぼ終わりです。

最後に、WordPressの管理者でログインしてモジュールを更新します。
すると、FTPの設定をしなければならないという警告が出ます。これは以下のページのように、ファイルの所有者を変更しました。
WordPressのモジュールの更新
http://www.sandalot.com/wordpress%E6%9B%B4%E6%96%B0%E3%81%A7ftp%E5%85%A5%E5%8A%9B%E7%94%BB%E9%9D%A2%E3%81%8C%E8%A1%A8%E7%A4%BA%E3%81%95%E3%82%8C%E3%82%8B%E5%A0%B4%E5%90%88%E3%81%AE%E5%AF%BE%E5%87%A6%E6%B3%95/

プラグインのアップデートなどの際にFTP関連設定を入力しなければいけなくなる場合があります。
『要求されたアクションを実行するには、WordPress が Web サーバーにアク
セスする必要があります。』と出てくるあの画面のことです。
              
chownでWordPressファイルのオーナーを変更する

問題の画面は、スクリプトの実行ユーザーとファイルやフォルダを作成した際のオーナーが異なることにあるそうです。

もう少し具体的には、『wp-admin/includes/file.php』の中で、まず仮のファイルを作成し、そのオーナー(つまりUID)をfileowner()で取得しています。そして、getmyuid()でスクリプト実行者のUIDを取得して、両者を比較します。

それらが同じならそのままダウンロードする、同じでなければFTP情報を入力する画面を表示する、という条件分岐を行なっています。

なので、スクリプト実行者をファイル作成者を合わせるために、以下のようにファイルオーナーを変更します。
       
chown -R apache:apache (WordPressを設置したディレクトリの名称)
以下のようにしました。          
$ cd /usr/local/www/wordpress/
$ sudo chown -R www:www .
$

bcコマンドに行編集機能がある

最近になって、Unixシステムにあるbcという計算コマンドで、行編集や履歴操作ができることを教えてもらいました。しりませんでした。

手元のFreeBSD 11で試してみると、確かに使えます。manにも以下のように書かれています。
COMMAND LINE EDITING
bc supports interactive command line editing, via the editline(3)
library.  It is enabled by default if input is from a tty.  Previous
lines can be recalled and edited with the arrow keys, and other GNU
Emacs-style editing keys may be used as well.
 

The editline(3) library is configured with a .editrc file - refer to
editrc(5) for more information.
知りませんでした。