Skip to content

Instantly share code, notes, and snippets.

View jhrcz's full-sized avatar

Jan Horacek jhrcz

View GitHub Profile
@jhrcz
jhrcz / README.md
Last active December 18, 2015 04:49

real world example of check-pkgswithoutrepo.sh

it is important to note, that this is slooooow. i think about some sort of asynchronicity

# time bash check-out-of-repos.sh
FAILED, 8 packages without repos found:  etnpol-tomcat-5.5.23-mysql-5.5.23-6.noarch git-1.8.0.1-1.jhr.1.el6.x86_64 etnpol-tomcat-5.5.23-log4j-5.5.23-6.noarch etnpol-tomcat-5.5.23-5.5.23-6.noarch perl-Git-1.8.0.1-1.jhr.1.el6.noarch percona-release-0.0-1.x86_64 etnpol-tomcat-5.5.23-core-5.5.23-6.noarch nagios-plugin-check-bindmounts-0.1.00.snap.20130307.115442.git.7b7b268-0.el6.noarch

real	5m32.469s
@jhrcz
jhrcz / hostdiff-dir.sh
Created June 20, 2013 12:55
lame comparing of remote hosts (files/dirs)
vimdiff <( echo "##### $1 #####" ; ssh root@$1 ls -l $3 | sort -k9 ) <( echo "##### $2 ##### ; ssh root@$2 ls -l $3 | sort -k9 )
@jhrcz
jhrcz / README.md
Last active December 18, 2015 18:18

teplate for check_cluster nagios check

scripted in bash for easy reusing

sample output

$ cat my-hostprefix-clu-host-GEN.cfg my-hostprefix--clu-services-GEN.cfg my-hostprefix-clu-deps-GEN.cfg 
attic
@jhrcz
jhrcz / README.md
Last active December 19, 2015 00:09
nagios check_cluster generator

nagios check_cluster generator v2

why

  • minimize manual configuration
  • minize notifications from cluster hosts when clustered services are all down (notify only from new fake cluster host)

use

@jhrcz
jhrcz / kvm-force-blkio-throttle.sh
Last active December 4, 2017 12:00
force cpu and blkio thottle of kvm guests
#!/bin/bash
cat /cgroup/blkio/libvirt/qemu/blkio.throttle.read_bps_device
cat /cgroup/blkio/libvirt/qemu/blkio.throttle.write_bps_device
cat /cgroup/blkio/libvirt/qemu/*/blkio.throttle.read_bps_device
cat /cgroup/blkio/libvirt/qemu/*/blkio.throttle.write_bps_device
# 10MBps
#BPSLIMIT=10485760
@jhrcz
jhrcz / nginx-satisfy-any-remoteaddr-clientcert
Last active December 23, 2015 11:00
nginx-satisfy-any-remoteaddr-clientcert
# satisfy any like funkcionality in nginx
# with client certificat or remote address
#
# based on https://sys-notes.com/bin/view/Main/NginxSSLClientAuth
#
#if ($ssl_client_s_dn !~ "(O=My Company)") {
# return 403;
#}
set $accessok "";
@jhrcz
jhrcz / etn-opennebula-state-2013.md
Last active December 23, 2015 21:19
etn-opennebula-state-2013

one1c (ETN One Cloud #1) overview 2013

  • opennebula 3.2.1, preparing for upgrade to 4.x (requires migrating gfs2clvm close to upstream lvm driver, renaming all lvm names )

architecture

  • 8 viritualisation nodes (one1-host-X )
@jhrcz
jhrcz / kvm-clock-hardsync.sh
Last active December 26, 2015 10:39
kvm-clock-hardsync.sh
#!/bin/bash
# /usr/local/sbin/kvm-clock-hardsync.sh
# cron:
# * * * * * /usr/bin/cronic /usr/local/sbin/kvm-clock-hardsync.sh
#
[ "$DEBUG" = "YES" ] \
&& set -x
@jhrcz
jhrcz / rpm-spec-git-diff-patch-symlink.txt
Created November 18, 2013 13:34
my hacky way for patching symlink to be a file with changed content with diff from git, applying in rpm spec