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

GPSロガーにGARMIN OREGON 300を使っています.大分前に販売は終了していて,バッテリーボックスや外装がへたっていますが未だ使えています.単3電池2本で12〜16時間程は動作するしいざとなったらUSB経由でも動作します.防水(手持ちのは外装が破損してもう防水ではない)で雨の中も普通に使えるし,地図にOpenStreetMapのデータを使うことも出来ます.




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



$ grep trkpt ~/ |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 ~/ |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 -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でした.



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 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
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 10 Pro 64bitを使ってアップデートできました.



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

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


OREGON だと600以降かな?カメラはいらないので600/600t/700?


$ uname -m
$ 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 )



$ 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
$ pdfimages
pdfimages version 0.69.0
Copyright 2005-2018 The Poppler Developers -
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
$ 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%
$ 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
$ 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
$ 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


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:
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

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

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

E: Repository ' 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 stable Release
$ dpkg-query -W apt
apt     1.7.0
$ lsb_release -d
Description:    Debian GNU/Linux unstable (sid)
$ uname -m
$ dpkg-query -W apt
apt     1.7.0
$ lsb_release -d
Description:    Parrot 4.3
$ uname -m


アーカイブが壊れている場合 -F でどうにかなりそう?

$ zip -l
		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 (

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

$ zip -F --out
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 (

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

$ zip -FF --out
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



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


Googleドライブにコマンドラインでアクセスできる skicka を少し試してみました.

$ GOPATH=~/go
$ PATH=${PATH}:~/go/bin
$ go get

init コマンドで設定ファイルを生成します.
設定ファイルは ~/.skicka.config として作れれます.
認証情報は`~/.skicka.tokencache.json` に保存されます.
メタデータは ~/.skicka.metadata.cache に保存されます.

$ skicka init
$ skicka ls

サーバなどでウェブブラウザを起動するのが難しい場合は -no-browser-authls コマンドの に付けて起動すると認証URLが表示されるのでそれを操作PCなどで開いて認証を行い,表示された認証コードをコマンドラインに貼り付けます.

$ skicka -no-browser-auth ls
Go to the following link in your browser:
Enter verification code: 4/iwBrjQFEvm2p0nQGXJuRQgTZFZZ6BmXkT7Up7Wl3UYS7NWEyiltTc6E
$ ~/go/bin/skicka
usage: skicka [skicka options] <command> [command options]

Supported commands are:
  cat       Print the contents of the given file
  download  Download a file or folder hierarchy from Drive to the local disk
  df        Display free space on Drive
  du        Report disk usage for a folder hierarchy on Drive
  fsck      Check consistency of files in Drive and local metadata cache
  genkey    Generate a new encryption key
  init      Create an initial skicka configuration file
  ls        List the contents of a folder on Google Drive
  mkdir     Create a new folder or folder hierarchy on Drive
  rm        Remove a file or folder on Google Drive
  upload    Upload a local file or directory hierarchy to Drive

'skicka help' prints more detailed documentation.
$ ~/go/bin/skicka help                                                                                                             [45/2151]
skicka is a tool for working with files and folders on Google Drive.
See for information about getting started.

usage: skicka [common options] <command> [command options]

Commands and their options are:
  cat        Print the contents of the Google Drive file to standard output.
             Arguments: drive_path ...

  download   Recursively download either a single file, or all files from a
             Google Drive folder to a local directory. If the corresponding
             local file already exists and has the same contents as the its
             Google Drive file, the download is skipped.
             Arguments: [-ignore-times] [-download-google-apps-files]
                        drive_path local_path

  df         Prints the total space used and amount of available space on
             Google Drive.

  du         Print the space used by the Google Drive folder and its children.
             Arguments: [drive_path ...]

  fsck       [EXPERIMENTAL/NEW] Use at your own risk.
             Perform a number of consistency checks on files stored in Google
             Drive, including verifying metadata and removing duplicate files
             with the same name.
             Arguments: [--trash-duplicates] [drive_path]

  help       Print this help text.

  genkey     Generate a new key for encrypting files.

  init       Create an initial ~/.skicka.config configuration file. (You
             will need to edit it before using skicka; see comments in the
             configuration file for details.)

  ls         List the files and directories in the given Google Drive folder.                                                                          [8/2151]
             Arguments: [-d, -l, -ll, -r] [drive_path ...],
             where -l and -ll specify long (including sizes and update
             times) and really long output (also including MD5 checksums),
             respectively.  The -r argument causes ls to recursively list
             all files in the hierarchy rooted at the base directory, and
             -d causes directories specified on the command line to be
             listed as files (i.e., their contents aren't listed.)

  mkdir      Create a new directory (folder) at the given Google Drive path.
             Arguments: [-p] drive_path ...,
             where intermediate directories in the path are created if -p is

  rm         Remove a file or directory at the given Google Drive path.
             Arguments: [-r, -s] drive_path ...,
             where files and directories are recursively removed if -r is
             specified and the google drive trash is skipped if -s is
             specified. The default behavior is to fail if the drive path
             specified is a directory and -r is not specified, and to send
             files to the trash instead of permanently deleting them.

  upload     Uploads all files in the local directory and its children to the
             given Google Drive path. Skips files that have already been
             Arguments: [-ignore-times] [-encrypt] [-follow-symlinks <maxdepth>]
                        local_path drive_path

Options valid for both "upload" and "download":
  -dry-run         Don't actually upload or download, but print the paths of
                   all files that would be transferred.
  -ignore-times    Normally, skicka assumes that if the timestamp of a local
                   file matches the timestamp of the file on Drive and the
                   files have the same size, then it isn't necessary to
                   confirm that the file contents match. The -ignore-times
                   flag can be used to force checking file contents in this

General options valid for all commands:
  -config <filename>     General skicka configuration file. Default: ~/.skicka.config.
  -debug                 Enable debugging output.
  -dump-http             Dump http traffic.
  -metadata-cache-file <filename>
                         File to store metadata about Google Drive contents.
                         Default: ~/.skicka.metadata.cache
  -no-browser-auth       Disables attempting to open the authorization URL in a web
                         browser when initially authorizing skicka to access Google Drive.
  -quiet                 Suppress non-error messages.
  -tokencache <filename> OAuth2 token cache file. Default: ~/.skicka.tokencache.json.
  -verbose               Enable verbose output.
$ skicka upload ~/Pictures/$(ls -tr1 ~/Pictures/|tail -1) /
Files:  14.41 KiB / 14.41 KiB [====================================================================================================================] 100.00% 3s
2018/11/04 17:45:32 Preparation time 1s, sync time 3s
2018/11/04 17:45:32 Updated 1 Drive files, 0 local files
2018/11/04 17:45:32 14.41 kiB read from disk, 0 B written to disk
2018/11/04 17:45:32 14.41 kiB uploaded (3.98 kiB/s), 0 B downloaded (0 B/s)
2018/11/04 17:45:32 52.08 MiB peak memory used
$ skicka ls|grep jpg
$ skicka rm 20181104_17:11:45-30082.jpg
$ diff ~/Pictures/20181104_17:11:45-30082.jpg /tmp/20181104_17:11:45-30082.jpg
$ ls -l ~/Pictures/20181104_17:11:45-30082.jpg /tmp/20181104_17:11:45-30082.jpg
-rw-r--r-- 1 matoken matoken 14760 11月  4 17:41 /home/matoken/Pictures/20181104_17:11:45-30082.jpg
-rw-r--r-- 1 matoken matoken 14760 11月  4 17:41 /tmp/20181104_17:11:45-30082.jpg
$ skicka rm /20181104_17:11:45-30082.jpg

skickaには暗号化機能があります.upload時に -encrypt オプションを付与することによりファイルを暗号化してGoogleドライブに保存できます.そのためには準備が必要です.
SKICKA_PASSPHRASE という環境変数にパスフレーズを設定した状態で,skicka genkey を実行して生成された情報を設定ファイルの ~/.skicka.config に書き込みます.

$ read -sp "skicka pass: " SKICKA_PASSPHRASE && export SKICKA_PASSPHRASE && skicka genkey
skicka pass: ; Add the following lines to the [encryption] section
; of your ~/.skicka.config file.
$ vi ~/.skicka.config
$ grep -A5 encryption ~/.skicka.config
        ; Run 'skicka genkey' to generate an encyption key.

upload時に -encrypt を指定すると暗号化され,.aes256 という拡張子付きで保存されます.

$ skicka mkdir encryption
$ skicka upload -encrypt ~/Pictures/20181105_19\:11\:18-8911.jpg /encryption/
$ skicka ls /encryption/

元のファイル名ではダウンロードできず,.aes256 拡張子付きのファイル名ではダウンロードできた.このファイルは .aes256 の拡張子付きのままだが,復号されている.

$ skicka download /encryption/20181105_19:11:18-8911.jpg ./
skicka: /encryption/20181105_19:11:18-8911.jpg: not found on Drive
$ skicka download /encryption/20181105_19:11:18-8911.jpg.aes256 ./
$ file ./20181105_19\:11\:18-8911.jpg.aes256
./20181105_19:11:18-8911.jpg.aes256: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, baseline, precision 8, 933x600, frames
$ identify ./20181105_19\:11\:18-8911.jpg.aes256
./20181105_19:11:18-8911.jpg.aes256 JPEG 933x600 933x600+0+0 8-bit sRGB 92988B 0.000u 0:00.000
$ display ./20181105_19\:11\:18-8911.jpg.aes256


$ file 20181105_19_11_18-8911.jpg.aes256.jpg.aes256
20181105_19_11_18-8911.jpg.aes256.jpg.aes256: data
$ ls -la 201811*
-rw-r--r-- 1 matoken matoken 92988 11月  5 19:30 20181105_19:11:18-8911.jpg.aes256
-rw-r--r-- 1 matoken matoken 93004 11月  5 21:46 20181105_19_11_18-8911.jpg.aes256.jpg.aes256
$ dpkg-query -W golang git bash
bash    4.4.18-3.1
git     1:2.19.1-1
golang  2:1.10~5
$ lsb_release -d
Description:    Debian GNU/Linux unstable (sid)
$ uname -m

Redshift-gtk が位置情報を取得出来なくて困る

太陽の動きに合わせてモニタの色や明るさの調整をしてくれる f.LuxインスパイアなRedshiftというプログラムがあるのですが,新しい環境に導入しても動作しません.位置情報が取得できないようです.

44624259834 09ae5f8845

$ redshift
位置プロバイダ `geoclue2' を試行しています...
プロバイダ `geoclue2' を使用します。
方式 `randr' を使用します。
Unable to start GeoClue client: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: 'redshift' disallowed, no agent for UID 1000.
Access to the current location was denied by GeoClue!
Make sure that location services are enabled and that Redshift is permitted
to use location services. See for more


$ sudo apt install geoclue-2-demo
$ /usr/lib/geoclue-2.0/demos/where-am-i

** (where-am-i:16681): CRITICAL **: 07:00:13.576: Failed to connect to GeoClue2 service: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: 'geoclue-where-am-i' disallowed, no agent for UID 1000
$ /usr/lib/geoclue-2.0/demos/agent &
$ /usr/lib/geoclue-2.0/demos/where-am-i
Geolocation service not in use
Geolocation service in use
Client object: /org/freedesktop/GeoClue2/Client/1

New location:
Latitude:    34.700000°
Longitude:   137.733300°
Accuracy:    25000.000000 meters
Timestamp:   2018年10月16日 07時01分35秒 (1539640895 seconds since the Epoch)
$ redshift
位置プロバイダ `geoclue2' を試行しています...
プロバイダ `geoclue2' を使用します。
方式 `randr' を使用します。
Geolocation service not in use
Geolocation service in use
位置: 北緯 34.70°, 東経 137.73°

44434687985 2bbe2c44ec
44434688165 c1b5632101


/etc/geoclue/geoclue.conf にredshiftの設定を追記
$ echo '[redshift]
users=' | sudo tee -a
$ kill %1
[1]+  Terminated              /usr/lib/geoclue-2.0/demos/agent
$ /usr/lib/geoclue-2.0/demos/agent &
[1] 32138
$ redshift
位置プロバイダ `geoclue2' を試行しています...
プロバイダ `geoclue2' を使用します。
方式 `randr' を使用します。
Geolocation service not in use
Geolocation service in use
位置: 北緯 34.70°, 東経 137.73°
^CGeolocation service not in use


Redshift のhelpを確認すると手動で座標を指定できるようです.

redshift help
$ gtk-redshift --help
ヘルプを出力するには `redshift -h` を実行してください。
$ redshift -h
使い方: redshift -l 緯度:経度 -t 昼の色温度:夜の色温度 [オプション...]


  -h            このヘルプ メッセージを表示
  -v            詳細な出力
  -V            プログラムのバージョンを表示

  -b DAY:NIGHT  画面に適用する明るさ (0.1 から 1.0 の間)
  -c FILE       指定した設定ファイルから設定を読み込む
  -g R:G:B      追加で適用するガンマ補正
  -l LAT:LON    あなたの現在位置
  -l PROVIDER   自動で位置情報を更新するプロバイダを選択
                (`list' を指定すると利用可能なプロバイダの一覧が見られます)
  -m METHOD     色温度の設定方式
                (`list' を指定すると利用可能な方式の一覧が見られます)
  -o            ワン ショット モード (色温度の変更は継続して行いません)
  -O TEMP       ワン ショット 手動モード (色温度を設定します)
  -p            表示モード (パラメータの出力のみを行って終了します)
  -P            新しい色効果の適用前に既存のガンマ ランプをリセット
  -x            リセット モード (画面の調整を解除します)
  -r            色温度の緩やかな変更を無効にする
  -t DAY:NIGHT  昼間/夜間に設定する色温度

ニュートラルな温度は 6500K です。この値を用いると


  昼間の温度: 6500K
  夜間の温度: 4500K

バグは <> に報告してください
$ redshift -l list

`-l プロバイダ名:オプション' でコロン区切りのオプションを指定します。
`-l プロバイダ名:help' でヘルプが参照できます。



$ redshift -l 35.69935:139.76957
方式 `randr' を使用します。
位置: 北緯 35.70°, 東経 139.77°
$ gtk-redshift -l 35.70:139.77 &


$ mkdir -p ~/.config/redshift
$ vi ~/.config/redshift/redshift.conf




$ sudo apt install geoip-bin geoip-database geoip-database-extra geoipupdate
$ sudo geoipupdate
$ geoiplookup $(curl -s
GeoIP Country Edition: JP, Japan
GeoIP City Edition, Rev 1: JP, 13, Hyogo, Nishinomiya, 662-0934, 34.716702, 135.333298, 0, 0
GeoIP ASNum Edition: AS10013 FreeBit Co.,Ltd.


$ gtk-redshift -l $( geoiplookup $(curl -s|grep City | cut -f7-8 -d, | sed -e 's/,/:/' -e 's/\ //g' )


$ dpkg-query -W redshift redshift-gtk geoclue-2.0 geoclue-2-demo geoip-bin geoip-database geoip-database-extra geoipupdate
geoclue-2-demo  2.4.12-2
geoclue-2.0     2.4.12-2
geoip-bin       1.6.12-1
geoip-database  20180315-1
geoip-database-extra    20180315-1
geoipupdate     2.5.0-1
redshift        1.12-2
redshift-gtk    1.12-2
$ lsb_release -d
Description:    Debian GNU/Linux unstable (sid)
$ uname -m

Firefox で DNS-over-HTTPS を試す

最近の Firefox はTrusted Recursive Resolver(TRR)を利用して DNS-over-HTTPS が利用できるようです.試してみました.

アドレスバーに about:config 入力して移動.

44211559615 6a29ddb6d5

network.trr.mode を設定.今回は`3`のTRRのみ利用を指定した.

44402653684 e26c646cb0
43309711340 4b5d902ae2

  • network.trr.mode

    • 0 : TRR無効(既定値).

    • 1 : 通常のDNSとTRRを並行実行して最初に帰ってきた結果を利用する.

    • 2 : TRRを優先利用.

    • 3 : TRRのみを利用.

    • 4 : 通常のDNSを利用する.TRRは情報収集のためだけに動く.

    • 5 : TRRを明示的に無効にする

次に network.trr.uri を指定.好みのDNS-over-HTTPS のリゾルバを指定.

43309712480 d417a108b5
44402653984 c8538ce5fe

about:networking#dns にアクセスしてTRRが true になっていれば TRR を利用しているはず.

44402654944 daac2b37e3

$ dpkg-query -W firefox
firefox 62.0.3-1
$ lsb_release -d
Description:    Debian GNU/Linux unstable (sid)
$ uname -m

44402653394 9392330ef0

Linux で DNS-over-HTTPS を利用する

Android で DNS-over-HTTPS が簡単に出来るようになりました.

Linuxだどうなんだろうと以下の`dns-over-https` を試してみました.ここでは Debian sid amd64 で試していますが,公式の手順には Ubuntu 18.04 LTS, macOS の手順が載っています.

$ sudo apt install git golang
$ git clone
$ cd dns-over-https
$ make
$ sudo checkinstall
規定値のサーバは Google Public DNS になっている.変更したい場合は設定ファイル( /etc/dns-over-https/doh-client.conf )を編集
$ sudo edit /etc/dns-over-https/doh-client.conf
diff --git a/dns-over-https/doh-client.conf b/dns-over-https/doh-client.conf
index 3b5de14..1791397 100644
--- a/dns-over-https/doh-client.conf
+++ b/dns-over-https/doh-client.conf
@@ -11,7 +11,7 @@ listen = [
 upstream_google = [

     # Google's productive resolver, good ECS, bad DNSSEC
-    "",
+    #"",

     # CloudFlare's resolver, bad ECS, good DNSSEC
@@ -39,6 +39,9 @@ upstream_ietf = [
     # Blog:

+    # CleanBrowsing
+    ""

 # Bootstrap DNS server to resolve the address of the upstream resolver
$ sudo systemctl restart doh-client
$ dig @ | grep SERVER
$ dig +trace @

; <<>> DiG 9.11.4-P2-3-Debian <<>> +trace @
;; global options: +cmd
.                       24820   IN      NS
.                       24820   IN      NS
.                       24820   IN      NS
.                       24820   IN      NS
.                       24820   IN      NS
.                       24820   IN      NS
.                       24820   IN      NS
.                       24820   IN      NS
.                       24820   IN      NS
.                       24820   IN      NS
.                       24820   IN      NS
.                       24820   IN      NS
.                       24820   IN      NS
;; Received 239 bytes from in 1334 ms

org.                    172800  IN      NS
org.                    172800  IN      NS
org.                    172800  IN      NS
org.                    172800  IN      NS
org.                    172800  IN      NS
org.                    172800  IN      NS
org.                    86400   IN      DS      9795 7 1 364DFAB3DAF254CAB477B5675B10766DDAA24982
org.                    86400   IN      DS      9795 7 2 3922B31B6F3A4EA92B19EB7B52120F031FD8E05FF0B03BAFCF9F891B FE7FF8E5
org.                    86400   IN      RRSIG   DS 8 1 86400 20181018050000 20181005040000 2134 . bYogBWKVV1SnjoHjS5LnLBE1mWC6UwkYT6muOjcHnuMNzJM1DY3YhSCT d9QOYlvvprUyD37xYIQ10BUZQ8hcNpnQ2TPUTNzd621lsqth6QK8zDN6 eP5AvZXlPy+9wni71rJIHy1wzepn9yrh3jp70zZhnEVxxgItWaYzsayY Jf+UfFQPmOKX0gn0GqcQ09CSZHdZhwbUT2AT1Rs0atkj6VaOy2TT1aQ1 gAtGF+5uA4uqLJegiEe/zneTeyuNE5QDQWKUNaeWEDE9kxylhv6m/3vE tQ8EHFpzOL9x+ed25LNcnRXH8K/xCW43R1FyaVNaA6xcsvGHCysqLneI v/RYMQ==
;; Received 813 bytes from in 210 ms            86400   IN      NS            86400   IN      NS            86400   IN      NS            86400   IN      NS 86400 IN NSEC3 1 1 1 D399EAAB H9PARR669T6U8O1GSG9E1LMITK4DEM0T NS SOA RRSIG DNSKEY NSEC3PARAM 86400 IN RRSIG NSEC3 7 2 86400 20181026101800 20181005091800 1862 org. edCrqcIYiHlMMzuacuX0DlobcQkymqClpK5C4QLzsNWtvp942bFRjbb2 WDX/6TsHO0noBNoKH2i+TU70WqpW7sVsXbjV9nkeLMZjxz/VLyAJOXWk 2ITvZwhjbe96lCSAIafm824pBx94ruieKZ2Yj8pYTBIrhDBoffjPhuem 44k= 86400 IN NSEC3 1 1 1 D399EAAB A86TS1MQ34BR2A3D3CT8D5SCHKAPPBPJ NS DS RRSIG 86400 IN RRSIG NSEC3 7 2 86400 20181022152743 20181001142743 1862 org. G15dhaW+53QBX9nTtsIUCnSRrMO0FCkQJE3jydb6hmRQEA328trp9OqK 6fuvl+RZBhBFeMeJV1Tz0Uezp9YvymfRWwdHiiFFLy3KBt5cTZJUXxTZ jXnMT9PoHZcIVJzN65vqQHDI2MzWYoQYr1WoKmJxOC5FQzFctZElyzEq fNQ=
;; Received 654 bytes from in 217 ms            120     IN      A
;; Received 56 bytes from in 388 ms


  • 通常のDNS

$ sudo tcpdump -n -nn -t -l -A -s0 2>/dev/null | grep
IP > 49901+ [1au] A? (66)
E...z.@.@.8f.........5...w............., m.G.......+...."m.........D....$m.r......#P....&m............ .H`H..2.......m.G......+W.. .H`H..4.......m............ .H`H..6.......m.r......Ov.. .H`H..8.......m..)........
  • DNS over HTTPS


dig @
$ sudo tcpdump -n -nn -t -l -A -s0 2>/dev/null | grep

loopback 部分はHTTPSになる前の部分は見える

dig @
$ sudo tcpdump -i lo -n -nn -t -l -A -s0 2>/dev/null | grep
IP > 25766+ [1au] A? (66)
$ sudo systemctl enable doh-client

後は /etc/network/interfaces や NetworkManager で DNS server に を指定する.

$ dpkg-query -W git golang dnsutils
dnsutils        1:9.11.4.P2+dfsg-3
git     1:2.19.0-1
golang  2:1.10~5
$ lsb_release -d
Description:    Debian GNU/Linux unstable (sid)
$ uname -m

Dropbox を FUSE mount する dbxfs のアクセストークンを gpg で暗号化する

昨日dbxfs を試したのですが,アクセストークンのgpg での暗号化が出来ませんでした.

するとTwitterで情報をもらい,手動でDropbox app を作成してアクセストークンを入手する必要があるそうです.早速試してみたところうまく行きました!

Dropbox の App Console にアクセスして,Create app で新しいアプリを作成します.

44379184824 11e5e5faf4

生成したアプリで Generated access token を押してアクセストークンを生成

43285861640 b2abfddc92 m

$ ~/.local/bin/dbxfs --print-default-config-file
生成したアクセストークンを gpg で暗号化してファイルに格納.
$ echo -n 'ItBeOfobAlbofEicHefvemsajKicsEjcekDomBaHee-shwijreijKimyatIfnebir' | gpg -r EAA13B982D937827 -e -o /home/matoken/.config/dbxfs/token.gpg
$ jq . /home/matoken/.config/dbxfs/config.json
  "access_token_command": [
  "send_error_reports": true,
  "asked_send_error_reports": true
mount 時に gpg で decrypt されて mount される
$ ~/.local/bin/dbxfs ~/fuse/dbxfs
Running 'gpg --decrypt /home/matoken/.config/dbxfs/token.gpg' for access token
gpg: 4096-ビットRSA鍵, ID EAA13B982D937827, 日付2015-06-11に暗号化されました
	  "K.I.Matohara <>"
$ mount|grep dbxfs
dbxfs on /home/matoken/fuse/dbxfs type fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000,default_permissions)
$ ls /home/matoken/fuse/dbxfs
$ fusermount -u ~/fuse/dbxfs

うまくいきました :)

$ grep ^Version: ~/.local/lib/python3.6/site-packages/dbxfs-1.0.4.dist-info/METADATA
Version: 1.0.4
$ dpkg-query -W gpg libfuse2 python3-pip
gpg     2.2.10-2
libfuse2:amd64  2.9.8-2
python3-pip     9.0.1-2.3
$ lsb_release -d
Description:    Debian GNU/Linux unstable (sid)
$ uname -m

macOS, Linux で Dropbox を fuse mount する dbxfs を少し試す

Dropbox を FUSE mount 出来る dbxfs というものを見つけたので試してみました.

Doropbox の Linux client はファイルシステムがext4のみと制限されます.dbxfs であればおそらくこの制限も問題ないのではないかと思います.(未確認)

The Dropbox folder will need to be on an ext4-formatted hard drive or partition
Note: ecryptfs is not supported, but Dropbox will continue to sync with supported file systems that are encrypted via full disk encryption (e.g. LUKS)

$ sudo apt install libfuse2 python3-pip
$ ~/.local/bin/dbxfs -h
usage: dbxfs [-h] [-f] [-v] [-s] [-n] [-l SMB_LISTEN_ADDRESS] [-c CONFIG_FILE]
			 [-e ENCRYPTED_FOLDERS] [--print-default-config-file]

positional arguments:

optional arguments:
  -h, --help            show this help message and exit
  -f, --foreground      keep filesystem server in foreground
  -v, --verbose         show log messages, use twice for maximum verbosity
  -s, --smb             force mounting via SMB
  -n, --smb-no-mount    export filesystem via SMB but don't mount it
  -l SMB_LISTEN_ADDRESS, --smb-listen-address SMB_LISTEN_ADDRESS
						address that SMB service should listen on, append
						colon to specify port
  -c CONFIG_FILE, --config-file CONFIG_FILE
						config file path
						relative paths of encrypted folders, can be used
						multiple times. requires safefs
						print default config file path to standard out and
$ ~/.local/bin/dbxfs ~/fuse/dbxfs
We need an access token. Perform the following steps:
1. Go to
2. Click "Allow" (you may have to log in first)
3. Copy the authorization code.
Enter authoritization code (Ctrl-C to quit): NodigIOndefkiwitshOrackazEuweavirtyedCibEdI
We're all connected. Do you want to save your credentials for future runs? [Y/n] Y
Would you like to help us improve dbxfs by providing anonymous error reports? [Y/n] Y
Mount point "/home/matoken/fuse/dbxfs" doesn't exist, do you want to create it? [Y/n] Y
  1. のurl をブラウザで開いて認証を行う
    認証後の画面で cli-dbxfs のアクセスを許可する.

45084023501 7cfd7c4058

許可後に表示されるトークンを 3. の後ろにコピー&ペーストする.

  • We’re all connected. Do you want to save your credentials for future runs?
  • Would you like to help us improve dbxfs by providing anonymous error reports?
  • Mount point “/home/matoken/fuse/dbxfs” doesn’t exist, do you want to create it?
$ ls ~/fuse/dbxfs/
$ fusermount -u ~/fuse/dbxfs
$ ~/.local/bin/dbxfs ~/fuse/dbxfs



EDIT: やはり使い方が間違っていた.次の記事に書いた -> Dropbox を FUSE mount する dbxfs のアクセストークンを gpg で暗号化する – matoken’s meme

$ ~/.local/bin/dbxfs --print-default-config-file
$ jq . /home/matoken/.config/dbxfs/config.json
  "keyring_user": "yigwulbaf6shnutugaivkilj",
  "send_error_reports": true,
  "asked_send_error_reports": true
$ gpg -r EAA13B982D937827 -e /home/matoken/.config/dbxfs/config.json
$ ls -l /home/matoken/.config/dbxfs/config.json*
-rw-r--r-- 1 matoken matoken 115 10月  4 07:19 /home/matoken/.config/dbxfs/config.json
-rw-r--r-- 1 matoken matoken 685 10月  4 07:22 /home/matoken/.config/dbxfs/config.json.gpg
$ shred /home/matoken/.config/dbxfs/config.json
$ echo '"access_token_command": ["gpg", "--decrypt", "/home/matoken/.config/dbxfs/config.json.gpg"]' > /home/matoken/.config/dbxfs/config.json
$ ~/.local/bin/dbxfs ~/fuse/dbxfs
Running 'gpg --decrypt /home/matoken/.config/dbxfs/config.json.gpg' for access token
gpg: 4096-ビットRSA鍵, ID EAA13B982D937827, 日付2015-06-11に暗号化されました
      "K.I.Matohara <>"
Traceback (most recent call last):
  File "/home/matoken/.local/bin/dbxfs", line 11, in <module>
  File "/home/matoken/.local/lib/python3.6/site-packages/dbxfs/", line 212, in main
  File "/home/matoken/.local/lib/python3.6/site-packages/dropbox/", line 4245, in users_get_current_account
  File "/home/matoken/.local/lib/python3.6/site-packages/dropbox/", line 274, in request
  File "/home/matoken/.local/lib/python3.6/site-packages/dropbox/", line 365, in request_json_string_with_retry
  File "/home/matoken/.local/lib/python3.6/site-packages/dropbox/", line 449, in request_json_string
  File "/home/matoken/.local/lib/python3.6/site-packages/requests/", line 559, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/home/matoken/.local/lib/python3.6/site-packages/requests/", line 498, in request
    prep = self.prepare_request(req)
  File "/home/matoken/.local/lib/python3.6/site-packages/requests/", line 441, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/home/matoken/.local/lib/python3.6/site-packages/requests/", line 310, in prepare
  File "/home/matoken/.local/lib/python3.6/site-packages/requests/", line 444, in prepare_headers
  File "/home/matoken/.local/lib/python3.6/site-packages/requests/", line 941, in check_header_validity
    raise InvalidHeader("Invalid return character or leading space in header: %s" % name)
requests.exceptions.InvalidHeader: Invalid return character or leading space in header: Authorization


$ grep ^Version: ~/.local/lib/python3.6/site-packages/dbxfs-1.0.4.dist-info/METADATA
Version: 1.0.4
$ dpkg-query -W libfuse2 python3-pip
libfuse2:amd64  2.9.8-2
python3-pip     9.0.1-2.3
$ lsb_release -d
Description:    Debian GNU/Linux unstable (sid)
$ uname -m