Confluenceでバックスラッシュと円マークの表記を使い分ける(Windows限定)

Confluenceでは通常、バックスラッシュ「\」で表示されるがWindowsのパスのように円マーク「¥」で表記したい場合は「等幅フォント」にするとよい。

Windowsでは円マークで見えているが、Macでは等幅フォントのバックスラッシュなのでほとんど区別がつかない。Macで作業する人は要注意

Ubuntu 18.04になって時計合わせがntpdateからsystemd-timesyncdに変わってたので設定した

まずは現状確認。

$ sudo systemctl -l status systemd-timesyncd
● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2018-07-30 21:09:27 JST; 4h 4min ago
     Docs: man:systemd-timesyncd.service(8)
 Main PID: 586 (systemd-timesyn)
   Status: "Idle."
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/systemd-timesyncd.service
           └─586 /lib/systemd/systemd-timesyncd

 7月 30 23:32:11 arianrhod systemd-timesyncd[586]: Timed out waiting for reply from 91.189.91.157:123 (ntp.ubuntu.com).
 7月 30 23:32:22 arianrhod systemd-timesyncd[586]: Timed out waiting for reply from 91.189.94.4:123 (ntp.ubuntu.com).
 7月 31 00:06:40 arianrhod systemd-timesyncd[586]: Timed out waiting for reply from 91.189.91.157:123 (ntp.ubuntu.com).
 7月 31 00:06:50 arianrhod systemd-timesyncd[586]: Timed out waiting for reply from 91.189.89.199:123 (ntp.ubuntu.com).
 7月 31 00:07:01 arianrhod systemd-timesyncd[586]: Timed out waiting for reply from 91.189.94.4:123 (ntp.ubuntu.com).
 7月 31 00:07:11 arianrhod systemd-timesyncd[586]: Timed out waiting for reply from 91.189.89.198:123 (ntp.ubuntu.com).
 7月 31 00:41:29 arianrhod systemd-timesyncd[586]: Timed out waiting for reply from 91.189.91.157:123 (ntp.ubuntu.com).
 7月 31 00:41:40 arianrhod systemd-timesyncd[586]: Timed out waiting for reply from 91.189.89.199:123 (ntp.ubuntu.com).
 7月 31 00:41:50 arianrhod systemd-timesyncd[586]: Timed out waiting for reply from 91.189.94.4:123 (ntp.ubuntu.com).
 7月 31 00:42:00 arianrhod systemd-timesyncd[586]: Timed out waiting for reply from 91.189.89.198:123 (ntp.ubuntu.com).

なんか外へ行こうとしてるな。
ま、設定してないんだから当然か。

それでは社内のNTPサーバを設定します。

$ sudo vi systemd/timesyncd.conf

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See timesyncd.conf(5) for details.

[Time]
NTP=192.168.1.200
#FallbackNTP=ntp.ubuntu.com
#RootDistanceMaxSec=5
#PollIntervalMinSec=32
#PollIntervalMaxSec=2048

$ sudo systemctl restart systemd-timesyncd

確認確認っと。

$ sudo systemctl -l status systemd-timesyncd
● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2018-07-31 01:17:22 JST; 7h left
     Docs: man:systemd-timesyncd.service(8)
 Main PID: 7288 (systemd-timesyn)
   Status: "Synchronized to time server 192.168.1.200:123 (192.168.1.200)."
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/systemd-timesyncd.service
           └─7288 /lib/systemd/systemd-timesyncd

 7月 31 01:17:22 arianrhod systemd[1]: Starting Network Time Synchronization...
 7月 31 01:17:22 arianrhod systemd[1]: Started Network Time Synchronization.
 7月 30 17:17:21 arianrhod systemd-timesyncd[7288]: Synchronized to time server 192.168.1.200:123 (192.168.1.200).

$ date
2018年  7月 30日 月曜日 17:17:33 JST

ちゃんと動きましたー。

VirtualBox上のWindows 10起動時にストレージ絡みのエラーが出る

エラーメッセージは以下通り。

ata2 master: Unknown device
ata2 slave: Unknown device
ata3 master: Unknown device
ata3 slave: Unknown device

VMWare ESXiで調整した仮想マシンをovfでExportしてVirtualBoxでImportしたらエラーが出た。
ぐぐる

ask.sagemath.org

というページにあたったたので、設定 > ストレージ > コントローラー:SATA > ポートの数 を確認したら30になってた。
これを4に変えたらエラー消えました。

最初に一通り設定見たときに、30ってなんか変だなぁと思ったけどまさかこれが関係するとは思ってなかったのでスルーしてた。

ちなみに、Import直後はなぜかvmdkが所属するコントローラーがSASになってたので、SATAに付け替えたけどちゃんと動いています。

Confluenceで日本語が化ける

マクロとパワーポイントやワード等のOffice文書、PDF表示の3つが化けます。
※作業しているOSは、Ubuntu Server 18.04 LTS です。

まずはマクロ

以下を見ながら設定

Confluence のマクロで日本語が表示されない - Atlassian Documentation

$ sudo service confluence stop

$ sudo aptitude install fontconfig

ググってもIPAフォントを使うのしかでてこないがお気に入りの源真フォントでやってみる

$ cd /usr/share/fonts/truetype
$ sudo cp -pr ~/genshingothic-20150607 .
$ sudo mv genshingothic-20150607 genshingothic
$ sudo chown -R root:root genshingothic/
$ fc-list

/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf: DejaVu Serif:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf: DejaVu Sans Mono:style=Book
/usr/share/fonts/X11/Type1/s050000l.pfb: Standard Symbols L:style=Regular
/usr/share/fonts/truetype/genshingothic/GenShinGothic-Heavy.ttf: 源真ゴシック,Gen Shin Gothic,Gen Shin Gothic Heavy,源真ゴシック Heavy:style=Heavy,Bold
省略

Javaのフォントも設定

$ sudo cat /etc/profile.d/jdk.sh
export J2SDKDIR=/usr/lib/jvm/java-8-oracle
export J2REDIR=/usr/lib/jvm/java-8-oracle/jre
export PATH=$PATH:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export DERBY_HOME=/usr/lib/jvm/java-8-oracle/db

$ cd /usr/lib/jvm/java-8-oracle/jre/lib/fonts
$ sudo mkdir fallback
$ cd fallback/
$ sudo cp -p ~/genshingothic-20150607/*ttf .

これでマクロは直りました。

次はOffice文書

公式に書いてある通りCATALINA_OPTSに書いてもどうしても直らないのでIPAフォントでやることに。

$ cd /usr/local/confluence/bin
$ vi setenv.sh

CATALINA_OPTS="-Dconfluence.document.conversion.fontpath=/usr/lib/jvm/java-8-oracle/jre/lib/fonts/fallback ${CATALINA_OPTS}"

これを追加してconfluenceを停止してからキャッシュを削除すれば表示されるようになりました。(源真じゃないけど・・・)

$ cd /var/atlassian/application-data/confluence
$ rm -rf dcl-document dcl-document_hd dcl-thumbnail

最後にマクロ

Confluence管理 > PDF エクスポート言語サポート > ファイルを選択 > GenShinGothic-P-Regular.ttf > install

で、源真Pゴシックが設定できました。

Officeだけどうしてもうまく行かなかった・・・

ubuntuのタイムゾーンをUTCからJSTへ変更する

諸般の事情により、JIRAサーバを移行しました。
新サーバは、Ubuntu Server 18.04 LTSにしたのですが、アプリケーションリンクで

システム時計が同期されていません
このサーバーにはBitbucketの異なるシステム時刻を採用しており、これがアプリケーションの認証を妨げています。

というエラーが出ていたので確認したらUTCでした。

$ date
2018年  6月  6日 水曜日 08:19:21 UTC

$ timedatectl
                      Local time: 水 2018-06-06 08:20:05 UTC
                  Universal time: 水 2018-06-06 08:20:05 UTC
                        RTC time: 水 2018-06-06 08:20:05
                       Time zone: Etc/UTC (UTC, +0000)
       System clock synchronized: no
systemd-timesyncd.service active: yes
                 RTC in local TZ: no

JSTに設定します。

$ sudo timedatectl set-timezone Asia/Tokyo

$ timedatectl
                      Local time: 水 2018-06-06 17:20:58 JST
                  Universal time: 水 2018-06-06 08:20:58 UTC
                        RTC time: 水 2018-06-06 08:20:58
                       Time zone: Asia/Tokyo (JST, +0900)
       System clock synchronized: no
systemd-timesyncd.service active: yes
                 RTC in local TZ: no

あれ?エラーが直らない・・・
あっ!時間ずれてるじゃん_| ̄|○

$ sudo ntpdate hogehoge
 6 Jun 09:34:49 ntpdate[2964]: step time server 192.168.1.2 offset -28816.325659 sec
$ date
2018年  6月  6日 水曜日 09:34:51 JST

これでエラー直った。

bitbucket-backup-clientでのバックアップがおかしくなったときの対応

Bitbucket Serverのバックアップをbitbucket-backup-clientを使ってcronで実行してます。
月曜の朝からBitbucketが使えないという連絡がSlackで入る・・・。

どうやら日曜日に実行したバックアップがおかしくなり月曜朝のバックアップもコケていた模様。

取り敢えずWebの画面からロック解除というのやってみる

f:id:gozuk16:20180305210539p:plain

キャンセルするには認証トークンを入力してください。これはBitbucketのログの中で探すことが出来ます。 と書いてあるけど何をキーに探すのやら。
取り敢えずググると公式文書がありました。

Using Bitbucket Server DIY Backup - Atlassian Documentation

Note that Bitbucket Server will still be locked in maintenance mode.
Repeat these steps using the "locked with" token (e.g. "7187ae1824ce1ede38a8e7de4bccf58d9a8e1a7a") 
to exit maintenance mode as well, and unlock Bitbucket Server.

↑と書いてあるのでログをあさって以下を見つけました。

atlassian-bitbucket-2018-03-04.log:2018-03-04 06:48:46,068
INFO  [http-nio-7991-exec-5] root @xxxxxxxxxxxxxxxx 10.x.x.x,127.0.0.1
"POST /mvc/admin/backups HTTP/1.0" c.a.s.i.m.DefaultMaintenanceService BACKUP started.
It may be canceled with token: ほにゃららtoken

ちょっと違うけど、このトークンでキャンセルできました!

が、次はメンテナンス画面になった。。。

f:id:gozuk16:20180305211004p:plain

メンテナンスのロック解除をやってみる

f:id:gozuk16:20180305211227p:plain

メンテナンスのキャンセル用認証トークンはまた別らしい・・・。
今度はログをあさっていろいろ試してみたら解除できました。

atlassian-bitbucket-2018-03-04.log:2018-03-04 06:48:45,618
INFO  [hz.hazelcast.cached.thread-5]
c.a.s.i.m.DefaultMaintenanceService The system has been locked for maintenance.
It may be unlocked with token: ほにゃららtoken

ふぃ〜。朝から疲れました。。。

Gradleでbuildすると1行目でいきなり"1: Invalid variable name."というエラーが出る

Groovyでちょっとした物を作り始めたら・・・

C:\home\gozu\projects\Foo\bar>gradlew jar
:compileJava UP-TO-DATE
:compileGroovy
startup failed:
C:\home\gozu\projects\Foo\bar\src\main\groovy\hogehoge.groovy: 1: Invalid variable name. Must start with a letter but was: ?
. At [1:1]  @ line 1, column 1.
   ?/*
   ^

1 error

:compileGroovy FAILED

FAILURE: Build failed with an exception.

ん?1行目?

あっ・・・(察し)
BOM付いてるじゃん。いつの間に・・・