Skip to content

Instantly share code, notes, and snippets.

View OndrejValenta's full-sized avatar

Ondrej Valenta OndrejValenta

View GitHub Profile
@OndrejValenta
OndrejValenta / install-elixir-on-centos8.sh
Created June 20, 2020 01:03
Install Elixir on Centos 8
# DEPENDS ON install-erlang-on-centos8.sh
# Install Elixir
cd /opt
git clone https://github.com/elixir-lang/elixir.git
cd elixir
make clean test
export PATH="$PATH:/opt/elixir/bin"

Simple reordering of items in database table

The problem

Ability to reorder item based on users drag and drop of items in UI. Items can be drag and drop in as a single object or with This is not the most efficient way how to do this but it's working just fine.

-- Drop functions and data table if they already exists
drop function save_todo_float(_user_id int, _what text, _todo_id int);
drop function move_todo_float(_user_id int, _ids int[], _target_id int, _position text);
drop table todos_float;

Serilog configuration for easy console/file/debug logging in Console apps

Using Microsoft Logging extensions

Serilog.Debugging.SelfLog.Enable(msg => Debug.WriteLine(msg));
Serilog.Debugging.SelfLog.Enable(Console.Error);

loggerConfig = new LoggerConfiguration()
  .MinimumLevel.Verbose();
@OndrejValenta
OndrejValenta / install_postgres_rockylinux.md
Last active April 6, 2024 23:47
Install PostgreSQL 15 on RockyLinux 9
@OndrejValenta
OndrejValenta / rocky-linux_9-2_first-steps.sh
Last active February 19, 2024 19:26
First steps after clean minimal Rocky Linux 9.2 install
#!/bin/bash
# Update everything automatically
dnf update -y
# Install nano and other useful stuff because you are not a masochist
dnf install epel-release -y;
dnf makecache

Preparation of RockyLinux 9 template in Proxmox Server

Based on standard Linux Container RockyLinux 9 image Container is used in IPA domain, therefor IPA client is installed

Steps done

dnf update -y
dnf install -y epel-release
@OndrejValenta
OndrejValenta / rockylinux_after_install_setup_proxmox.md
Created June 7, 2023 22:54
Setup Rocky Linux VM in Proxmox to be able to receive any TCP/ICMP packets

These steps are (probably) only applicable for NON QEMU installation of Rocky Linux VM

After installation of Rocky Linux on our Proxmox as Virtual machine (not Linux container) the machine was not accessible from outside world with SSH or ICMP

The solution was to set ipv4.gateway properly.

nmcli con mod ens18 ipv4.method "manual" ipv4.addresses "10.30.0.87/24" ipv4.dns "10.30.0.2" ipv4.gateway "10.30.0.1"
@OndrejValenta
OndrejValenta / rocky-linux-9-VM-proxmox-template.md
Last active June 8, 2023 22:30
Preparation of RockyLinux 9 VM template in Proxmox Server

Preparation of RockyLinux 9 VM template in Proxmox Server

Based on standard minimal RockyLinux 9 image

Container is used in IPA domain, therefor IPA client is installed

YOU MIGHT NEED TO UPDATE ROUTING TABLE WITH nmcli

Steps done

@OndrejValenta
OndrejValenta / enable_serial_console_rhel_in_proxmox.md
Created June 8, 2023 23:31
Enable Serial Console for Rocky Linux 9 / CentOS in Proxmox