Skip to content

Instantly share code, notes, and snippets.

@zhdkirill
zhdkirill / add-osd-wal.sh
Last active April 15, 2021 10:41
Small script to add new OSD
#!/bin/bash -x
NC='\033[0m' # No Color
RED='\033[1;31m'
GREEN='\033[1;32m'
YELLOW='\033[1;33m'
if [ "$#" -lt 2 ]; then
echo -e "${RED}Please provide disk and NVMe!${NC}"
exit
@zhdkirill
zhdkirill / node-exporter-install.sh
Last active December 25, 2020 16:29
Script to install and enable prometheus node-exporter on an Ubuntu node
#!/bin/bash
VERSION='1.0.1'
USER=node-exporter
SERVICE=node-exporter
ADDRESS=${1}
# Remove repository version if exists
sudo apt purge -y prometheus-node-exporter
#!/usr/local/bin/python3
# Ceph data collection and aggregation tool
# Version 1.0 Oct 24, 2019
# Christian Huebner cchuebner@gmail.com chuebner@mirantis.com @ossarchitect
#from __future__ import print_function
import sys
import tarfile
import json
#!/bin/bash
echo "Collecting Ceph cluster data."
echo "This script must be run on a monitor node."
if [ "${CUSTOMER}" == '' ]; then CUSTOMER="default"; fi
if [ "${CLUSTERNAME}" == '' ]; then CLUSTERNAME="cluster"; fi
if [ "$#" -lt 2 ]; then echo "Using customer \"${CUSTOMER}\" and cluster name \"${CLUSTERNAME}\". These values can be modified by seting the \$CUSTOMER and \$CLUSTERNAME shell variables\nor calling the script with $0 <CUSTOMER> <CLUSTERNAME>\n"; else CUSTOMER=${1}; CLUSTERNAME=${2}; fi
DATE=$(date "+%Y-%m-%d")
@zhdkirill
zhdkirill / block.db.migration.sh
Last active December 18, 2020 10:34
Migrate block.db to NVMe
#!/bin/bash
NC='\033[0m' # No Color
RED='\033[1;31m'
GREEN='\033[1;32m'
YELLOW='\033[1;33m'
function initnvme {
echo -e "${YELLOW}Initializing disk ${1}${NC}"
sgdisk --zap-all /dev/${1}
@zhdkirill
zhdkirill / .vimrc
Created August 22, 2019 16:01
vim config
" Turn on syntax highlighting.
syntax on
" Set status line display
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ [BUFFER=%n]\ %{strftime('%c')}
" Encoding
set encoding=utf-8
" Highlight matching search patterns