Skip to content

Instantly share code, notes, and snippets.

View PhilipSchmid's full-sized avatar

Philip Schmid PhilipSchmid

View GitHub Profile
@PhilipSchmid
PhilipSchmid / netflow.md
Created December 19, 2018 08:47
Cisco IPv4 and IPv6 Netflow Example Configuration (Nexus 5k)
feature netflow

flow exporter elastic-exp
  description elasticsearch exporter
  destination 10.10.10.10 use-vrf XY
  transport udp 9995
  source Vlan123
  dscp 0
  version 9
@PhilipSchmid
PhilipSchmid / docker-compose.tmpl.yml
Created August 13, 2018 15:44
docker-compose.yml template which covers most of the configurations which are used from time to time
version: "3.7"
services:
backend:
image: registry.example.com/my-example-docker-image:stable
restart: always
hostname: my-example-service.example.com
environment:
TZ: Europe/Zurich
env_file:
@PhilipSchmid
PhilipSchmid / ubuntu-1804-lacp-bonding.md
Last active January 31, 2023 20:48
Ubuntu 18.04 LACP Network Interface Bonding

Interface bonding

Configure a LACP active network interface bonding on Ubuntu 18.04 using netplan:

root@srv01:~# mv /etc/netplan/50-cloud-init.yaml /etc/netplan/01-netcfg.yaml
root@srv01:~# cat /etc/netplan/01-netcfg.yaml 
network:
    version: 2
    renderer: networkd
 ethernets:
@PhilipSchmid
PhilipSchmid / bash-template.sh
Last active February 9, 2025 07:17
Bash script template (incl. logging functions)
#!/bin/bash
#################################
# Constants / global variables
#################################
LOGFILE='example.log'
LOGLEVEL='INFO'
#################################
# Functions
@PhilipSchmid
PhilipSchmid / nfs-server.md
Created June 18, 2018 15:11
How To Install A NFS Server

How To Install A NFS Server

Based on CentOS 7.

Prerequisites

Disk

pvcreate /dev/sdb
vgcreate vg1-nfs /dev/sdb
lvcreate -l 100%FREE -n nfs vg1-nfs
@PhilipSchmid
PhilipSchmid / RHEL_switch_RHN_to_Subscription.md
Created April 7, 2017 13:20
How to switch from RHN to Red Hat subscription-manager

How to switch from RHN to Red Hat subscription-manager

RHEL 6 Server

  1. Check if subscription-manager is installed. If not, install it via yum install subscription-manager.

  2. Delete host on the RHN site.

  3. "Unregister" host from RHN:

rm -rf /etc/sysconfig/rhn/systemid
@PhilipSchmid
PhilipSchmid / useful_commands_and_sources.md
Last active April 16, 2025 11:59
Useful (non-daily) Bash commands and sources

General Commands

Delete history and exit bash

cat /dev/null > ~/.bash_history && history -c && exit

Print all uncommented config file lines (without the empty ones)

cat file.txt | egrep -v '^#|^$'