sh/ネタ/クリップボードサーバーを作る
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
- 2021/05/12 サーバ側のコマンド修正
- 2021/05/13 事例追加
* TL;DR [#s7222f2e]
** サーバ側 [#v9e044e4]
# テキストを投げ込まれたらクリップボードに書き込む(win...
socat tcp-listen:7000,fork,reuseaddr /dev/clipboard &
# あるいはこれでも動く
while true; do socat tcp-listen:7000 /dev/clipboard || ...
** クライアント側 [#yd0d144a]
# クリップボードを取り出す
socat tcp-connect:192.168.33.1:7000 stdout | cat -n
# tmuxのバッファをクリップボードに投げつける
tmux save-buffer - | socat stdin tcp-connect:192.168.33...
# ファイルを投げつける
socat tcp-connect:192.168.33.1:7000 path/to/file
こういうエイリアスを作っておくと非常に便利
alias pbcopy='socat stdin tcp-connect:192.168.33.1:7000'
alias pbpaste='socat tcp-connect:192.168.33.1:7000 stdo...
* 何が出来るのか? [#l973c40d]
- linuxやMacから、WindowsPCにテキストを投げつける
- WindowsPCは受け取ったテキストをクリップボードに書き込む
* いつ役に立つのか? [#tcc0ea57]
- 母艦でVMをheadlessモードでCLIで操作している
- 母艦からsshでVMに繋ぎ、VM側でtmuxを動かしている
という、かなりレアな場合に便利かもしれません
* 参考 [#g81e25fc]
- [[socatを使ってソケットテストする:https://rcmdnk.com/bl...
- [[nc コマンドで簡易HTTPサーバ:http://blog.livedoor.jp/s...
* 追伸 [#qaa8bcb2]
mintty を使っている場合、こんなことしなくても ~/.minttyrc...
AllowSetSelection=true
- [[Copy console text in tmux:https://github.com/mintty/w...
- [[Cygwin (mintty) でサーバ上で実行しているtmuxからマウ...
終了行:
- 2021/05/12 サーバ側のコマンド修正
- 2021/05/13 事例追加
* TL;DR [#s7222f2e]
** サーバ側 [#v9e044e4]
# テキストを投げ込まれたらクリップボードに書き込む(win...
socat tcp-listen:7000,fork,reuseaddr /dev/clipboard &
# あるいはこれでも動く
while true; do socat tcp-listen:7000 /dev/clipboard || ...
** クライアント側 [#yd0d144a]
# クリップボードを取り出す
socat tcp-connect:192.168.33.1:7000 stdout | cat -n
# tmuxのバッファをクリップボードに投げつける
tmux save-buffer - | socat stdin tcp-connect:192.168.33...
# ファイルを投げつける
socat tcp-connect:192.168.33.1:7000 path/to/file
こういうエイリアスを作っておくと非常に便利
alias pbcopy='socat stdin tcp-connect:192.168.33.1:7000'
alias pbpaste='socat tcp-connect:192.168.33.1:7000 stdo...
* 何が出来るのか? [#l973c40d]
- linuxやMacから、WindowsPCにテキストを投げつける
- WindowsPCは受け取ったテキストをクリップボードに書き込む
* いつ役に立つのか? [#tcc0ea57]
- 母艦でVMをheadlessモードでCLIで操作している
- 母艦からsshでVMに繋ぎ、VM側でtmuxを動かしている
という、かなりレアな場合に便利かもしれません
* 参考 [#g81e25fc]
- [[socatを使ってソケットテストする:https://rcmdnk.com/bl...
- [[nc コマンドで簡易HTTPサーバ:http://blog.livedoor.jp/s...
* 追伸 [#qaa8bcb2]
mintty を使っている場合、こんなことしなくても ~/.minttyrc...
AllowSetSelection=true
- [[Copy console text in tmux:https://github.com/mintty/w...
- [[Cygwin (mintty) でサーバ上で実行しているtmuxからマウ...
ページ名: