Skip to content

Instantly share code, notes, and snippets.

View tosmi's full-sized avatar
🎯
Focusing

Toni Schmidbauer tosmi

🎯
Focusing
View GitHub Profile
@tosmi
tosmi / falco_rules.yaml
Created October 24, 2023 06:16
Falco 0.36.1 default rules file
#
# Copyright (C) 2023 The Falco Authors.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@tosmi
tosmi / contains.java
Last active December 26, 2022 17:43
Demonstrate the difference on using .contains() on a list of object and on a list of strings.
package at.stderr.Playlist;
import java.util.ArrayList;
public class Contains {
ArrayList<TestObject> testObjectList = new ArrayList<>();
ArrayList<String> stringList = new ArrayList<>();
public void run() {
// Let's create three test objects. Two will be added to

Create a cluster resource for SAP Hana on RHEL 8 with pacemaker 2.0

With pacemaker 2.0 master/slave resources where renamed to promoted resources.

The SAPHana resource is responsible for promoting the secondary Hana DB node to primary in case of a failure.

# pcs resource create SAPHana_HDB_00 SAPHana SID=HDB InstanceNumber=00 \
 PREFER_SITE_TAKEOVER=true DUPLICATE_PRIMARY_TIMEOUT=7200 AUTOMATED_REGISTER=true \
# gmake
Using /usr/local/bin/llvm-config38 [version=3.8.1]
CRYSTAL_CONFIG_PATH=`pwd`/src ./bin/crystal build -o .build/crystal src/compiler/crystal.cr -D without_openssl -D without_zlib
Using compiled compiler at .build/crystal
Error while requiring "prelude"
in src/prelude.cr:15: while requiring "exception"
require "exception"
^
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
let
pkgs = import <nixpkgs> {};
stdenv = pkgs.stdenv;
ruby = pkgs.ruby_2_2;
in stdenv.mkDerivation rec {
name = "env";
buildInputs = [
ruby
];
}
@tosmi
tosmi / lsblk.txt
Last active September 22, 2016 13:31
nixos
sda 8:0 0 232.9G 0 disk
├─sda1 8:1 0 1G 0 part
│ └─boot 254:1 0 1022M 0 crypt /boot
├─sda2 8:2 0 4G 0 part
└─sda3 8:3 0 227.9G 0 part
└─root 254:0 0 227.9G 0 crypt /nix/store
sr0 11:0 1 1024M 0 rom
@tosmi
tosmi / gist:c1555907e12251d5dbb7
Created October 23, 2014 19:36
augeas solaris test failures
========================================
augeas 1.2.0: tests/test-suite.log
========================================
# TOTAL: 206
# PASS: 186
# SKIP: 3
# XFAIL: 0
# FAIL: 17
# XPASS: 0
@tosmi
tosmi / foreman_500_stack_trace
Created June 5, 2014 09:06
foreman: 500 when trying to create an already existing smart_class_parameter override value
Started POST "/api/smart_class_parameters/tcp_server_address/override_values" for 10.255.1.30 at 2014-06-05 11:03:24 +0200
Processing by Api::V2::OverrideValuesController#create as JSON
Parameters: {"override_value"=>"[FILTERED]", "apiv"=>"v2", "smart_class_parameter_id"=>"tcp_server_address"}
Authorized user admin(Admin User)
Validation failed: Match has already been taken (ActiveRecord::RecordInvalid)
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/validations.rb:56:in `save!'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/attribute_methods/dirty.rb:33:in `save!'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:246:in `block in save!'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:295:in `block in with_transaction_returning_status'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statement
@tosmi
tosmi / fedorawks.md
Last active January 1, 2016 18:09
fedora workstation@work setup
  • yum install auctex xmonad xmobar rpmdevtools texlive-nomencl texlive-comment texlive-lastpage texlive-draftwatermark texlive-framed fetchmail procmail
  • enable rpmfusion
  • install postfix
  • cronjobs for fstrim -v and rsync of homedir
  • copy interface config and iptables.save