{ "version": "https://jsonfeed.org/version/1.1", "user_comment": "This feed allows you to read the posts from this site in any feed reader that supports the JSON Feed format. To add this feed to your reader, copy the following URL -- https://matoken.org/blog/tag/skicka/feed/json/ -- and add it your reader.", "home_page_url": "https://matoken.org/blog/tag/skicka/", "feed_url": "https://matoken.org/blog/tag/skicka/feed/json/", "language": "ja", "title": "skicka – matoken's blog", "description": "Is there no plan B?", "icon": "https://matoken.org/blog/wp-content/uploads/2025/03/cropped-1865f695c4eecc844385acef2f078255036adccd42c254580ea3844543ab56d9.jpeg", "items": [ { "id": "http://matoken.org/blog/?p=2214", "url": "https://matoken.org/blog/2018/11/05/try-skicka-to-access-google-drive-with-command-line/", "title": "Google\u30c9\u30e9\u30a4\u30d6\u306b\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308bskicka\u3092\u8a66\u3059", "content_html": "
Google\u30c9\u30e9\u30a4\u30d6\u306b\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b skicka \u3092\u5c11\u3057\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\uff0e
\n$ GOPATH=~/go\r\n$ PATH=${PATH}:~/go/bin\n$ go get github.com/google/skicka\n
skicka\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\uff0e
\ninit \u30b3\u30de\u30f3\u30c9\u3067\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u751f\u6210\u3057\u307e\u3059\uff0e
\n\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306f ~/.skicka.config \u3068\u3057\u3066\u4f5c\u308c\u308c\u307e\u3059\uff0e
\n\u6b21\u306bls\u30b3\u30de\u30f3\u30c9\u3092\u767a\u884c\u3057\u307e\u3059\uff0e\u521d\u56de\u5b9f\u884c\u6642\u306b\u306f\u30a6\u30a7\u30d6\u30d6\u30e9\u30a6\u30b6\u304c\u8d77\u52d5\u3057\u3066\u8a8d\u8a3c\u51e6\u7406\u304c\u8d70\u308a\u307e\u3059\uff0e\u8a31\u53ef\u3059\u308b\u3068\u81ea\u52d5\u7684\u306b\u8a8d\u8a3c\u304c\u5b8c\u4e86\u3057\u3066ls\u51e6\u7406\u304c\u8d70\u308a\u307e\u3059\uff0e
\n\u8a8d\u8a3c\u60c5\u5831\u306f`~/.skicka.tokencache.json` \u306b\u4fdd\u5b58\u3055\u308c\u307e\u3059\uff0e
\nls\u5b9f\u884c\u6642\u306b\u6b21\u56de\u4ee5\u964d\u306e\u305f\u3081\u306b\u30e1\u30bf\u30c7\u30fc\u30bf\u3092\u4f5c\u6210\u3057\u307e\u3059\uff0e\u30d5\u30a1\u30a4\u30eb\u304c\u591a\u3044\u3068\u6642\u9593\u304c\u304b\u304b\u308a\u307e\u3059\uff0e\u30d7\u30ed\u30b0\u30ec\u30b9\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3057\u3070\u3089\u304f\u5f85\u3061\u307e\u3057\u3087\u3046\uff0e
\n\u30e1\u30bf\u30c7\u30fc\u30bf\u306f ~/.skicka.metadata.cache \u306b\u4fdd\u5b58\u3055\u308c\u307e\u3059\uff0e
$ skicka init\r\n$ skicka ls\n
\u30b5\u30fc\u30d0\u306a\u3069\u3067\u30a6\u30a7\u30d6\u30d6\u30e9\u30a6\u30b6\u3092\u8d77\u52d5\u3059\u308b\u306e\u304c\u96e3\u3057\u3044\u5834\u5408\u306f -no-browser-auth \u3092 ls \u30b3\u30de\u30f3\u30c9\u306e \u524d \u306b\u4ed8\u3051\u3066\u8d77\u52d5\u3059\u308b\u3068\u8a8d\u8a3cURL\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u305d\u308c\u3092\u64cd\u4f5cPC\u306a\u3069\u3067\u958b\u3044\u3066\u8a8d\u8a3c\u3092\u884c\u3044\uff0c\u8868\u793a\u3055\u308c\u305f\u8a8d\u8a3c\u30b3\u30fc\u30c9\u3092\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u306b\u8cbc\u308a\u4ed8\u3051\u307e\u3059\uff0e
$ skicka -no-browser-auth ls\r\nGo to the following link in your browser:\r\nhttps://accounts.google.com/o/oauth2/auth?client_id=952283912845-sjotrejbktpinel08hrnspl33d8gho1e.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&state=st1541320926479298710\r\nEnter verification code: 4/iwBrjQFEvm2p0nQGXJuRQgTZFZZ6BmXkT7Up7Wl3UYS7NWEyiltTc6E\n
$ ~/go/bin/skicka\r\nusage: skicka [skicka options] <command> [command options]\r\n\r\nSupported commands are:\r\n cat Print the contents of the given file\r\n download Download a file or folder hierarchy from Drive to the local disk\r\n df Display free space on Drive\r\n du Report disk usage for a folder hierarchy on Drive\r\n fsck Check consistency of files in Drive and local metadata cache\r\n genkey Generate a new encryption key\r\n init Create an initial skicka configuration file\r\n ls List the contents of a folder on Google Drive\r\n mkdir Create a new folder or folder hierarchy on Drive\r\n rm Remove a file or folder on Google Drive\r\n upload Upload a local file or directory hierarchy to Drive\r\n\r\n'skicka help' prints more detailed documentation.\n
$ ~/go/bin/skicka help [45/2151]\r\nskicka is a tool for working with files and folders on Google Drive.\r\nSee http://github.com/google/skicka/README.md for information about getting started.\r\n\r\nusage: skicka [common options] <command> [command options]\r\n\r\nCommands and their options are:\r\n cat Print the contents of the Google Drive file to standard output.\r\n Arguments: drive_path ...\r\n\r\n download Recursively download either a single file, or all files from a\r\n Google Drive folder to a local directory. If the corresponding\r\n local file already exists and has the same contents as the its\r\n Google Drive file, the download is skipped.\r\n Arguments: [-ignore-times] [-download-google-apps-files]\r\n drive_path local_path\r\n\r\n df Prints the total space used and amount of available space on\r\n Google Drive.\r\n\r\n du Print the space used by the Google Drive folder and its children.\r\n Arguments: [drive_path ...]\r\n\r\n fsck [EXPERIMENTAL/NEW] Use at your own risk.\r\n Perform a number of consistency checks on files stored in Google\r\n Drive, including verifying metadata and removing duplicate files\r\n with the same name.\r\n Arguments: [--trash-duplicates] [drive_path]\r\n\r\n help Print this help text.\r\n\r\n genkey Generate a new key for encrypting files.\r\n\r\n init Create an initial ~/.skicka.config configuration file. (You\r\n will need to edit it before using skicka; see comments in the\r\n configuration file for details.)\r\n\r\n ls List the files and directories in the given Google Drive folder. [8/2151]\r\n Arguments: [-d, -l, -ll, -r] [drive_path ...],\r\n where -l and -ll specify long (including sizes and update\r\n times) and really long output (also including MD5 checksums),\r\n respectively. The -r argument causes ls to recursively list\r\n all files in the hierarchy rooted at the base directory, and\r\n -d causes directories specified on the command line to be\r\n listed as files (i.e., their contents aren't listed.)\r\n\r\n mkdir Create a new directory (folder) at the given Google Drive path.\r\n Arguments: [-p] drive_path ...,\r\n where intermediate directories in the path are created if -p is\r\n specified.\r\n\r\n rm Remove a file or directory at the given Google Drive path.\r\n Arguments: [-r, -s] drive_path ...,\r\n where files and directories are recursively removed if -r is\r\n specified and the google drive trash is skipped if -s is\r\n specified. The default behavior is to fail if the drive path\r\n specified is a directory and -r is not specified, and to send\r\n files to the trash instead of permanently deleting them.\r\n\r\n upload Uploads all files in the local directory and its children to the\r\n given Google Drive path. Skips files that have already been\r\n uploaded.\r\n Arguments: [-ignore-times] [-encrypt] [-follow-symlinks <maxdepth>]\r\n local_path drive_path\r\n\r\nOptions valid for both \"upload\" and \"download\":\r\n -dry-run Don't actually upload or download, but print the paths of\r\n all files that would be transferred.\r\n -ignore-times Normally, skicka assumes that if the timestamp of a local\r\n file matches the timestamp of the file on Drive and the\r\n files have the same size, then it isn't necessary to\r\n confirm that the file contents match. The -ignore-times\r\n flag can be used to force checking file contents in this\r\n case.\r\n\r\nGeneral options valid for all commands:\r\n -config <filename> General skicka configuration file. Default: ~/.skicka.config.\r\n -debug Enable debugging output.\r\n -dump-http Dump http traffic.\r\n -metadata-cache-file <filename>\r\n File to store metadata about Google Drive contents.\r\n Default: ~/.skicka.metadata.cache\r\n -no-browser-auth Disables attempting to open the authorization URL in a web\r\n browser when initially authorizing skicka to access Google Drive.\r\n -quiet Suppress non-error messages.\r\n -tokencache <filename> OAuth2 token cache file. Default: ~/.skicka.tokencache.json.\r\n -verbose Enable verbose output.\n
$ skicka upload ~/Pictures/$(ls -tr1 ~/Pictures/|tail -1) /\r\nFiles: 14.41 KiB / 14.41 KiB [====================================================================================================================] 100.00% 3s\r\n2018/11/04 17:45:32 Preparation time 1s, sync time 3s\r\n2018/11/04 17:45:32 Updated 1 Drive files, 0 local files\r\n2018/11/04 17:45:32 14.41 kiB read from disk, 0 B written to disk\r\n2018/11/04 17:45:32 14.41 kiB uploaded (3.98 kiB/s), 0 B downloaded (0 B/s)\r\n2018/11/04 17:45:32 52.08 MiB peak memory used\n
$ skicka ls|grep jpg\r\n20180307_23:03:21-10889.jpg\r\n20180307_23:03:21-10889.jpg\r\n20181104_17:11:45-30082.jpg\n
$ skicka rm 20181104_17:11:45-30082.jpg\r\n$ diff ~/Pictures/20181104_17:11:45-30082.jpg /tmp/20181104_17:11:45-30082.jpg\r\n$ ls -l ~/Pictures/20181104_17:11:45-30082.jpg /tmp/20181104_17:11:45-30082.jpg\r\n-rw-r--r-- 1 matoken matoken 14760 11\u6708 4 17:41 /home/matoken/Pictures/20181104_17:11:45-30082.jpg\r\n-rw-r--r-- 1 matoken matoken 14760 11\u6708 4 17:41 /tmp/20181104_17:11:45-30082.jpg\n
$ skicka rm /20181104_17:11:45-30082.jpg\n
skicka\u306b\u306f\u6697\u53f7\u5316\u6a5f\u80fd\u304c\u3042\u308a\u307e\u3059\uff0eupload\u6642\u306b -encrypt \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4ed8\u4e0e\u3059\u308b\u3053\u3068\u306b\u3088\u308a\u30d5\u30a1\u30a4\u30eb\u3092\u6697\u53f7\u5316\u3057\u3066Google\u30c9\u30e9\u30a4\u30d6\u306b\u4fdd\u5b58\u3067\u304d\u307e\u3059\uff0e\u305d\u306e\u305f\u3081\u306b\u306f\u6e96\u5099\u304c\u5fc5\u8981\u3067\u3059\uff0e
\nSKICKA_PASSPHRASE \u3068\u3044\u3046\u74b0\u5883\u5909\u6570\u306b\u30d1\u30b9\u30d5\u30ec\u30fc\u30ba\u3092\u8a2d\u5b9a\u3057\u305f\u72b6\u614b\u3067\uff0cskicka genkey \u3092\u5b9f\u884c\u3057\u3066\u751f\u6210\u3055\u308c\u305f\u60c5\u5831\u3092\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e ~/.skicka.config \u306b\u66f8\u304d\u8fbc\u307f\u307e\u3059\uff0e
$ read -sp \"skicka pass: \" SKICKA_PASSPHRASE && export SKICKA_PASSPHRASE && skicka genkey\r\nskicka pass: ; Add the following lines to the [encryption] section\r\n; of your ~/.skicka.config file.\r\n salt=62cd4c08693c935f35c45be5261907127ef14055f197bb19bae36616fedecb54\r\n passphrase-hash=23f702efce4fe7bf775d3bc80f07e2a765589016b537bf322ed5e0c8f2f6ce90\r\n encrypted-key=463c9c75b3aa98e5401bb5fde6d681f8053d39d3e5ce49ef22bcc58977736162\r\n encrypted-key-iv=d2533e58f6c9bb976a66d499280ce8c2\n
$ vi ~/.skicka.config\r\n$ grep -A5 encryption ~/.skicka.config\r\n[encryption]\r\n ; Run 'skicka genkey' to generate an encyption key.\r\n salt=62cd4c08693c935f35c45be5261907127ef14055f197bb19bae36616fedecb54\r\n passphrase-hash=23f702efce4fe7bf775d3bc80f07e2a765589016b537bf322ed5e0c8f2f6ce90\r\n encrypted-key=463c9c75b3aa98e5401bb5fde6d681f8053d39d3e5ce49ef22bcc58977736162\r\n encrypted-key-iv=d2533e58f6c9bb976a66d499280ce8c2\n
upload\u6642\u306b -encrypt \u3092\u6307\u5b9a\u3059\u308b\u3068\u6697\u53f7\u5316\u3055\u308c\uff0c.aes256 \u3068\u3044\u3046\u62e1\u5f35\u5b50\u4ed8\u304d\u3067\u4fdd\u5b58\u3055\u308c\u307e\u3059\uff0e
$ skicka mkdir encryption\r\n$ skicka upload -encrypt ~/Pictures/20181105_19\\:11\\:18-8911.jpg /encryption/\r\n$ skicka ls /encryption/\r\n20181105_19:11:18-8911.jpg.aes256\n
\u5143\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3067\u306f\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u305a\uff0c.aes256 \u62e1\u5f35\u5b50\u4ed8\u304d\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3067\u306f\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u305f\uff0e\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f .aes256 \u306e\u62e1\u5f35\u5b50\u4ed8\u304d\u306e\u307e\u307e\u3060\u304c\uff0c\u5fa9\u53f7\u3055\u308c\u3066\u3044\u308b\uff0e
$ skicka download /encryption/20181105_19:11:18-8911.jpg ./\r\nskicka: /encryption/20181105_19:11:18-8911.jpg: not found on Drive\r\n$ skicka download /encryption/20181105_19:11:18-8911.jpg.aes256 ./\r\n$ file ./20181105_19\\:11\\:18-8911.jpg.aes256\r\n./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\r\n3\r\n$ identify ./20181105_19\\:11\\:18-8911.jpg.aes256\r\n./20181105_19:11:18-8911.jpg.aes256 JPEG 933x600 933x600+0+0 8-bit sRGB 92988B 0.000u 0:00.000\r\n$ display ./20181105_19\\:11\\:18-8911.jpg.aes256\n
\u30a6\u30a7\u30d6\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u306f\u6697\u53f7\u5316\u3055\u308c\u3066\u3044\u308b\uff0e\u30c7\u30fc\u30bf\u91cf\u306f\u5c11\u3057\u5897\u3048\u3066\u3044\u308b\uff0e
\n$ file 20181105_19_11_18-8911.jpg.aes256.jpg.aes256\r\n20181105_19_11_18-8911.jpg.aes256.jpg.aes256: data\r\n$ ls -la 201811*\r\n-rw-r--r-- 1 matoken matoken 92988 11\u6708 5 19:30 20181105_19:11:18-8911.jpg.aes256\r\n-rw-r--r-- 1 matoken matoken 93004 11\u6708 5 21:46 20181105_19_11_18-8911.jpg.aes256.jpg.aes256\n
$ dpkg-query -W golang git bash\r\nbash 4.4.18-3.1\r\ngit 1:2.19.1-1\r\ngolang 2:1.10~5\r\n$ lsb_release -d\r\nDescription: Debian GNU/Linux unstable (sid)\r\n$ uname -m\r\nx86_64\n