Alt + F7 で画面が動かせるようになる。
● Ubuntu, 20.04, インストール, install, 画面, クリック, できない, display, click, ボタン, 押せない
主に Linux (Ubuntu, Fedora) 関連の設定メモ&小技集です。たまに Windows 関連ネタも。
(プロンプトの $ は一般ユーザ権限、# は root 権限です。いちいち説明はせんよ。)
Alt + F7 で画面が動かせるようになる。
● Ubuntu, 20.04, インストール, install, 画面, クリック, できない, display, click, ボタン, 押せない
古い PC の ssh サーバにログインしようとしたとき、key exchange method がマッチしないというエラーが出る。
その時の解決方法。
古い PC は、セキュリティー対応が追いついてないってことね。
エラーの例。
$ ssh 192.168.0.1 Unable to negotiate with 192.168.0.1 port 22: no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
~/.ssh/config に設定を追加。Host のところは適宜変更。
$ vi ~/.ssh/config
(下記を追加)
Host 192.168.0.1
KexAlgorithms +diffie-hellman-group14-sha1
● ssh, key exchange, 古い, サーバ, old, server, login, ログイン, できない
telnet コマンドが無いときの代替手段。
便宜上、22 番ポートにつないだ場合の例を書いてます。
curl -v telnet://
$ curl -v telnet://192.168.0.1:22 * Trying 192.168.0.1:22... * TCP_NODELAY set * Connected to 192.168.0.1 (192.168.0.1) port 22 (#0) SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.10
nc -v [destination] [port] で接続。
$ nc -v 192.168.0.1 22 Connection to 192.168.0.1 port [tcp/ssh] succeeded! SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.10
● telnet, 代替, curl, nc, alternative
proxy 経由で Gitlab に ssh で接続する設定メモ。
ssh の公開キーを Gitlab に登録するところは説明省略。
~/.ssh/config の設定箇所のみ。PROXY_HOST, PROXY_PORT は適切に変更。
$ vi ~/.ssh/config
(下記を追加)
Host gitlab.com
Hostname altssh.gitlab.com
IdentityFile ~/.ssh/id_rsa
Port 443
ProxyCommand nc -X connect -x PROXY_HOST:PROXY_PORT %h %p
確認。Welcome to GitLab が出れば OK。
$ ssh -T git@gitlab.com ... Welcome to GitLab, @USR_NAME
● Gitlab, gitlab, proxy, ssh, nc, id_rsa, キー, 設定
Ubuntu 20.04 で、X-mouse (focus follows mouse) の設定をする方法。
デスクトップ環境が Unity から GNOME に変わったので、やり方も変わってた。
$ gsettings set org.gnome.desktop.wm.preferences focus-mode 'mouse'
(参考) https://askubuntu.com/questions/64605/how-do-i-set-focus-follows-mouse
● Ubuntu, 20.04, X-Mouse, x-mouse, GNOME, gsettings, focus follows mouse, マウス, フォーカス, mouse, focus, アクティブ, active
Ctrl-d でログアウトしない設定。
今更ながらこのメモを書くのは、その設定になってないシステムがあって困ったからだ。
$ set -o ignoreeof
ちなみに、現在の設定を確認するのは、set -o
$ set -o allexport off braceexpand on emacs on errexit off errtrace off functrace off hashall on histexpand on history on ignoreeof on interactive-comments on keyword off monitor on noclobber on noexec off noglob off nolog off notify off nounset off onecmd off physical off pipefail off posix off privileged off verbose off vi off xtrace off
● Ctrl-d, ログアウト, logout, ignoreeof, させない, しない
$ unzip -l hogehoge.zip
$ unzip -c hogehoge.zip hoehoe.txt | less
● unzip, zip, less, 中身, 解凍, 解凍しない, 解凍せずに, 解凍せず
zip, tar.gz の中味までも ripgrep できる ripgrep-all。
これはいい。インストールは簡単。
(参考) https://github.com/phiresky/ripgrep-all
依存パッケージをインストール。
# apt install ripgrep pandoc poppler-utils ffmpeg
下記から、適当なリリースバージョンをダウンロードして解凍。
https://github.com/phiresky/ripgrep-all/tags
$ tar zxvf ripgrep_all-v0.9.6-x86_64-unknown-linux-musl.tar.gz $ cd ripgrep_all-v0.9.6-x86_64-unknown-linux-musl.tar.gz $ sudo cp rga rga-preproc /usr/bin/
rg のかわりに、rga を使えば OK。
$ rga hogehoge
● ripgrep, zip, tar.gz, rg, rga, rust, ripgrep-all
$ diff -qr --no-dereference aaa/ bbb/
● diff, no-dereference, シンボリックリンク
Emacs のコピー/ペーストをシステムのコピー/ペーストに反映させるには、autocutsel を使う。
(ウィンドウマネージャの起動時に実行するように設定する) autocutsel -fork autocutsel -fork -selection PRIMARY
■参考
https://stackoverflow.com/questions/3216081/integrate-emacs-copy-paste-with-system-copy-paste
● Emacs, emacs, copy, paste, system, integrate, コピー, ペースト, システム, 同期, 反映