RaspberryPiからRaspberryPiへのファイル転送




成程わからん!だったSCPコマンドの使い方を学んだ!!

ついでにnanoエディタでUndoRedo出来る設定を理解した!!!

デフォルト設定なんて要らなかったんや……!!!!!
というかUndoも出来ないエディタ設定とかクソ以外の何物でもないやん???みんな疑問に思わんの???(蘇るボカロエディタでのUndo1回制限)

まずはここを参考にした:
誰も興味が無いnanoの基礎の基礎 - nanoはpicoの千倍なの! – http://techblog.kayac.com/nano-tutorial.html

つぎに、此処を見に行った:NANORC https://www.nano-editor.org/dist/v2.1/nanorc.5.html

Google翻訳大先生のお蔭で、nanorcのマニュアルも大体日本語化できるので、設定をそれぞれ弄った。

raspbianの場合のフォルダのパスは/etc/nanorcである。推奨は~/.nanorcとしてユーザーディレクトリに保持するスタイル。しかしUndoも出来ない(ry とかってななしのようなクラスタはとりあえず、
$cp /etc/nanorc /etc/nanorc.orig
とかやって複製をしたうえで好き放題にいじるがよろし。
(肝心のUndoコマンドはEsc-Uである)

## Use auto-indentation.
set autoindent

## Backup files to filename~.
set backup

## The directory to put unique backup files in.
set backupdir “~/Backup”

## The characters treated as closing brackets when justifying
## paragraphs. They cannot contain blank characters. Only closing
## punctuation, optionally followed by closing brackets, can end
## sentences.
##
set brackets “”‘)>]}”

## Enable ~/.nano_history for saving and reading search/replace strings.
set historylog

## The opening and closing brackets that can be found by bracket
## searches. They cannot contain blank characters. The former set must
## come before the latter set, and both must be in the same order.
##
set matchbrackets “(<[{)>]}”

## Use the blank line below the titlebar as extra editing space.
# set morespace

## Enable mouse support, if available for your system. When enabled,
## mouse clicks can be used to place the cursor, set the mark (with a
## double click), and execute shortcuts. The mouse will work in the X
## Window System, and on the console when gpm is running.
##
# set mouse

## Allow multiple file buffers (inserting a file will put it into a
## separate buffer). You must have configured with –enable-multibuffer
## for this to work.
##
set multibuffer

## Don’t convert files from DOS/Mac format.
# set noconvert

## Don’t follow symlinks when writing files.
# set nofollow

## Don’t display the helpful shortcut lists at the bottom of the screen.
# set nohelp

## Don’t add newlines to the ends of files.
# set nonewlines

## Don’t wrap text at all.
set nowrap

# Set operating directory. nano will not read or write files outside
## this directory and its subdirectories. Also, the current directory
## is changed to here, so any files are inserted from this dir. A blank
## string means the operating directory feature is turned off.
##
# set operatingdir “”

## Preserve the XON and XOFF keys (^Q and ^S).
# set preserve

## The characters treated as closing punctuation when justifying
## paragraphs. They cannot contain blank characters. Only closing
## punctuation, optionally followed by closing brackets, can end
## sentences.
##
# set punct “!.?”

## Do quick statusbar blanking. Statusbar messages will disappear after
## 1 keystroke instead of 26. Note that “const” overrides this.
##
# set quickblank

## The email-quote string, used to justify email-quoted paragraphs.
## This is an extended regular expression if your system supports them,
## otherwise a literal string. Default:
# set quotestr “^([ ]*[#:>\|}])+”
## if you have extended regular expression support, otherwise:
# set quotestr “> ”

## Fix Backspace/Delete confusion problem.
# set rebinddelete

## Fix numeric keypad key confusion problem.
# set rebindkeypad

## Do extended regular expression searches by default.
set regexp

## Make the Home key smarter. When Home is pressed anywhere but at the
## very beginning of non-whitespace characters on a line, the cursor
## will jump to that beginning (either forwards or backwards). If the
## cursor is already at that position, it will jump to the true
## beginning of the line.
# set smarthome

## Use smooth scrolling as the default.
set smooth

## Use this spelling checker instead of the internal one. This option
## does not properly have a default value.
##
# set speller “aspell -x -c”

## Allow nano to be suspended.
set suspend

## Use this tab size instead of the default; it must be greater than 0.
set tabsize 4

## Convert typed tabs to spaces.
# set tabstospaces

## Save automatically on exit, don’t prompt.
# set tempfile

## Disallow file modification. Why would you want this in an rcfile? 😉
# set view

## The two single-column characters used to display the first characters
## of tabs and spaces. 187 in ISO 8859-1 (0000BB in Unicode) and 183 in
## ISO-8859-1 (0000B7 in Unicode) seem to be good values for these.
# set whitespace ” ”

という感じで編集したった。ほかの環境ではこの記述の下にあるシンタックスハイライトが無効化されているらしいが、Raspbianでなくともシンタックスハイライトはあったほうが絶対に良いので、include~文の頭の#は消しておくと宜しい。

さて……SCPである。

$scp -P [ポート番号] [ユーザ名]@[IPアドレス]:[ディレクトリ]/.nanorc .
でコピーしたのですが。
(Ex:$scp -P 22 pi@192.168.0.1:/home/pi/.nanorc .)

Webの記述を参考にするには、これはクライアントマシンからサーバーマシンに接続して貰ってくる記述。

$scp -P [ポート番号] [ディレクトリ]/.nanorc [ユーザ名]@[IPアドレス]:[コピー先]
(Ex:$scp -P 22 /home/pi/.nanorc pi@192.168.0.1:/home/pi/)

んで、こっちだとサーバー側から配信する記述。

今後はこれにお世話になりたい所ですな……
 




Tags:, , ,

This entry was posted on 月曜日, 3月 27th, 2017 at 00:45 and is filed under Raspi.

You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Comments are closed.