2024年 9月

ubuntu KVMのブリッジで仮想マシンを外のネットワークと通信するためのnetplanの設定(NATは使わない)

network:
  version: 2
  renderer: networkd
  ethernets:
    enp5s0:
      dhcp4: no
  bridges:
    br0:
      dhcp4: no
      addresses:
        - 10.10.10.88/16
      interfaces:
        - enp5s0
      routes:
        - to: default
          via: 10.10.10.1
      nameservers:
        addresses: [10.10.10.1]
      parameters:
        forward-delay: 0
        stp: false
      optional: true

history | grep hoge はめんどくさい

mkdir /usr/local/mycommand

cat > /usr/local/mycommand/his <<EOF
#/bin/bash
history | grep \$1
EOF

chmod 755 /usr/local/mycommand/his

echo ‘export PATH=$PATH:/usr/local/mycommand’ >> /etc/profile