Skip to content

Instantly share code, notes, and snippets.

View JM1's full-sized avatar

Jakob Meng JM1

  • Red Hat
  • Germany
View GitHub Profile
@JM1
JM1 / counter-strike-2-dedicated-server.bu
Last active May 19, 2024 07:54
Butane config for Fedora CoreOS 39 and later which will run a Counter Strike 2 dedicated server in a Podman container.
# Copyright (c) 2024 Jakob Meng, <jakobmeng@web.de>
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# A Butane config [0] for Fedora CoreOS 39 and later [1] which will run a Counter Strike 2 dedicated server [2] in a
# Podman container.
#
# First, customize all configuration settings marked with a TODO below. Then use Butane to translate it into a Ignition
# config [3]. With CoreOS Installer, embed it into a ISO or PXE image for Fedora CoreOS and/or to install Fedora CoreOS
# to bare metal [4] or a libvirt [5] virtual machine or a QEMU virtual machine [6].
#
@JM1
JM1 / pi-hole-install-guide.md
Last active July 2, 2021 13:42
Guide for self-updating Pi-hole setup on Raspberry Pi with IPv4 and IPv6
@JM1
JM1 / Ansible_Roles_with_OS-specific_Defaults.md
Last active May 30, 2024 12:02
Ansible Roles with OS-specific defaults

Ansible Roles with OS-specific Defaults

This Ansible guide discusses several approaches on how to set different role default variables based / depending on the host operating system aka ansible_distribution / ansible_facts.distribution or other variables. For example, a role variable image_uri should point to the latest cloud image for the host. For CentOS 8 or Red Hat Enterprise Linux (RHEL) 8 the default value should be:

@JM1
JM1 / README.md
Last active July 10, 2019 08:36
Fix linker errors with VTK-6.0 and MPICH

Fix linker errors with VTK-6.0 and MPICH

Suppose you build your C/C++ library using CMake and use find_package(VTK) to include VTK headers and libraries, at Ubuntu Trusty (14.04). You compile and link your code against another MPI implementation like MPICH, e.g. running cmake -DMPI_C_COMPILER=/usr/bin/mpicc.mpich -DMPI_CXX_COMPILER=/usr/bin/mpicxx.mpich ... You setup CMake to compile a C/C++ application and try to link it to your library. The linker will throw an error at one of your library-exported MPI functions, e.g.:

/usr/bin/ld: CMakeFiles/main.cpp.o: undefined reference to symbol 'ompi_mpi_comm_null'
//usr/lib/libmpi.so.1: error adding symbols: DSO missing from command line

VTK 6.0 at Ubuntu Trusty (14.04) is linked against OpenMPI. The CMake files installed in line with VTK (/usr/lib/cmake/vtk-6.0/Modules/vtkParallelMPI.cmake) add the OpenMPI header paths to your library's CMake include directories:

@JM1
JM1 / README.md
Last active July 5, 2019 10:25
Fix CMake errors of VTK 6.0 with newer GCC revisions

Fix CMake errors of VTK 6.0 with newer GCC revisions

CMake files of VTK 6.0 do not handle newer GCC output correctly and thus fail with:

CMake Error at /usr/lib/cmake/vtk-6.0/GenerateExportHeader.cmake:177 (if):
  if given arguments:
    "gcc-8 (Ubuntu 8.1.0-5ubuntu1~14.04) 8.1.0
  Copyright (C) 2018 Free Software Foundation, Inc.
 This is free software" " see the source for copying conditions. There is
@JM1
JM1 / dockerctl
Last active March 25, 2023 19:40
#!/bin/sh
# vim:set tabstop=8 shiftwidth=4 expandtab:
# kate: space-indent on; indent-width 4;
# shellcheck disable=SC2039
#
# Copyright (c) 2016-2022 Jakob Meng, <jakobmeng@web.de>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#!/bin/sh
# vim:set tabstop=8 shiftwidth=4 expandtab:
# kate: space-indent on; indent-width 4;
#
# Copyright (C) 2017 WEARENOTALONE
#
# Helper script for OpenWrt/LEDE configuration
# References:
# https://www.reddit.com/r/openwrt/comments/515oea/finally_got_80211r_roaming_working/
# https://forum.openwrt.org/viewtopic.php?id=56546
# How To Recover Windows 7/8.1 Product Key Without Using Third-Party Tools
# By Jakob Bindslet (jakob@bindslet.dk)
# Updated on Sep 26th, 2013
#
# Usage:
# Open Windows PowerShell as administrator
# C:\> $oldPolicy = Get-ExecutionPolicy
# C:\> Set-ExecutionPolicy RemoteSigned
# Click Enter key or 'Y' key when you see "Do you want to change the execution policy" message.
# C:\> Import-Module C:\Users\PC\Desktop\RecoverKey.ps1; Get-WindowsKey