Skip to content

Instantly share code, notes, and snippets.

View rgherta's full-sized avatar

Roman Gherta rgherta

View GitHub Profile
@rgherta
rgherta / astropygaia.txt
Last active August 29, 2025 17:39
Astropy Star Detections
from astropy.wcs import WCS
from astropy.io import fits
from astropy.coordinates import ICRS, Galactic, GCRS
from astropy.stats import mad_std
from astropy import units as u
from astropy.coordinates import SkyCoord
from photutils.detection import DAOStarFinder
import pandas as pd
import matplotlib
matplotlib.use('gtk4agg')

Database Services

It is important to make available some kind of a database as a service inside the cluster. Many other services like Keycloak for example rely on a pre-existing database service that must be configured during the installation. Otherwise keycloak will use default storage backed which was file based and only for development purposes. The following DBs are supported by keycloak

Generate certs

Certs are generated inside pod in /var/lib/mysql automatically but can be replaced if needed.

-rw-r----- 1 mysql mysql       56 Jun 14 15:44  auto.cnf

Prepare Cluster

In this document we create a small minikube cluster that can be used for tests before modifying the real cluster. We will use a fedora39-workstation vm.

Deploy minikube

Install minikube and enable libvirtd according to docs. Latest minikube versions have support for kvm and are able to provision nodes with lightweight images built with BuildRoot. Due to lack of resources we created a cluster with 2 nodes, each with 2 CPU and 3Gb of ram and an extra vdb disk of 20GB.

@rgherta
rgherta / history.txt
Last active December 14, 2020 23:58
history
# create ca.key and ca.crt
openssl genrsa -out ./ca/ca.key 2048
openssl req -new -x509 -days 1825 -key ./ca/ca.key -out ./ca/ca.crt --config ca.cnf
#openssl x509 -in ca.crt -text -noout
# creates domain.key and domain.csr
openssl req -new -out ./certs/domain.csr -config domain.cnf
#openssl req -in ./certs/domain.csr -text -noout
@rgherta
rgherta / domain.cnf
Last active January 20, 2021 10:35
Simple domain.cnf
[ req ]
# This specifies the default key size in bits. If not specified then 512 is
# used. It is used if the -new option is used. It can be overridden by using
# the -newkey option.
default_bits = 2048
# This is the default filename to write a private key to. If not specified the
# key is written to standard output. This can be overridden by the -keyout
# option.
default_keyfile = ./certs/domain.key
@rgherta
rgherta / ca.cnf
Last active January 20, 2021 10:36
simple private ca
# Creating a Private Certificate Authority
# https://www.feistyduck.com/library/openssl-cookbook/online/ch-openssl.html
# Template https://github.com/ivanr/bulletproof-tls/blob/master/private-ca/root-ca.conf
# The first part of the configuration file contains some basic CA information, such as the name and the base URL, and the components of the CA’s distinguished name. Because the syntax is flexible, information needs to be provided only once:
[default]
name = ca
default_ca = ca_default
name_opt = utf8,esc_ctrl,multiline,lname,align
@rgherta
rgherta / gist:cf8c0feb0d9c6ec6cabce14c99609bdd
Created June 3, 2017 14:26
Python function for replacing values in a word template and save as pdf
#FUNCTION DEFINITION
def saveInvoice(templateName, saveWithName, valuesDictionary):
word = win32.gencache.EnsureDispatch('Word.Application')
word.Visible = False
myTemplate = word.Documents.Open(templateName)
for key in valuesDictionary:
find = word.Selection.Find
find.Text = key
find.Replacement.Text = valuesDictionary[key]
/*
* Copyright (C) 2016 The Android Open Source Project
*
* 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
*
* Unless required by applicable law or agreed to in writing, software
@rgherta
rgherta / addin.xlam
Last active January 19, 2017 12:46
Custom Addin with Ribbon in Excel
#Rels
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
<Relationship Id="rId7" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/>
<Relationship Id="rId6" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>
<Relationship Id="rId5" Type="http://schemas.microsoft.com/office/2006/relationships/ui/extensibility" Target="customUI/customUI.xml"/>
</Relationships>
@rgherta
rgherta / httprequest.xlsm
Last active January 19, 2017 12:48
HTTP request in VBA
'Using Microsoft XML, v6.0
Sub postrequest()
Dim conn As New XMLHTTP60
conn.Open "post", "https://duckduckgo.com/?q=hello", False
conn.send