This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
exec ssh -F keys/ssh_config "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
POOL=${POOL:-zfsimages} | |
POOL_PATH=${POOL_PATH:-"/ztank/libvirt/images"} | |
ORIGINAL_IMAGE=${ORIGINAL_IMAGE:-CentOS-7-x86_64-GenericCloud.qcow2} | |
VM_NAME=${1} | |
VM_RAM=1024 | |
VM_CPU=1 | |
VM_DISK=${1}.qcow2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## **Updates to this file are now at https://github.com/giovtorres/virt-install-centos ** | |
# Take one argument from the commandline: VM name | |
if ! [ $# -eq 1 ]; then | |
echo "Usage: $0 <node-name>" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python | |
# 一番強いハッシュ関数とランダムにソルトを選んでくれる | |
# python -c 'import crypt; print crypt.crypt("password")' | |
# 上に同じ | |
# python -c 'from crypt import crypt,mksalt; s=mksalt(); print crypt("password",s)' | |
# SHA-512指定,ソルトはランダム | |
#python -c 'from crypt import crypt,mksalt,METHOD_SHA512; s=mksalt(METHOD_SHA512); print crypt("password",s)' | |
import crypt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/etc/default/grub, /etc/sysconfig/grub は同一ファイル(スタティックリンクされてる) | |
- VGA(物理コンソール)@ tty0 | |
- 物理シリアル@ ttyS0 ← systemd@gettyで待ち受けるようにする | |
- 仮想シリアル@ ttyS1 ← grob,boot,systemd@getty | |
- GRUB_SERIAL_COMMAND | |
boot menuはこっちの設定が使われるので何もしないと9600で出力されることになりもっさりする?) | |
- GRUB_CMDLINE_LINUX | |
カーネルに渡す設定 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### NetworkManagerでネットワーク管理 | |
- 確認するときnmtui使えるのは大きいと思う | |
- セットアップはnmcliでやる | |
- 設定ファイルは/etc/sysconfig/network-scriptに入っている | |
- 設定ファイルを保存した時点で自動的にNetworkManagerが設定を行うので注意 | |
# デバイス確認 | |
nmcli device | |
nmcli connection show | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### virt-sysprep | |
- ディスクイメージへの書き込み権限が必要 | |
# リスト表示 | |
virt-sysprep --list-operations | |
# 一部だけ | |
virt-sysprep --enable ssh-hostkeys,udev-persistent-net -d centos7core | |
# 全部 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ex | |
VM_NAME=centos7mini | |
VM_RAM=1024 | |
VM_CPU=1 | |
# VM削除 動作怪しいぞ | |
#virsh undefine ${VM_NAME} --remove-all-storage --delete-snapshots |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ls -d /proc/*/fd | sudo xargs -i sh -c 'ls {} | wc -l' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /usr/local/src | |
sudo git clone https://github.com/hishamhm/htop.git | |
cd htop | |
sudo git checkout refs/tags/2.0.2 | |
sudo ./autogen.sh | |
sudo ./configure | |
sudo make |