Skip to content

Instantly share code, notes, and snippets.

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
@ivmm
ivmm / redistest.php
Created March 17, 2019 13:48
redistest.php
<?php
//simple counter to test sessions. should increment on each page reload.
session_start();
$count = isset($_SESSION['count']) ? $_SESSION['count'] : 1;
echo $count;
$_SESSION['count'] = ++$count;
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
@ivmm
ivmm / nginx.conf
Created September 20, 2017 07:17
nginx.conf
user www-data;
worker_processes auto;
error_log /data/wwwlogs/error_nginx.log crit;
pid /run/nginx.pid;
worker_rlimit_nofile 51200;
events {
use epoll;
worker_connections 51200;