sync notes(auto)

This commit is contained in:
kaz Saita@raspi4 2024-02-22 21:15:35 +09:00
parent 168eceb6ce
commit ce9fc35272
83 changed files with 234 additions and 69 deletions

View file

@ -1,24 +0,0 @@
{
"editor.minimap.enabled": false,
"editor.wrappingIndent": "indent",
"editor.overviewRulerBorder": false,
"editor.codeActionsOnSave": {
"source.fixAll.markdownlint": true
},
"[markdown]": {
"editor.quickSuggestions": {
"comments": "on",
"strings": "on",
"other": "on"
}
},
"files.defaultLanguage": "markdown",
"markdownlint.config": {
"default": true,
"MD034": false,
"MD025": false,
"MD018": false
},
"svn.ignoreMissingSvnWarning": true
}

0
content/000000000002 全体的な書き方の方針.md Executable file → Normal file
View file

0
content/000000000003 journal(obsolete).md Executable file → Normal file
View file

View file

0
content/000000000010 フォルダとその使い方.md Executable file → Normal file
View file

0
content/201804221942 djm-450のudevログ.md Executable file → Normal file
View file

View file

0
content/201907231138 定番の電子部品.md Executable file → Normal file
View file

View file

0
content/202109100000 pacmanでpgp ERRORとなる時.md Executable file → Normal file
View file

View file

View file

0
content/202203082335 zetetlkasten.md Executable file → Normal file
View file

0
content/202308182205 ESP32 Selection Guide.md Executable file → Normal file
View file

0
content/202309031354 ESP32.md Executable file → Normal file
View file

0
content/202312061945 capture.md Executable file → Normal file
View file

0
content/20240121125457 venv.md Executable file → Normal file
View file

0
content/20240122223312 Reference Notes.md Executable file → Normal file
View file

View file

0
content/20240122231010 Literature Notes.md Executable file → Normal file
View file

0
content/20240122231152 Permanent Notes.md Executable file → Normal file
View file

0
content/20240122231403 Fleeting Notes.md Executable file → Normal file
View file

View file

View file

@ -81,50 +81,7 @@ $ sudo n latest
```
### Dropbox
Arm64 linuxは公式には対応していない
[Dropbox-Uploader](https://github.com/andreafabrizi/Dropbox-Uploader/) というbash scriptを使う
- rcloneを使う方法 [[20240222192025 Raspi4でrcloneを使う|Raspi4でrcloneを使う]] こっちのほうが良い。おすすめ
- Dropbox Uploaderを使う方法 [[20240222190405 Raspi4でDropboxを使う|Raspi4でDropboxを使う]] 遅いしsyncではなくdownloadなので、dropbox側で消したことを反映させるためには全消しが必要。いまいち
```
$ git clone https://github.com/andreafabrizi/Dropbox-Uploader.git
$ cd Dropbox-Uploader/
$ ls
CHANGELOG.md Dockerfile.pi dropShell.sh README.md
Dockerfile dropbox_uploader.sh LICENSE testUnit.sh
```
ここに入っている dropbox_updloader.shを実行してみると、指示が表示される。その通りにやる。
App nameはこのnoteの同期用なので、 "kazbo_note_sync" にした。
`3) Choose the type of access you need: App folder"` の所は、全体的に使いたいので、 `Full Dropbox`
```
$ ./dropbox_uploader.sh
This is the first time you run this script, please follow the instructions:
(note: Dropbox will change their API on 2021-09-30.
When using dropbox_uploader.sh configured in the past with the old API, have a look at README.md, before continue.)
1) Open the following URL in your Browser, and log in using your account: https://www.dropbox.com/developers/apps
2) Click on "Create App", then select "Choose an API: Scoped Access"
3) "Choose the type of access you need: App folder"
4) Enter the "App Name" that you prefer (e.g. MyUploader68212467426140), must be unique
Now, click on the "Create App" button.
5) Now the new configuration is opened, switch to tab "permissions" and check "files.metadata.read/write" and "files.content.read/write"
Now, click on the "Submit" button.
6) Now to tab "settings" and provide the following information:
App key: ****
App secret: ****
Open the following URL in your Browser and allow suggested permissions: https://www.dropbox.com/oauth2/authorize****
Please provide the access code: *****
> App key: ********
> App secret: '****
> Access code: '*****'. Looks ok? [y/N]: y
The configuration has been saved.
$
```
cf. [第54回「SORACOM応用編ラズベリーパイからDropboxへファイルをアップロード(1)Dropbox-Uploader」 | Device Plus - デバプラ](https://deviceplus.jp/raspberrypi/raspberrypi_entry_054/)

View file

View file

View file

View file

View file

View file

View file

View file

0
content/20240217161518 部分分数展開.md Executable file → Normal file
View file

View file

0
content/20240219173704 sandbox.md Executable file → Normal file
View file

View file

View file

@ -0,0 +1,96 @@
# 20240222190405 Raspi4でDropboxを使う
[[20240222192025 Raspi4でrcloneを使う|Raspi4でrcloneを使う]]の方法を推奨。こっちは遅いしイマイチ。
Arm64 linuxは公式には対応していない。
[Dropbox-Uploader](https://github.com/andreafabrizi/Dropbox-Uploader/) というbash scriptを使う。
```
$ git clone https://github.com/andreafabrizi/Dropbox-Uploader.git
$ cd Dropbox-Uploader/
$ ls
CHANGELOG.md Dockerfile.pi dropShell.sh README.md
Dockerfile dropbox_uploader.sh LICENSE testUnit.sh
```
ここに入っている dropbox_updloader.shを実行してみると、指示が表示される。その通りにやる。
App nameはこのnoteの同期用なので、 "kazbo_note_sync" にした。
`3) Choose the type of access you need: App folder"` の所は、全体的に使いたいので、 `Full Dropbox`を選択。
```
$ ./dropbox_uploader.sh
This is the first time you run this script, please follow the instructions:
(note: Dropbox will change their API on 2021-09-30.
When using dropbox_uploader.sh configured in the past with the old API, have a look at README.md, before continue.)
1) Open the following URL in your Browser, and log in using your account: https://www.dropbox.com/developers/apps
2) Click on "Create App", then select "Choose an API: Scoped Access"
3) "Choose the type of access you need: App folder"
4) Enter the "App Name" that you prefer (e.g. MyUploader68212467426140), must be unique
Now, click on the "Create App" button.
5) Now the new configuration is opened, switch to tab "permissions" and check "files.metadata.read/write" and "files.content.read/write"
Now, click on the "Submit" button.
6) Now to tab "settings" and provide the following information:
App key: ****
App secret: ****
Open the following URL in your Browser and allow suggested permissions: https://www.dropbox.com/oauth2/authorize****
Please provide the access code: *****
> App key: ********
> App secret: '****
> Access code: '*****'. Looks ok? [y/N]: y
The configuration has been saved.
$
```
```
$ ./Dropbox-Uploader/dropbox_uploader.sh list /
> Listing "/"... DONE
[D] hoge
[D] fuga
[D] ...
```
などと表示されたので良さそう。 このトークンが12時間とかで切れないかは確認していない。
使い方は以下の感じ。
```
$ ./Dropbox-Uploader/dropbox_uploader.sh
Dropbox Uploader v1.0
Andrea Fabrizi - andrea.fabrizi@gmail.com
Usage: ./Dropbox-Uploader/dropbox_uploader.sh [PARAMETERS] COMMAND...
Commands:
upload <LOCAL_FILE/DIR ...> <REMOTE_FILE/DIR>
download <REMOTE_FILE/DIR> [LOCAL_FILE/DIR]
delete <REMOTE_FILE/DIR>
move <REMOTE_FILE/DIR> <REMOTE_FILE/DIR>
copy <REMOTE_FILE/DIR> <REMOTE_FILE/DIR>
mkdir <REMOTE_DIR>
list [REMOTE_DIR]
monitor [REMOTE_DIR] [TIMEOUT]
share <REMOTE_FILE>
saveurl <URL> <REMOTE_DIR>
search <QUERY>
info
space
unlink
Optional parameters:
-f <FILENAME> Load the configuration file from a specific file
-s Skip already existing files when download/upload. Default: Overwrite
-d Enable DEBUG mode
-q Quiet mode. Don't show messages
-h Show file sizes in human readable format
-p Show cURL progress meter
-k Doesn't check for SSL certificates (insecure)
-x Ignores/excludes directories or files from syncing. -x filename -x directoryname. example: -x .git
For more info and examples, please see the README file.
```
cf. [第54回「SORACOM応用編ラズベリーパイからDropboxへファイルをアップロード(1)Dropbox-Uploader」 | Device Plus - デバプラ](https://deviceplus.jp/raspberrypi/raspberrypi_entry_054/)

View file

@ -0,0 +1,136 @@
# 20240222192025 Raspi4でrcloneを使いdropboxと同期
#rclone #raspi
## rclone何
色々なオンラインストレージと同期できるコマンドラインプログラム。
[Rclone](https://rclone.org/)
> Rclone is a command-line program to manage files on cloud storage. It is a feature-rich alternative to cloud vendors' web storage interfaces. [Over 70 cloud storage products](https://rclone.org/#providers) support rclone including S3 object stores, business & consumer file storage services, as well as standard transfer protocols.
## インストール
goが必要かも。 [[20240205152229 raspi4にgoをインストールする|raspi4にgoをインストールする]] を参照。
[Rclone downloads](https://rclone.org/downloads/) から、該当のものをダウンロードする。
Raspi4の場合、 ARM - 64 Bit。 Raspberry Pi OS の場合は.debが該当。
こんな感じ。バージョンなどは適宜読みかえる。
```
$ wget https://downloads.rclone.org/v1.65.2/rclone-v1.65.2-linux-arm64.deb
wget https://downloads.rclone.org/v1.65.2/rclone-v1.65.2-linux-arm64.deb
--2024-02-22 19:17:52-- https://downloads.rclone.org/v1.65.2/rclone-v1.65.2-linux-arm64.deb
Resolving downloads.rclone.org (downloads.rclone.org)... 2a01:4f9:c012:7154::1, 95.217.6.16
Connecting to downloads.rclone.org (downloads.rclone.org)|2a01:4f9:c012:7154::1|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 19388190 (18M) [application/vnd.debian.binary-package]
Saving to: rclone-v1.65.2-linux-arm64.deb
rclone-v1.65.2-linux-a 100%[===========================>] 18.49M 4.89MB/s in 3.8s
2024-02-22 19:17:57 (4.89 MB/s) - rclone-v1.65.2-linux-arm64.deb saved [19388190/19388190]
$ sudo dpkg -i rclone-v1.65.2-linux-arm64.deb
Selecting previously unselected package rclone.
(Reading database ... 114658 files and directories currently installed.)
Preparing to unpack rclone-v1.65.2-linux-arm64.deb ...
Unpacking rclone (1.65.2) ...
Setting up rclone (1.65.2) ...
Processing triggers for man-db (2.11.2-2) ...
```
## 設定
[Dropbox](https://rclone.org/dropbox/) に書いてある通りにやる。・・・が、CUIにsshアクセスしていて、ブラウザが起動できないので、リモートで設定とauthなどをして、それを貼りつける必要がある。
```
[ここはwindows上のwsl2でやった。windowsやmacでも可能。]
$ rclone authorize "dropbox"
2024/02/22 19:38:27 NOTICE: If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=***
[ここで上記URLにアクセス。ローカルホストからでないと接続が拒否されるので注意。wslg+firefoxなどが設定してある必要がある。許可ボタンを押す。]
2024/02/22 19:38:27 NOTICE: Log in and authorize rclone for access
2024/02/22 19:38:27 NOTICE: Waiting for code...
2024/02/22 19:38:51 NOTICE: Got code
Paste the following into your remote machine --->
.....
<---End paste
```
などと表示されるので、 ... をコピー。
```
$ rclone config
No remotes found, make a new one?
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
Enter name for new remote.
name> remote
Option Storage.
Type of storage to configure.
Choose a number from below, or type in your own value.
.
.
.
13 / Dropbox
\ (dropbox)
Storage> [13]
client_id> [ENTER]
client_secret> [ENTER]
Edit advanced config?
y) Yes
n) No (default)
y/n> [ENTER]
Use web browser to automatically authenticate rclone with remote?
* Say Y if the machine running rclone has a web browser you can use
* Say N if running rclone on a (remote) machine without web browser access
If not sure try Y. If Y failed, try N.
y) Yes (default)
n) No
y/n> n
Option config_token.
For this to work, you will need rclone available on a machine that has
a web browser available.
For more help and alternate methods see: https://rclone.org/remote_setup/
Execute the following on the machine with the web browser (same rclone
version recommended):
rclone authorize "dropbox"
Then paste the result.
Enter a value.
config_token> [コピーした内容をペースト]
Configuration complete.
Options:
- type: dropbox
- token: {"****"}
Keep this "remote" remote?
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> [y]
Current remotes:
Name Type
==== ====
remote dropbox
e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> [q]
```
ここまでで設定できている。
```
$ rclone lsd remote:
```
などと打ってみて、それらしきリストが表示されればOK。 `remote:` と : がつくので注意。

0
content/assets/2023-08-18-22-14-24.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 925 KiB

After

Width:  |  Height:  |  Size: 925 KiB

0
content/assets/2023-08-18-22-14-27.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 925 KiB

After

Width:  |  Height:  |  Size: 925 KiB

0
content/assets/2023-08-18-22-15-01.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 423 KiB

After

Width:  |  Height:  |  Size: 423 KiB

0
content/assets/2023-08-18-22-15-52.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 357 KiB

After

Width:  |  Height:  |  Size: 357 KiB

0
content/assets/2023-08-18-22-16-31.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 317 KiB

After

Width:  |  Height:  |  Size: 317 KiB

0
content/assets/2023-08-18-22-17-38.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 350 KiB

After

Width:  |  Height:  |  Size: 350 KiB

0
content/assets/2023-10-20-15-38-20.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 124 KiB

0
content/assets/Pasted image 20231227205803 1.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

0
content/assets/Pasted image 20231227205845 1.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 380 KiB

After

Width:  |  Height:  |  Size: 380 KiB

0
content/assets/Pasted image 20240104153016.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

0
content/assets/Pasted image 20240107194755.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

0
content/assets/Pasted image 20240107220208.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

0
content/assets/Pasted image 20240107220307.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 149 KiB

After

Width:  |  Height:  |  Size: 149 KiB

0
content/assets/Pasted image 20240107221053.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 829 KiB

After

Width:  |  Height:  |  Size: 829 KiB

0
content/assets/Pasted image 20240130170437.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

0
content/assets/Pasted image 20240205153644.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

0
content/assets/Pasted image 20240205205804.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

0
content/assets/Pasted image 20240205211828.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 154 KiB

After

Width:  |  Height:  |  Size: 154 KiB

0
content/assets/Pasted image 20240211191414.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

0
content/assets/Pasted image 20240211193442.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 86 KiB

0
content/assets/Pasted image 20240211195107.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 111 KiB

After

Width:  |  Height:  |  Size: 111 KiB

0
content/assets/Pasted image 20240212185558.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

0
content/assets/Pasted image 20240215205717.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

0
content/assets/Pasted image 20240215212253.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 114 KiB

0
content/assets/image20231228101217_0.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 238 KiB

After

Width:  |  Height:  |  Size: 238 KiB

0
content/assets/image20240208114549_0.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 251 KiB

After

Width:  |  Height:  |  Size: 251 KiB

0
content/assets/image20240217115206_0.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 539 KiB

After

Width:  |  Height:  |  Size: 539 KiB

View file

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

0
content/index.md Executable file → Normal file
View file