Skip to content

Instantly share code, notes, and snippets.

@ivmm
ivmm / disk_benchmark.sh
Last active December 31, 2024 19:12
disk_benchmark.sh
#!/bin/bash
# 默认参数
DEFAULT_DEVICE="/dev/sda"
TEST_SIZE="4G" # 测试文件大小
RUNTIME="60" # 每项测试运行时间(秒)
FIO_TESTFILE="/tmp/fio_testfile" # FIO测试文件路径
# 显示使用方法
usage() {
@ivmm
ivmm / disk_benchmark.sh
Last active December 31, 2024 09:01
disk.sh
#!/bin/bash
# 配置参数
DEVICE="${1:-/dev/vda}" # 磁盘设备
TEST_SIZE="1G" # 测试文件大小
BLOCK_SIZE="4k" # 块大小
NUM_JOBS=1 # 测试并发任务数
IODEPTH=16 # I/O 队列深度
DIRECT_IO=1 # 使用直接 I/O
TEST_DIR="/tmp/fio_test" # 测试文件存储的临时目录
@ivmm
ivmm / gist:723a98b1d0ce453d9846de8c446bdb58
Created December 20, 2024 06:06
bwh 搬瓦工邀请码
bwh_qAoTYKOflhOiBXDtAgAl22qNeYHK
bwh_5KA8ZXE5kTEIkDBE7gCYqtojhFNd
bwh_iLzelZcaNG6XqAvB4X523xQjR5tY
bwh_HcV99MJH3nr95cTkTqP1jL40C0AS
bwh_CkP9mA8mdHT7Vb7ReQ1Y7GQghK7K
bwh_Axt2H82Uz16DzQAlSx2XeULbqriy
bwh_1f8sDslaqdVQ5SkuzLFi8x5diGey
bwh_XnXPsW7VejWvnHbiqlCPW8XVvTZE
bwh_p42chPSzBQlGZ71cF2lWeNB1LpN7
bwh_8CBowuqEa94CPf8EdZHJSSvXwXO8
nameserver 8.8.8.8
nameserver 8.8.4.4
@ivmm
ivmm / .env
Created February 26, 2020 16:18
.env
#提供商,目前支持TencentCloud或Aliyun
XYBILL_<name>=TencentCloud
#Secret ID
XYBILL_<name>_providerCreds_ak=
#Secret Key
XYBILL_<name>_providerCreds_sk=
#最小余额
XYBILL_<name>_minAmount=5
#日志详细度
LOG_LEVEL=INFO
@ivmm
ivmm / MariaDB.repo
Created May 27, 2019 15:17
MariaDB.repo
# MariaDB 10.4 RedHat repository list - created 2019-05-27 11:58 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/rhel8-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
enabled=1
gpgcheck=1
@ivmm
ivmm / create-swap.sh
Last active May 26, 2019 10:06
create-swap.sh
#!/bin/sh
# Checking if user is root otherwise throw error
if [ "$(id -u)" -ne 0 ]; then
echo "This script must be run as root"
exit 1
fi
# Availbale Options
if [ ! "$#" -ge 1 ]; then
@ivmm
ivmm / nginx.repo
Created May 26, 2019 06:39
nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
@ivmm
ivmm / decloudify_image
Created May 9, 2019 07:10 — forked from remoteur/decloudify_image
decloudify_image
yum install -y libguestfs-tools
virt-filesystems --long -h --all -a rhev-m.init.qcow2
truncate -r rhev-m.init.qcow2 rhev-m.qcow2
truncate -s +100G rhev-m.qcow2
virt-resize --expand /dev/sda1 rhev-m.init.qcow2 rhev-m.qcow2
virt-customize -a rhev-m.qcow2 --root-password password:<pass>
virt-customize -a rhev-m.qcow2 --run-command 'yum remove -y cloud-init'
virt-customize -a rhev-m.qcow2 --run-command 'sed -i s/^PasswordAuthentication.*/PasswordAuthentication\ yes/ /etc/ssh/sshd_config'
virt-customize -a rhev-m.qcow2 --run-command 'sed -i s/^PermitRootLogin.*/PermitRootLogin\ yes/ /etc/ssh/sshd_config'
@ivmm
ivmm / alinux-2.1903-plus.repo
Created May 2, 2019 03:43
alinux-2.1903-plus.repo
[plus]
name=Alibaba Cloud Linux 2.1903 Plus Software Collections
baseurl=http://mirrors.aliyun.com/alinux/2.1903/plus/x86_64/
enabled=1
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/alinux/RPM-GPG-KEY-ALIYUN