Skip to content

Instantly share code, notes, and snippets.

View FlorianHeigl's full-sized avatar

Florian Heigl FlorianHeigl

View GitHub Profile
@FlorianHeigl
FlorianHeigl / 05-hostname.deb
Created November 16, 2016 04:46
cleaned up(?) script for deb
#!/bin/bash
. /tmp/context.sh
CONFIG_FILE="/etc/hostname"
function set_hostname() {
NAME=$1
[ -n "$NAME" ] || exit 0
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 01:27 — 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…
#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 July 15, 2017 13:54
trying some advice for gitlab

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 January 23, 2022 07:19
Set up LVM SSD cache via shell script
#!/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 March 19, 2017 12:06 — forked from oernii/dm-cache-status
fragile as fuck but keep around
#!/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>*
#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 11:57
post-fix-cludge things for packet.net
#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 23:35
yum patch management

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