Skip to content

Instantly share code, notes, and snippets.

Avatar

Florian Heigl FlorianHeigl

View GitHub Profile
@FlorianHeigl
FlorianHeigl / 05-hostname.deb
Created Nov 16, 2016
cleaned up(?) script for deb
View 05-hostname.deb
#!/bin/bash
. /tmp/context.sh
CONFIG_FILE="/etc/hostname"
function set_hostname() {
NAME=$1
[ -n "$NAME" ] || exit 0
View gist:73871f8a334aa34fccc65f181a765d33
Rudder Inventory Flow
Managed Node:
rudder agent inventory
cf-agent -KI -Dforce_inventory
@FlorianHeigl
FlorianHeigl / install-rudder-agent-rpm-latest.yml
Last active May 16, 2017 — forked from jooooooon/install-rudder-agent-rpm-latest.yml
These files allow to install a Rudder agent automatically using cloud-init. All you need to do to use them is set the user-data field in your cloud provider to contain "#include" on one line, and the URL to the raw version of this script on the second line. Assuming you're using an image with cloud-init pre-installed, your new instance will spin…
View install-rudder-agent-rpm-latest.yml
#cloud-config
# Set up the package repository to get Rudder.
# We use the "latest" pseudo-version name to always get an up-to-date agent.
write_files:
- content: |
[Rudder_4.1]
name=Rudder 4.1 EL repository
baseurl=http://www.rudder-project.org/rpm-4.1/RHEL_7/
@FlorianHeigl
FlorianHeigl / gitlab-ops.md
Last active Jul 15, 2017
trying some advice for gitlab
View gitlab-ops.md

my take on the gitlab issue

It happens I had read the database troubleshooting part of Gitlab's Ops manual (https://gitlab.com/gitlab-com/runbooks/blob/master/troubleshooting/postgresql_replication.md) just a month ago, looking for monitoring info. I found many sound instructions on how to deal with database replication issues. I was very happy when I read they're also using Check_MK, but ...

It also made me decide pg_basebackup is too dangerous w/o dedicated DBA staff for two reasons:

  • reason 1: lack of stability / fault tolerance
  • reason 2: destructive resume on issue
@FlorianHeigl
FlorianHeigl / lvcacher.sh
Last active Mar 28, 2017
Set up LVM SSD cache via shell script
View lvcacher.sh
#!/bin/bash -u
# Script to automate the setup and conversion of cache pools in LVM.
# I changed all my busy LVs using it, worked well for me.
# Cache and/or thin pools are supported since RHEL 6.4-ish but it's
# more complex/powerful than i.e. bcache.
# They might be the best tool for you, or might as well not.
# this is as an example, you need to review the script.
# i've also only done basic tests of the error handlers below.
@FlorianHeigl
FlorianHeigl / dm-cache-status
Last active Mar 19, 2017 — forked from oernii/dm-cache-status
fragile as fuck but keep around
View dm-cache-status
#!/bin/bash -e
# $Id: dm-cache-status,v 1.1 2014/08/19 09:02:46 oernii Exp $
# Status
# ------
#
# <metadata block size> <#used metadata blocks>/<#total metadata blocks>
# <cache block size> <#used cache blocks>/<#total cache blocks>
# <#read hits> <#read misses> <#write hits> <#write misses>
# <#demotions> <#promotions> <#dirty> <#features> <features>*
View cloud-config rudder-master.yml
#cloud-config
# Set up the package repository to get Rudder.
# We use the "latest" pseudo-version name to always get an up-to-date agent.
write_files:
- content: |
[Rudder_4.1]
name=Rudder 4.1 EL repository
baseurl=http://www.rudder-project.org/rpm-4.1/RHEL_7/
@FlorianHeigl
FlorianHeigl / packet-vmhost-EU-cc.yml
Last active May 18, 2017
post-fix-cludge things for packet.net
View packet-vmhost-EU-cc.yml
#cloud-config
# I'm very unhappy to end up with this scriptlike solution but there was some bugs (i.e. things not being run)
# that seem to be in their cloud-config version
runcmd:
- apt-get -y install wget --force-yes
- wget --quiet -O- "https://www.rudder-project.org/apt-repos/rudder_apt_key.pub" | apt-key add -
- echo "deb http://www.rudder-project.org/apt-4.1/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/rudder.list
- apt-get update
- DEBIAN_FRONTEND=noninteractive apt-get -y install rudder-agent --force-yes
@FlorianHeigl
FlorianHeigl / yum.md
Last active May 21, 2017
yum patch management
View yum.md

Yum basic tunables

yum.conf

tune the metadata expiry or rather turn it off and use cron to keep it updated out of band

yum makecache / cron

yum makecache fast