This file contains hidden or 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
yum clean all | |
yum -y install epel-release | |
yum -y groupinstall "Development tools" | |
yum -y install iftop iptraf nethogs ncdu git atop htop iotop smartmontools dmidecode sysbench siege fio lshw ioping vim tmux telnet ntp chrony openssl-devel zlib-devel python-devel pciutils net-tools |
This file contains hidden or 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
[root@test home]# parted | |
GNU Parted 2.1 | |
Using /dev/sda | |
Welcome to GNU Parted! Type 'help' to view a list of commands. | |
(parted) print free | |
Model: VMware Virtual disk (scsi) | |
Disk /dev/sda: 32,2GB | |
Sector size (logical/physical): 512B/512B | |
Partition Table: msdos |
This file contains hidden or 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
mount -t xfs -o inode64,noatime /dev/sda6 /data/glusterfs/volname/brick1/ |
This file contains hidden or 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
Umount /dev/sda1 | |
fsck -V /dev/sda1 to get the location of bad super block | |
mke2fs -n /dev/sda1 to get the location of backup super block | |
e2fsck -b <the location of backup super block in output of mke2fs -n> /dev/sda1 to replace bad super block |
This file contains hidden or 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
dd if=/dev/zero of=/virtual_drive bs=1G count=1 | |
mkfs -t ext4 /virtual_drive | |
mkdir -p /mnt/virtual_device | |
mount -t ext4 -o loop /virtual_drive /mnt/virtual_device | |
To view loop device list: | |
losetup -a |
This file contains hidden or 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
vi /usr/lib/systemd/system/docker.service | |
ExecStart=/usr/bin/docker daemon -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock -H fd:// | |
systemctl daemon-reload | |
systemctl show docker | grep -i exec | |
ExecStart={ path=/usr/bin/docker ; argv[]=/usr/bin/docker daemon -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock -H fd:// | |
systemctl restart docker.service |
This file contains hidden or 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
yum -y update && curl -fsSL https://get.docker.com/ | sh && systemctl start docker && docker run hello-world |
This file contains hidden or 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
sudo tee /etc/yum.repos.d/docker.repo <<-'EOF' | |
[dockerrepo] | |
name=Docker Repository | |
baseurl=https://yum.dockerproject.org/repo/main/centos/7/ | |
enabled=1 | |
gpgcheck=1 | |
gpgkey=https://yum.dockerproject.org/gpg | |
EOF | |
yum -y update && yum -y install docker-engine-1.11.2 && systemctl start docker && docker run hello-world |
This file contains hidden or 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
sudo vi /usr/local/bin/mysql_backup | |
#!/bin/bash | |
user_name=root | |
user_password="<pass>" | |
backup_name=<backup_name> | |
host="127.0.0.1" | |
parallel=4 | |
backup_output="/data/local-backup" | |
temp_log="/var/log/mysql_backup.log.tmp" |
This file contains hidden or 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
useradd test | |
groupadd sudo_passwdless | |
gpasswd -a test sudo_passwdless | |
groups test | |
test : test sudo_passwdless | |
vi /etc/sudoers | |
%sudo_passwdless ALL=(ALL) NOPASSWD: ALL |