Skip to content

Instantly share code, notes, and snippets.

View OndrejValenta's full-sized avatar

Ondrej Valenta OndrejValenta

View GitHub Profile
@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

Install Zsh and Oh-my-zsh on CentOS 7

Based on this article

ALL INSTALLATIONS ASSUME YES WHEN PROMPTED, that's what -y does

This script can be copy paste to ssh as is. No hands installation. :-)

yum install zsh -y
@OndrejValenta
OndrejValenta / create-svg-preview-grid.ps1
Created March 7, 2025 16:30
Create SVG Preview html file that you can serve with live-server or similar.
# Define the folder path where SVG files are located
$folderPath = ".\"
# Get a list of all SVG files in the folder
$svgFiles = Get-ChildItem -Path $folderPath -Filter *.svg
# Create an HTML header with a grid layout
$htmlContent = @"
<!DOCTYPE html>
<html lang="en">

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;

Based on this article

sudo apt-get update
sudo apt-get upgrade

sudo apt-get install redis-server
sudo systemctl enable redis-server.service

@OndrejValenta
OndrejValenta / install_postgres_rockylinux.md
Last active April 6, 2024 23:47
Install PostgreSQL 15 on RockyLinux 9
@OndrejValenta
OndrejValenta / install_grafana-loki-prometheus_rockylinux9.md
Created March 4, 2024 03:09
Install Grafana/Loki/Prometheus on RockyLinux 9

Installation of Grafana on RHEL

wget -q -O gpg.key https://rpm.grafana.com/gpg.key sudo rpm --import gpg.key

nano /etc/yum.repos.d/grafana.repo and paste

[grafana]
@OndrejValenta
OndrejValenta / install_minio_rockylinux.md
Last active March 4, 2024 02:54
Install Minio.io on RockyLinux

Install standards

Installs also firewalld !!

You can skip this step completely.

sudo dnf -y update sudo yum install -y epel-release sudo dnf install -y tar wget curl nano mc firewalld htop git

@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