apt upgrade で ping(inetutils-ping) が壊れていると言われて失敗する

Debian sid amd64 環境で,apt upgrade するとこんなエラーで失敗しました.

$ sudo apt upgrade
Reading package lists... Done
Building dependency tree     
Reading state information... Done    
Calculating upgrade... Done          
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.         
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 inetutils-ping : Conflicts: ping
E: Broken packages 

ping コマンドはあるし実行も出来る.reinstall してみましたがエラーは解消されず.

$ sudo apt install --reinstall inetutils-ping                                                                     
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  python-newt
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 57 not upgraded.
Need to get 0 B/226 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 472864 files and directories currently installed.)
Preparing to unpack .../inetutils-ping_2%3a1.9.4-7_amd64.deb ...
Unpacking inetutils-ping (2:1.9.4-7) over (2:1.9.4-7) ...
Setting up inetutils-ping (2:1.9.4-7) ...
Processing triggers for man-db (2.8.5-2) ...

一時的に削除してみました.

$ sudo apt remove inetutils-ping
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  python-newt
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
  inetutils-ping
0 upgraded, 0 newly installed, 1 to remove and 57 not upgraded.
After this operation, 358 kB disk space will be freed.
Do you want to continue? [Y/n] 
(Reading database ... 472864 files and directories currently installed.)
Removing inetutils-ping (2:1.9.4-7) ...
Processing triggers for man-db (2.8.5-2) ...

削除した後 apt upgrade を試すと通りました.

$ sudo apt upgrade

その後 ping を install し直したあと upgrade を試すとエラーは出なくなりました.

$ sudo apt install inetutils-ping
$ sudo apt upgrade>/dev/null 2>&1;echo $?
0

原因がよくわからないですね…….

環境

$ dpkg-query -W apt inetutils-ping
apt     1.8.0
inetutils-ping  2:1.9.4-7
$ lsb_release -dr
Description:    Debian GNU/Linux 10 (buster)
Release:        10
$ uname -m
x86_64

dhcp パケットをキャプチャするメモ

tcpdumpの場合
$ sudo tcpdump -i wlp3s0 port 67 or port 68 -e -n
[sudo] password for matoken:
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on wlp3s0, link-type EN10MB (Ethernet), capture size 262144 bytes
21:07:44.898511 00:23:15:5b:a6:60 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:23:15:5b:a6:60, length 300
dhcpdump も読みやすくて便利
$ sudo dhcpdump -i wlp3s0
  TIME: 2019-04-10 21:17:17.398
	IP: 0.0.0.0 (0:23:15:5b:a6:60) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
	OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 011d073a
  SECS: 0
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: 00:23:15:5b:a6:60:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         3 (DHCPREQUEST)
OPTION:  50 (  4) Request IP address        192.168.1.5
OPTION:  12 (  5) Host name                 x201i
OPTION:  55 ( 17) Parameter Request List      1 (Subnet mask)
											 28 (Broadcast address)
											  2 (Time offset)
											  3 (Routers)
											 15 (Domainname)
											  6 (DNS server)
											119 (Domain Search)
											 12 (Host name)
											 44 (NetBIOS name server)
											 47 (NetBIOS scope)
											 26 (Interface MTU)
											121 (Classless Static Route)
											 42 (NTP servers)
											249 (MSFT - Classless route)
											 33 (Static route)
											252 (MSFT - WinSock Proxy Auto Detect)
											 17 (Root path)


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


^C

apt/apt-get のエイプリルフール牛さん

昨夜なんとなく apt コマンドのイースターエッグの apt moo を実行してみました.するといつもとは違った牛が!

20190402 00 04 09 23354

Debian sid 環境だったのでもしかしてキャラクター変更されたのだろうかと思ったのですがしばらくしてから再度実行するといつもの牛.

20190402 20 04 14 16775

時計を見ると日付が04/01から04/02に変わったところでした.
04/01に出現したってことはエイプリルフールな牛かな?と faketime command を利用して1日前にして実行すると出てきました.

$ faketime -f '-1d' apt moo
               _     _
              (_\___( \,
                )___   _  Have you smashed some milk today?
               /( (_)-(_)    /
    ,---------'         \_
  //(  ',__,'      \  (' ')
 //  )              '----'
 '' ; \     .--.  ,/
    | )',_,'----( ;
    ||| '''     '||

若しくは04/01を指定

$ faketime '20190401' apt moo
               _     _
              (_\___( \,
                )___   _  Have you smashed some milk today?
               /( (_)-(_)    /
    ,---------'         \_
  //(  ',__,'      \  (' ')
 //  )              '----'
 '' ; \     .--.  ,/
    | )',_,'----( ;
    ||| '''     '||

多分この辺ですね

$ grep -A21 bool\ DoMooApril ./apt-private/private-moo.cc
static bool DoMooApril()                                                /*{{{*/
{
   // by Christopher Allan Webber and proposed by Paul Tagliamonte
   // in a "Community outreach": https://lists.debian.org/debian-devel/2013/04/msg00045.html
   if (_config->FindI("quiet") >= 2)
   {
      std::cerr << "Have you smashed some milk today?" << std::endl;
      return true;
   }
   c1out <<
      "               _     _\n"
      "              (_\\___( \\,\n"
      "                )___   _  Have you smashed some milk today?\n"
      "               /( (_)-(_)    /\n"
      "    ,---------'         \\_\n"
      "  //(  ',__,'      \\  (' ')\n"
      " //  )              '----'\n"
      " '' ; \\     .--.  ,/\n"
      "    | )',_,'----( ;\n"
      "    ||| '''     '||\n";
   return true;
}

1.4 で入ったぽい?

$ zgrep -A2 \(1.4\) /usr/share/doc/apt/changelog.gz
apt (1.4) unstable; urgency=medium

  * The April Fools' Release

ちなみに moo moo でカラフルな牛が出てこないときは,APT::Moo::Color オプションが使えるようです.(エイプリルフール牛は単色のみみたい)

20190402 20 04 40 17194

永続化する場合や色をカスタマイズしたい場合は /usr/share/doc/apt/examples/configure-index.gz を参考に /etc/apt/apt.conf に設定すればok.

$ zgrep moo::color /usr/share/doc/apt/examples/configure-index.gz
apt::moo::color "<BOOL>";
$ echo 'apt::moo::color "true";' | sudo tee -a /etc/apt/apt.conf
apt::moo::color "true";
$ dpkg-query -W apt faketime
apt     1.8.0
faketime        0.9.7-3
$ lsb_release -dr
Description:    Debian GNU/Linux buster/sid
Release:        unstable
$ uname -m
x86_64

Endlessh を使って ssh 接続をとてもゆっくりと処理して攻撃者に嫌がらせをする

ssh は攻撃が多いです.公開鍵認証にしておくと大分侵入に強くなりますがインターネットに直接繋がっているサーバでは攻撃はとても多いです.

Endlessh はsshd の代わりに起動してバージョン情報を送る前のデータにほぼランダムな文字列をゆっくりと配信し続けて攻撃者の足止めをするプログラムのようです.
本当の sshd は別ポートで起動してそっちを使う感じでしょうか.22番を無くして port knocking や sslh を使うなどのほうがいいかもですが面白そうです.

ということで手元で少し試してみました.

導入とビルド
$ git clone https://github.com/skeeto/endlessh
$ cd endlessh
$ git log |head -1
commit 548a7b1521b2912e7e133d0d9df50e0e514f1f2c
$ make
port 22222 で起動
$ ./endlessh -v -p22222 &
[1] 22698
2019-03-24T04:56:10.338Z Port 22222
2019-03-24T04:56:10.338Z Delay 10000
2019-03-24T04:56:10.338Z MaxLineLength 32
2019-03-24T04:56:10.338Z MaxClients 4096
ssh 接続してみると700分ほど捕まえていた
$ time ssh localhost -p 22222
2019-03-24T04:56:19.510Z ACCEPT host=::1 port=59402 fd=4 n=1/4096
ssh_exchange_identification: No banner received

real    700m30.650s
user    0m0.040s
sys     0m0.240s
2019-03-24T16:37:00.162Z CLOSE host=::1 port=59402 fd=4 time=42040.652 bytes=73944
終了
$ kill %1
[1]+  Done                    ./endlessh -v -p22222

数回試しましたが,標準オプションでは700分前後捕まりました.単にありもののscriptを動かすレベルの攻撃者であればツールが対応するまでは妨害になりそうです.

環境
$ git log |head -1
commit 548a7b1521b2912e7e133d0d9df50e0e514f1f2c
$ dpkg-query -W openssh-client
openssh-client  1:7.9p1-9
$ lsb_release -dr
Description:    Debian GNU/Linux buster/sid
Release:        unstable
$ uname -m
x86_64

apticron でDebian/Ubuntuのパッケージ更新情報を取得する

最近は Debian/Ubuntu等でのパッケージ更新確認のために crontab にこんな感じのものを登録していました.

apt update 2>&1 | tail -1 | grep -v 'All packages are up to date.' && apt list --upgradable ; apt-cache stats

これはパッケージ情報を更新して,アップデートがあったらパッケージ一覧を求めています.とりあえずこれで使えていたのですが,apticron というパッケージを見つけました.
これはほぼ同じ機能のようですが,パッケージリストだけでなく changelog も含まれます.

20190316 22 03 57 12604

パッケージを導入すればとりあえず使えるようになります.
設定ファイルは /usr/lib/apticron/apticron.conf に雛形が用意されているので /etc/apticron/apticron.conf にコピーして編集します.といっても宛先のメールアドレスが root になっているのでそれを変更するくらいで問題なく使えています.
簡単便利.

Debian では jessie から,Ubuntu では trusty からパッケージがあるようです.

2019-03-17 add)
Google+(もうすぐ終了……) でjessie以前からあったようなというコメントをいただきました.changelogを見ると2002年からあったようです.packages.debian.org は jessie より古いものは置いてないので出てこないだけですね.

$ zcat /usr/share/doc/apticron/changelog.gz|tail -5
apticron (1.0.1) unstable; urgency=low

  * Initial Release.

 -- Colm MacCarthaigh   Fri,  9 Aug 2002 11:53:26 +0100

プライバシーやセキュリティが守られるprotonVPNの無料プランを少し試す

セキュアなメールサービスの ProtonMail と同じ Proton Technologies AGの VPN サービスの ProtonVPN を少し試してみました.
存在は知っていましたが接続するには専用アプリのみが必要だと思いこんでいました.openVPN で接続できるようなので試してみました.

ここでの VPN は拠点間などではなくスマートフォンやPCを公衆無線LANなどで接続したとき向けの個人向けVPNとしての話です.

無料VPNサービスはいろいろ見つかりますが,無料の代わりに個人情報を収集して販売していたりプライバシーポリシーでそういうことをしないとしつつも実際は行っていたりと怪しいものが多いです.

知識のある人であれば自宅にSBCなどで低価格,低消費電力でVPNサーバを用意したり,VPNサービスより安い価格のVPSサービスにセットアップして利用するなどといったことが可能ですが,知識のない人にサーバを立ててもらうのは難しいです.(一旦設定した後も使い続ける間はOSやサービスのアップデートなども必要だし……)

ProtonVPN は有料プランの他に無料プランがあり,無料プランでもプライバシーやセキュリティが守られるとなっています.無料はお試し版という扱いですね.無料プランでは接続できるサーバが限られており,無料プランで接続できるサーバは事に比べて利用率が高くなっています.時間帯によっては100%になっているので速度は低下すると思います.

実際にプライバシーやセキュリティが守られるのかが不安ですが,もともとジャーナリストや活動家を守るために作られたものであったり,MozillaがFirefoxに向けてのVPNサービスにProtonVPNを選ぶなどそれなりに信頼できそうな気がします.(少なくとも今の時点では)

ProtonVPN アカウントの作成

ProtonVPN を利用するためにアカントを作成します.
手順は以下に書かれています.メールアカウントが別途必要です.また,ProtonMail のアカウントを使ってProtonVPN のアカウントを作成するとこも出来るようなので私は ProtonMail でアカウントを作成しました.

Network Manager を利用して ProtonVPN に接続

お手軽にNetwork Manager の openVPN プラグインを利用して接続します.
以下に手順があるので真似します.

(GUIのNetwork Manager 以外にも command-line や IKEv2 での接続方法もあるようです.)_

必要なパッケージを導入します.

$ sudo apt install openvpn network-manager-openvpn-gnome resolvconf

ProtonVPN の設定ファイルを入手します.

  • ProtonVPN のサイトでログイン
  • Download ページに移動
  • plathome で「Linux」を選択
  • protocol はそのまま「UDP」
  • 無料プランでは「Secure Core configs」,「Country configs」は利用できないので「Server configs」を選択.
  • 後は任意の接続でダウンロード
    • 今回は「Japan」の「Japan Free#2」をダウンロードした

続いてNetwork Manager の設定をします.

  • Network Manager のアイコンをクリックして,「VPN 接続(V)」->「VPN を設定(C)」を選択
  • 「接続の種類を選んでください」というウィンドウで,「保存した VPN 設定をインポートする…」を選んで「作成(R)…」を押す
    20190306-22-03-15-15118.jpg
  • ProtonVPN のページでダウンロードした設定ファイルを指定してインポートする
  • 次の設定画面のVPN タブで「ユーザ名」,「パスワード」を入力する.ユーザ名,パスワードは protonVPN のページで確認できる.(protonVPNサービスのものとは別で自動生成されている)
    20190306-22-03-21-8927.jpg
    20190306-22-03-05-17942.jpg

接続してみます.

  • Wi-Fi などのネットワークに接続した状態でNetwork Manager のアイコンをクリックして,「VPN 接続(V)」->設定したprotonVPN をクリック

リモートアドレスなどを確認するとVPN のものに変わっていました.

$ curl ifconfig.me/ip
185.242.4.204
$ dig | grep -i server:
;; SERVER: 10.8.8.1#53(10.8.8.1)
$ /sbin/ifconfig tun0
tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1500
        inet 10.8.3.2  netmask 255.255.255.0  destination 10.8.3.2
        inet6 fe80::642a:6858:4f6:403  prefixlen 64  scopeid 0x20<link>
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 100  (不明なネット)
        RX packets 11489  bytes 8367918 (7.9 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 11204  bytes 2610990 (2.4 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

$ whois 185.242.4.204
% This is the RIPE Database query service.
% The objects are in RPSL format.
%
% The RIPE Database is subject to Terms and Conditions.
% See -ripe.net - www.ripe.net/db/support/db-terms-conditions.pdf

% Note: this output has been filtered.
%       To receive output for a database update, use the "-B" flag.

% Information related to '185.242.4.0 - 185.242.4.255'

% Abuse contact for '185.242.4.0 - 185.242.4.255' is 'abuse@m247.ro'

inetnum:        185.242.4.0 - 185.242.4.255
netname:        M247-LTD-TOKYO
descr:          M247 LTD Tokyo Infrastructure
country:        JP
geoloc:         35.622214 139.7455763
admin-c:        GBXS24-RIPE
tech-c:         GBXS24-RIPE
status:         LIR-PARTITIONED PA
mnt-by:         GLOBALAXS-MNT
remarks:        ---- LEGAL CONCERNS ----
remarks:        For any legal requests, please send an email to
remarks:        ro-legal@m247.ro for a maximum 48hours response.
remarks:        ---- LEGAL CONCERNS----
created:        2018-01-17T11:32:30Z
last-modified:  2018-11-29T11:54:41Z
source:         RIPE

role:           GLOBALAXS TOKYO NOC
address:        2 Chome-1-17 Higashishinagawa, Shinagawa
address:        Tokyo 140-0002, Japan
abuse-mailbox:  abuse@m247.ro
nic-hdl:        GBXS24-RIPE
mnt-by:         GLOBALAXS-MNT
created:        2017-10-17T16:49:19Z
last-modified:  2018-07-18T11:04:41Z
source:         RIPE # Filtered

% Information related to '185.242.4.0/24AS9009'

route:          185.242.4.0/24
origin:         AS9009
mnt-by:         GLOBALAXS-MNT
created:        2018-01-17T11:33:29Z
last-modified:  2018-01-17T11:33:29Z
source:         RIPE

% This query was served by the RIPE Database Query Service version 1.92.6 (WAGYU)

速度については確認した回線がADSL で元々細いせいかVPN利用時,非利用時であまり変わりませんでした(400kB/s程).公衆無線LAN などでも試してみたいところです.

ちなみに,AndroidスマートフォンのProtonVPN を携帯回線で利用した状態で Wi-Fi 接続したら VPNのセッションは張り直されず Wi-Fi を利用しているつもりで携帯回線を使い続けていたということがありました.ちゃんと検証していないですが気をつけたほうが良さそうです.
OpenVPN Connect のほうがいいかも

Android環境

Android のバージョン:9
セキュリティパッチレベル: 2019年3月5日

Linux環境1

$ dpkg-query -W openvpn network-manager-openvpn-gnome resolvconf
network-manager-openvpn-gnome   1.8.10-1
openvpn 2.4.7-1
resolvconf      1.79
$ lsb_release -dr
Description:    Debian GNU/Linux buster/sid
Release:        unstable
$ uname -m
x86_64

Linux環境2
$ dpkg-query -W openvpn network-manager-openvpn-gnome resolvconf
network-manager-openvpn-gnome 1.8.10-1
openvpn 2.4.6-1ubuntu3
resolvconf 1.79ubuntu10
$ lsb_release -dr
Description: Ubuntu Disco Dingo (development branch)
Release: 19.04
$ uname -m
x86_64

GARMIN OREGON 300のログがおかしくなる

GPSロガーにGARMIN OREGON 300を使っています.大分前に販売は終了していて,バッテリーボックスや外装がへたっていますが未だ使えています.単3電池2本で12〜16時間程は動作するしいざとなったらUSB経由でも動作します.防水(手持ちのは外装が破損してもう防水ではない)で雨の中も普通に使えるし,地図にOpenStreetMapのデータを使うことも出来ます.
これを主に自転車のハンドルにマウントして使っています.
知らない道路を走るときなどはトラックログを前もって作成しておいて参照しながら走ると迷わず時間もロスせず走れていい感じです.(ブルベなどに最適)

ルートの作成にはJOSMやルートラボを利用しています.

走行後はログからデジタルカメラの写真にジオタグを埋め込んだりログや写真を見ながらOpenStreetMapに情報を入力したりしています.

そんな感じで便利に使っていたのですが,初日の出を見に行ったときのポタリングのデータを見たらデータがおかしいです.電源を入れ直すたびにその場所の標高が-になっているとかもおかしいのですが,日付が1999年05月17〜18日になっています.実際は2019年01月01日です.
GPSの1999年8月21日問題?と思いましたが,次は4月なので多分違う.

もしかしてOREGON 300は2019年のデータを扱えない?

20190105-03-01-15-1953320190105-03-01-23-19610

データはこんな感じで年月日と標高はおかしいですが,位置情報と時分秒は正しそうです.

$ grep trkpt ~/Nextcloud_files.matoken.org/GPS/2019-01-01.gpx |head
<trkpt lat="31.254590" lon="130.854801"><ele>28.50</ele><time>1999-05-17T20:55:26Z</time></trkpt>
<trkpt lat="31.254776" lon="130.854894"><ele>29.46</ele><time>1999-05-17T20:55:31Z</time></trkpt>
<trkpt lat="31.254912" lon="130.854996"><ele>31.38</ele><time>1999-05-17T20:55:36Z</time></trkpt>
<trkpt lat="31.254953" lon="130.855057"><ele>31.38</ele><time>1999-05-17T20:55:39Z</time></trkpt>
<trkpt lat="31.255113" lon="130.855215"><ele>33.30</ele><time>1999-05-17T20:55:46Z</time></trkpt>
<trkpt lat="31.255165" lon="130.855251"><ele>33.30</ele><time>1999-05-17T20:55:48Z</time></trkpt>
<trkpt lat="31.255219" lon="130.855322"><ele>34.26</ele><time>1999-05-17T20:55:51Z</time></trkpt>
<trkpt lat="31.255249" lon="130.855343"><ele>35.23</ele><time>1999-05-17T20:55:54Z</time></trkpt>
<trkpt lat="31.255276" lon="130.855375"><ele>34.74</ele><time>1999-05-17T20:55:56Z</time></trkpt>
<trkpt lat="31.255384" lon="130.855460"><ele>35.71</ele><time>1999-05-17T20:56:01Z</time></trkpt>
$ grep trkpt ~/Nextcloud_files.matoken.org/GPS/2019-01-01.gpx |tail
<trkpt lat="31.253258" lon="130.851111"><ele>138.09</ele><time>1999-05-18T03:57:15Z</time></trkpt>
<trkpt lat="31.253231" lon="130.851065"><ele>137.61</ele><time>1999-05-18T03:57:16Z</time></trkpt>
<trkpt lat="31.253209" lon="130.851040"><ele>136.64</ele><time>1999-05-18T03:57:17Z</time></trkpt>
<trkpt lat="31.253189" lon="130.851033"><ele>135.68</ele><time>1999-05-18T03:57:19Z</time></trkpt>
<trkpt lat="31.253162" lon="130.851021"><ele>137.13</ele><time>1999-05-18T03:57:22Z</time></trkpt>
<trkpt lat="31.253105" lon="130.850987"><ele>136.64</ele><time>1999-05-18T03:57:30Z</time></trkpt>
<trkpt lat="31.253046" lon="130.850972"><ele>136.64</ele><time>1999-05-18T03:57:36Z</time></trkpt>
<trkpt lat="31.253009" lon="130.850969"><ele>136.16</ele><time>1999-05-18T03:57:41Z</time></trkpt>
<trkpt lat="31.252981" lon="130.850972"><ele>136.64</ele><time>1999-05-18T03:57:48Z</time></trkpt>
<trkpt lat="31.252978" lon="130.850982"><ele>136.64</ele><time>1999-05-18T03:57:54Z</time></trkpt>

標高はとりあえず置いておいてsedで年月日差し替えでとりあえず写真にジオタグを付けたりするのに使えました.

$ sed -e "s/1999-05-1[7|8]/2018-12-31/g" 2019-01-01.gpx > 2019-01-01-tr.gpx

10年前の機械だからもう駄目なんだろうかと思いながらOREGON 300のFirmwareのバージョンを見ると3.01でした.

83

最新のFirmwareを確認すると4.20のようです.今回の件は見当たりませんがいろいろと改善されているようなので今回の件が治らないにしてもアップデートしておいたほうが良さそうです.

Changes made from version 4.10 to 4.20:
Updated magnetic Earth data
Improved GPS performance
Improved support for BirdsEye™ Satellite Imagery (each provider's imagery can be configured independently)
Increased the maximum number of supported JNX files to 250 from 200
Fixed issues with WAAS/EGNOS
Fixed issue with track navigation sometimes not adding waypoints to the Active Route list
Fixed issue with MPC map labels disappearing
Fixed shutdown on the map page when you have a geocache dashboard active and return after pressing the geocache name
Fixed issue with photo viewer not displaying correctly
Fixed issue with 3D view
Fixed issue with track navigation not adding waypoints to the Active Route list when they are exactly equal to a track point
Fixed shutdown when the device had more than the maximum number of JNX files on it
Fixed shutdown related to topographical maps and land cover text size
Fixed shutdown associated with certain custom POI files
Fixed Glide Ratio to Destination field
Fixed an issue related to adding a geocache as a point in a route
Fixed an issue with magnetic north reference and waypoint headings
Modified the 'Arriving at Destination' message banner so that it no longer appears when navigating to a geocache
Changes made from version 4.00 to 4.10:
Added support for chirp™ (Oregon 300, Oregon 400).
Fixed problem with certain custom maps.
Changes made from version 3.90 to 4.00:
Fixed issue on 3D View where vehicle could move after using the map.
Fixed issue on map page where back button would jump to the main menu.
Fixed issues with odometer distance.
Fixed shutdown while panning the map for extended periods of time.
Changes made from version 3.80 to 3.90:
Added ability to set user declination direction
Added Automatic Shaded Relief option
Added brightness adjustments for BirdsEye imagery
Added Geocache filtering. Select Setup > Geocaches to add custom filters
Added multicaching support
Improved WAAS performance
Fixed elevation profiles to always use the most detailed DEM data loaded
Fixed issue with calculator % function
Fixed issue with map POI's showing twice for a single point
Fixed issue with Oblique Mercator User grid
Fixed occasional shutdowns
Fixed spot sounding display on certain maps
Changes made from version 3.70 to 3.80:
Added BirdsEye control to profiles.
Added screen calibration option to Oregon 200.
Fixed issue changing marine modes.
Fixed map display problems.
Changes made from version 3.60 to 3.70:
Added support for Garmin BirdsEye.
Added mmHg pressure units.
Added ability to change active track color.
Added option to calibrate screen under Setup->Display.
Changes made from version 3.50 to 3.60:
Increased the map drawing range to allow maps to draw farther south.
Corrected issue with route line sometimes not drawing.
Corrected issues with marine POI.
Corrected issues with GB Discoverer maps.
Corrected issue with project waypoint bearing sometimes not showing the input value.
Changes made from version 3.40 to 3.50:
Added ability to view elevation plot of upcoming active route or currently navigated track in blue.
Added display of icons to the lists in Where To? > Waypoints and the Geocaching application.
Added phone numbers when available to POI review pages.
Added Compass, Stopwatch, Active Geocache, and Elevation Plot dashboard options.
Introduced dashboard options to the Compass and Map pages.
Improved track navigation.Visit http://garmin.blogs.com/softwareupdates/trail-tech/ for more information.
Changes made from version 3.30 to 3.40:
Added profile support for Garmin Custom Maps
Fixed lockup while using GB Discoverer maps
Changes made from version 3.20 to 3.30:
Added support for Garmin Custom Maps
Improved along road routing performance
Changes made from version 3.10 to 3.20:
Added LKS92 map datum
Added support for GPS firmware 3.70
Added support for GPI routes
Improved compass responsiveness
Fixed potential shutdown related to drawing 32-bit map points
Fixed potential issues during power on.
Changes made from version 2.80 to 3.10:
Added Waypoint Averaging application (For more information visit our new Trail Tech website at http://garmin.blogs.com/softwareupdates/trail-tech/)
Added Sight 'N Go application for the Oregon 300/400i/400c/400t
Added Man Overboard application
Added big numbers option to the trip computer
Added customizable text to unit power-on screen (see \Garmin\startup.txt)
Added ability to load maps from any img file in the Garmin directory
Added new trip computer dashboards
Added option to display four configurable data fields on the map
Added 'search near' option to Geocaches search
Added the ability to view geocache logs separate from the description
Added ability to see a list of points from the map when several points are at the same location
Added ability to edit a waypoint from the waypoint review
Added support for Custom POI database and category selection
Added distance and bearing to point when reviewing a Custom POI
Added POI subcategories
Added change location to Sun and Moon
Added change location to Hunt and Fish
Added ability to force the Oregon into mass storage mode by holding the power button for 30 seconds while plugged into a USB cable
Added NMEA 9600 baud
Improved render quality of GB Discoverer maps and maps with satellite imagery
Improved map zooming
Improved map draw speed
Improved map panning and zooming when shaded relief is turned on
Improved automatic route recalculation
Improved Custom POI spell search
Improved Main Menu setup and added option to add and remove items
Improved readability of configurable data fields
Improved display of numeric degrees and mils
Improved GPS performance at slow speeds in tree cover
Improved compass responsiveness in challenging GPS environments
Improved battery gage for NiMH batteries
Improved stability when changing profiles
Improved Wherigo stability
Improved connection reliability with Spanner
Improved Spanish keyboard
Fixed airport points not displaying on the map
Fixed lockup when a search returns no results
Fixed elevation errors when reviewing a point other than a waypoint
Increased the number of waypoints viewable from the Waypoint Manager and Where To?>Waypoints

しかしアップデートにはWindows端末が必要で今まともな実機がないので面倒…….
仮想環境のWindows 10 Pro 64bitを使ってアップデートできました.

20190106-17-01-39-2952720190106-17-01-36-10392

120

ちなみに今 $11.80 でWindows 10 Pro OEM ライセンスがセールしてたりするので環境がない人はこれを買って仮想環境に入れとくと今回みたいなときに便利です.

そして庭に出て測位してログを確認したら正しい日付のログが録れていました :)

20190106-17-01-14-2114220190106-17-01-19-21289

しかし大分古いので新しいQZSS対応あたりの世代のOREGONとか欲しいですね.
OREGON だと600以降かな?カメラはいらないので600/600t/700?

環境

$ uname -m
x86_64
$ lsb_release -rd
Description:    Debian GNU/Linux buster/sid
Release:        unstable
$ dpkg-query -W gpsprune gpsbabel
gpsbabel        1.5.4-2
gpsprune        19.2-1

pdfファイルから画像を抜き出し( pdfimages or LibreOffice )

ここ2,3日で数回使ったのでメモしておきます.

poppler-utilsのpdfimagesを使う

概要
$ apt show poppler-utils | grep Description: -A99

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Description: PDF 向けユーティリティ (Poppler ベース)
 Poppler は xpdf PDF ビューアを基に作られた PDF 描画ライブラリです。
 .
 本パッケージには (Poppler ベースの) コマンドラインユーティリティが含まれ、
 PDF 文書の情報の取得、他の形式への変換、編集ができます。
  * pdfdetach -- 埋め込みファイル (添付ファイル) の一覧出力または抽出
  * pdffonts -- フォント分析ツール
  * pdfimages -- 画像抽出ツール
  * pdfinfo -- 文書情報
  * pdfseparate -- ページ抽出ツール
  * pdfsig -- デジタル署名の検証
  * pdftocairo -- PDF から PNG/JPEG/PDF/PS/EPS/SVG への Cairo を使った変換ツール
  * pdftohtml -- PDF から HTML への変換ツール
  * pdftoppm -- PDF から PPM/PNG/JPEG 画像への変換ツール
  * pdftops -- PDF から PostScript (PS) への変換ツール
  * pdftotext -- テキストの抽出
  * pdfunite -- 文書の併合ツール
導入
$ sudo apt install poppler-utils
usage
$ pdfimages
pdfimages version 0.69.0
Copyright 2005-2018 The Poppler Developers - http://poppler.freedesktop.org
Copyright 1996-2011 Glyph & Cog, LLC
Usage: pdfimages [options] <PDF-file> <image-root>
  -f <int>       : first page to convert
  -l <int>       : last page to convert
  -png           : change the default output format to PNG
  -tiff          : change the default output format to TIFF
  -j             : write JPEG images as JPEG files
  -jp2           : write JPEG2000 images as JP2 files
  -jbig2         : write JBIG2 images as JBIG2 files
  -ccitt         : write CCITT images as CCITT files
  -all           : equivalent to -png -tiff -j -jp2 -jbig2 -ccitt
  -list          : print list of images instead of saving
  -opw <string>  : owner password (for encrypted files)
  -upw <string>  : user password (for encrypted files)
  -p             : include page numbers in output file names
  -q             : don't print any messages or errors
  -v             : print copyright and version info
  -h             : print usage information
  -help          : print usage information
  --help         : print usage information
  -?             : print usage information
pdfファイル内の画像リスト確認
$ pdfimages ./bicycle_parking.pdf -list
page   num  type   width height color comp bpc  enc interp  object ID x-ppi y-ppi size ratio
--------------------------------------------------------------------------------------------
   1     0 image     340   120  rgb     3   8  image  no         5  0   221   221 9576B 7.8%
   1     1 image     960   720  rgb     3   8  jpeg   yes       14  0   170   170 64.2K 3.2%
pdfファイルから画像抜き出し既定値では.ppm形式
$ pdfimages ./bicycle_parking.pdf ./bicycle_parking-images
$ ls -l ./bicycle_parking-images*
-rw-r--r-- 1 matoken matoken  122415 11月 12 21:40 ./bicycle_parking-images-000.ppm
-rw-r--r-- 1 matoken matoken 2073615 11月 12 21:40 ./bicycle_parking-images-001.ppm
$ identify ./bicycle_parking-images-000.ppm
./bicycle_parking-images-000.ppm PPM 340x120 340x120+0+0 8-bit sRGB 122415B 0.000u 0:00.000
png形式に変換して保存
$ pdfimages ./bicycle_parking.pdf ./bicycle_parking-images -png
$ ls -l ./bicycle_parking-images*
-rw-r--r-- 1 matoken matoken  10274 11月 12 21:46 ./bicycle_parking-images-000.png
-rw-r--r-- 1 matoken matoken 321115 11月 12 21:46 ./bicycle_parking-images-001.png
$ identify ./bicycle_parking-images-000.png
./bicycle_parking-images-000.png PNG 340x120 340x120+0+0 8-bit sRGB 10274B 0.000u 0:00.000
jpegファイルはjpegとして保存(それ以外はppm)
$ pdfimages ./bicycle_parking.pdf ./bicycle_parking-images -j
$ ls -l ./bicycle_parking-images*
-rw-r--r-- 1 matoken matoken 122415 11月 12 21:48 ./bicycle_parking-images-000.ppm
-rw-r--r-- 1 matoken matoken  65695 11月 12 21:48 ./bicycle_parking-images-001.jpg

LibreOfficeでOpenDocumentFormatに変換して画像だけ抜き出し

OpenDocumentFormatはzip形式で圧縮されてその中に画像ファイルも含まれるのでDraw形式に変換して画像ディレクトリの格納されている Pictures だけ展開すると画像が取り出せる.

導入はディストリビューションのほかFlatpack, snapなども公式で配布されているのでお好みで.今回は Debian sid amd64 でapt installしたもの.

$ libreoffice --headless --nologo --nofirststartwizard --convert-to odg ./bicycle_parking.pdf
convert /home/matoken/Downloads/bicycle_parking.pdf -> /home/matoken/Downloads/bicycle_parking.odg using filter : draw8
$ unzip ./bicycle_parking.odg Pictures/*
Archive:  ./bicycle_parking.odg
 extracting: Pictures/10000000000003C0000002D0136E1A08DF8E2B28.jpg
 extracting: Pictures/100000000000015400000078BA7345C344D8D008.png
$ ls -lA Pictures/
合計 80
-rw-r--r-- 1 matoken matoken 10812 11月 12 12:56 100000000000015400000078BA7345C344D8D008.png
-rw-r--r-- 1 matoken matoken 65695 11月 12 12:56 10000000000003C0000002D0136E1A08DF8E2B28.jpg
$ identify Pictures/*
Pictures/100000000000015400000078BA7345C344D8D008.png PNG 340x120 340x120+0+0 8-bit sRGB 10812B 0.000u 0:00.000
Pictures/10000000000003C0000002D0136E1A08DF8E2B28.jpg JPEG 960x720 960x720+0+0 8-bit sRGB 65695B 0.000u 0:00.000

環境

$ dpkg-query -W poppler-utils unzip libreoffice imagemagick
imagemagick     8:6.9.10.14+dfsg-7
libreoffice     1:6.1.3-1
poppler-utils   0.69.0-2
unzip   6.0-21
$ lsb_release -d
Description:    Debian GNU/Linux unstable (sid)
$ uname -m
x86_64

Googleの社名変更で apt update エラー

パッケージ情報更新のために apt update 中にエラーが発生しました.Googleのアプリケーション(Google Chrome等)を導入ししたときに入るGoogleのリポジトリで Google, Inc.Google LLC に変わったためのようです.

E: Repository 'http://dl.google.com/linux/chrome/deb stable Release' changed its 'Origin' value from 'Google, Inc.' to 'Google LLC'
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.
Do you want to accept these changes and continue updating from this repository? [y/N]

Google LCCには去年変わっていてこのリポジトリにもやっと修正が入ったということのようです.(Androidアプリなどはもっと早かったですね)

ここで y で受け入れると次からこのエラーは現れません.

ヒット:4 http://dl.google.com/linux/chrome/deb stable Release
環境1
$ dpkg-query -W apt
apt     1.7.0
$ lsb_release -d
Description:    Debian GNU/Linux unstable (sid)
$ uname -m
x86_64
環境2
$ dpkg-query -W apt
apt     1.7.0
$ lsb_release -d
Description:    Parrot 4.3
$ uname -m
x86_64

壊れたzipファイルからデータを復旧する

Flickrからダウンロードしたアーカイブがダウンロードに失敗したのか内容が見られないです.
アーカイブが壊れている場合 -F でどうにかなりそう?

$ zip -l data-download-1.zip
		zip warning: missing end signature--probably not a zip file (did you
		zip warning: remember to use binary mode when you transferred it?)
		zip warning: (if you are trying to read a damaged archive try -F)

zip error: Zip file structure invalid (data-download-1.zip)

-F では駄目で -FF を試してみる

$ zip -F data-download-1.zip --out data-download-1_fix.zip
Fix archive (-F) - assume mostly intact archive
		zip warning: bad archive - missing end signature
		zip warning: (If downloaded, was binary mode used?  If not, the
		zip warning:  archive may be scrambled and not recoverable)
		zip warning: Can't use -F to fix (try -FF)

zip error: Zip file structure invalid (data-download-1.zip)

-FF である程度救える感じ

$ zip -FF data-download-1.zip --out data-download-1_fix.zip
Fix archive (-FF) - salvage what can
		zip warning: Missing end (EOCDR) signature - either this archive
					 is not readable or the end is damaged
Is this a single-disk archive?  (y/n): y
  Assuming single-disk archive
Scanning for entries...
 copying: img_20140426_180357_13952989767_o.jpg  (1935629 bytes)
 copying: img_20140723_180327_14575993850_o.jpg  (2639807 bytes)
 copying: img_20140723_180323_14576035839_o.jpg  (3302817 bytes)
 copying: img_20140723_180400_14576043890_o.jpg  (3611376 bytes)
   :
 copying: imgp1491_15854514735_o.jpg
		zip warning: no end of stream entry found: imgp1491_15854514735_o.jpg
		zip warning: rewinding and scanning for later entries

こういう耐障害性は非圧縮tarやafioとかのほうが強いでしょうがWindowsなんかでは多分標準で扱えないしダウンロードに失敗した場合は再度試みることが出来るのでやっぱzipでいいのかな.

ちなみに今回はFlickrから同じファイルを3回ダウンロードしても全部同じ内容で壊れていたので恐らくFlickr側で壊れているなてことでデータを再リクエストしました…….

環境
$ dpkg-query -W zip tar afio
afio    2.5.1.20160103+gitc8e4317-1
tar     1.30+dfsg-2
zip     3.0-11+b1
$ lsb_release -d
Description:    Debian GNU/Linux unstable (sid)
$ uname -m
x86_64