Skip to content

Instantly share code, notes, and snippets.

@sdmoko
sdmoko / OpenStack-instances-monitoring-with-Prometheus-Grafana.md
Created November 1, 2019 12:35
Step by step to Monitoring OpenStack Instances with Service Discovery Prometheus and Grafana

Create Instances for Prometheus Server and Grafana

Download Prometheus Server

cd /tmp
wget -c https://github.com/prometheus/prometheus/releases/download/v2.13.1/prometheus-2.13.1.linux-amd64.tar.gz

Extract Prometheus Server

@sdmoko
sdmoko / httpd.conf-RedHat.j2
Last active October 6, 2018 04:12
example httpd redhat
ServerRoot "/etc/httpd"
Listen 80
Include conf.modules.d/*.conf
User apache
Group apache
ServerAdmin root@localhost
@sdmoko
sdmoko / pubkey
Created October 2, 2018 04:44
Pubkey
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCrWH1mVPR5ehw78UGD5ry+ju/FtH0hdhZBsKvig/qJEgD3rtFNlsP3MnmTvnsJMEw028gn7FPBTaO7e8kkiJAlHAkrMaIzYZMgo0utuZm7bwFOJ/YNc0Nk8UnF4L37N3U5hp4cESy3eCJQPXu9Gfd8sdmywnpi6TUduYdpkxrnw2Be8C1utVwxfxYzQuB06X5GAWW/KafeRgT18LMGaVQ4J26aj9Xi38ieNRfjgec9Nnz1o4RA4wy+YRDsJSh4QwgG5m7nJzclEPsbDhG9DTRDk4Y2at1jaLkvTDR7HaLbZQGzCcjYFO3gf7DRtBQUv8jyP6zKbNhqeAjMW/37onWKxH3GM9uN32slMI/6WBGLZ0hp91lyxCZLXRgMi+Mz3Be0krSL+cLIdxTFvOpf0oPJTmVua8fn+5zFQw3uj9984u00a79PUd4TseW24YA/tJPa5U1SGUYg5XtqV5ib0Hu9VSd9MTVUkzrG/vXG+k1pzV+H7r9+9nqy63+ftAkBrt7/noJ9Y+Fq0XbqvcDzS4NDIsowFyFu5u0xRTICgkx7HgfFEEav78uO00t2c3IGmsBgXkfxCG26yDO7QFV1NOuLtNlRmLkv9k3gw6NB3WrvNdzMFsDjIRcRt9Jii6I9sFPanSQd2ZRbmOF4SAO7c8HXX09Qmvmn06B1yLYn++aAPQ== moko@hogsmeade
@sdmoko
sdmoko / pgsql_backup.sh
Created January 24, 2018 06:31 — forked from sirbrillig/pgsql_backup.sh
Postgresql daily backup script.
#!/bin/bash
#
# Backup a Postgresql database into a daily file.
#
BACKUP_DIR=/pg_backup
DAYS_TO_KEEP=14
FILE_SUFFIX=_pg_backup.sql
DATABASE=
USER=postgres
@sdmoko
sdmoko / ceph-cluster
Last active September 27, 2017 08:01
Instalation of Ceph Cluster on centos 7
# config on each node in file /etc/hosts
10.25.25.41 ceph-admin
10.25.25.25 ceph-osd1
10.25.25.36 ceph-osd2
# add user for deploy ceph on all node
sudo useradd -d /home/ceph-deploy -m ceph-deploy
sudo passwd ceph-deploy
# provide full privileges to the user adding the following line to /etc/sudoers.d/ceph
sudo yum install centos-release-scl
sudo yum install devtoolset-4-gcc*
scl enable devtoolset-4 bash
which gcc
gcc --version
@sdmoko
sdmoko / set-gcc
Created June 6, 2017 05:11
Configure gcc to using specific version
#install new versions of gcc and g++
sudo apt-get install gcc-5 gcc g++-5 g++
#remove existing alternatives
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
#add new and old version to update-alternatives db
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 50 --slave /usr/bin/g++ g++ /usr/bin/g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6