Skip to content

Instantly share code, notes, and snippets.

@phonglh79
phonglh79 / export-image.sh
Created May 30, 2023 08:32 — forked from samos123/export-image.sh
export images and volume snapshots from OpenStack Ceph RBD
#!/bin/bash
set -xe
imageid=$1
qemu-img convert -f raw -O qcow2 rbd:images/$imageid $imageid.qcow2
@phonglh79
phonglh79 / create-cloud-template.sh
Created December 17, 2021 08:52 — forked from chriswayg/create-cloud-template.sh
This script will download a cloud image of many Linux distros and create a Proxmox 6 KVM template from it.
#!/bin/bash
set -o errexit
clear
printf "\n*** This script will download a cloud image and create a Proxmox VM template from it. ***\n\n"
### HOW TO USE
### Pre-req:
### - run on a Proxmox 6 server
### - a dhcp server should be active on vmbr1
@phonglh79
phonglh79 / parser.py
Created January 6, 2021 08:35 — forked from hreeder/parser.py
Python nginx Log Parser
#!/usr/bin/env python
import gzip
import os
import sys
import re
INPUT_DIR = "nginx-logs"
lineformat = re.compile(r"""(?P<ipaddress>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) - - \[(?P<dateandtime>\d{2}\/[a-z]{3}\/\d{4}:\d{2}:\d{2}:\d{2} (\+|\-)\d{4})\] ((\"(GET|POST) )(?P<url>.+)(http\/1\.1")) (?P<statuscode>\d{3}) (?P<bytessent>\d+) (["](?P<refferer>(\-)|(.+))["]) (["](?P<useragent>.+)["])""", re.IGNORECASE)
@phonglh79
phonglh79 / ssh-telegram.sh
Created October 14, 2020 07:38 — forked from matriphe/ssh-telegram.sh
Bash Script to notify via Telegram Bot API when user log in SSH
# save it as /etc/profile.d/ssh-telegram.sh
# use jq to parse JSON from ipinfo.io
# get jq from here http://stedolan.github.io/jq/
USERID="<target_user_id>"
KEY="<bot_private_key>"
TIMEOUT="10"
URL="https://api.telegram.org/bot$KEY/sendMessage"
DATE_EXEC="$(date "+%d %b %Y %H:%M")"
TMPFILE='/tmp/ipinfo-$DATE_EXEC.txt'
if [ -n "$SSH_CLIENT" ]; then
@phonglh79
phonglh79 / jitsi-meet-setup.sh
Created September 9, 2020 04:32 — forked from dimaskiddo/jitsi-meet-setup.sh
Jitsi Meet Automatic Installer
#!/bin/bash -e
# Current Directory
CURRENT_DIR=$(pwd)
# Header Function
function printhead() {
clear
@phonglh79
phonglh79 / jitsi-jvb-setup.sh
Created September 9, 2020 04:32 — forked from dimaskiddo/jitsi-jvb-setup.sh
Jitsi VideoBridge Automatic Installer
#!/bin/bash -e
# Current Directory
CURRENT_DIR=$(pwd)
# Header Function
function printhead() {
clear
@phonglh79
phonglh79 / jitsi-jibri-setup.sh
Created September 9, 2020 04:31 — forked from dimaskiddo/jitsi-jibri-setup.sh
Jitsi Jibri Automatic Installer
#!/bin/bash -e
# Current Directory
CURRENT_DIR=$(pwd)
# Header Function
function printhead() {
clear

Hướng dẫn cài đặt Ceph Luminous


I. Cài đặt cơ bản


1. Chuẩn bị môi trường

1.1 Mô hình mạng

Install Ceilometer + Gnocchi with backend Ceph

In Controller node

  • Create database
mysql -uroot -pWelcome123

CREATE DATABASE gnocchi;
GRANT ALL PRIVILEGES ON gnocchi.* TO 'gnocchi'@'localhost' IDENTIFIED BY 'Welcome123' WITH GRANT OPTION ;
@phonglh79
phonglh79 / mysql_replication_monitoring.conf
Created June 24, 2020 08:58 — forked from kujiy/mysql_replication_monitoring.conf
MySQL replication monitoring tool for Zabbix 3
# MySQL replication monitoring tool for Zabbix 3
# How to use
# Item:
# type:Zabbix agent
# mysqlrepl.single # no args
# mysqlrepl.multi # no args
# "0" will be returned if replication is working
## How to Use on Zabbix Web