Skip to content

Instantly share code, notes, and snippets.

upstream redis {
server 127.0.0.1:6379;
keepalive 512;
}
server {
listen 80;
server_name www.mf8.biz mf8.biz;
access_log off;
index index.html index.htm index.php;
@ivmm
ivmm / gnome_install.sh
Created July 25, 2017 13:33
gnome_install.sh
#!/bin/bash
# init_centos shell
#安装说明参见 https://sadsu.com/?p=266
#----------------------------------------------------------#
# Variables&Functions #
#----------------------------------------------------------#
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'
plain='\033[0m'
nameserver 8.8.8.8
nameserver 8.8.4.4
@ivmm
ivmm / litespeed.repo
Created August 12, 2017 09:34
OSS加速litespeed源
[litespeed]
name=LiteSpeed Tech Repository for CentOS $releasever - $basearch
baseurl=http://openlitespeed.oss-cn-hangzhou.aliyuncs.com/centos/7/$basearch/
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=http://openlitespeed.oss-cn-hangzhou.aliyuncs.com/centos/RPM-GPG-KEY-litespeed
[litespeed-update]
name=LiteSpeed Tech Repository for CentOS $releasever - $basearch
@ivmm
ivmm / Centos-7.repo
Created October 3, 2016 17:03
Centos-7.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
@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'