minisoba blog

プログラミングと株式投資

Unix コマンド備忘録

Gitコマンド

# コミットユーザをレポごと変更する方法
git config --global user.name "New Name"
git rebase -r --root --exec "git commit --amend --no-edit --reset-author"

# submoduleの取得
# 新規クローンの場合
git clone --recursive <repository-url>

# すでにレポがある場合
git submodule update --init --recursive

ネットワーク関連コマンド

XRDPの設定 (多分、これで全部)

sudo apt install xrdp
sudo apt install xfce4 xfce4-goodies
sudo apt install ssl-cert
sudo make-ssl-cert generate-default-snakeoil --force-overwrite

sudo openssl req -x509 -newkey rsa:2048 -nodes   -keyout /etc/xrdp/key.pem -out /etc/xrdp/cert.pem   -days 365 -subj "/CN=localhost"

maron@minisoba:~$ egrep "(security_layer|port)" /etc/xrdp/xrdp.ini | grep -v ";"
port=3389
security_layer=rdp

sudo systemctl enable xrdp
sudo systemctl start xrdp

TCPポートの確認

maron@minisoba:~$ netstat -tlnp | grep 3389
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp6       0      0 :::3389                 :::*                    LISTEN      -                   
maron@minisoba:~$ sudo lsof -i :3389
[sudo] password for maron: 
COMMAND    PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
xrdp    900819 xrdp   11u  IPv6 7343928      0t0  TCP *:ms-wbt-server (LISTEN)
maron@minisoba:~$