Skip to content

Instantly share code, notes, and snippets.

View genert's full-sized avatar
🌍
Global citizen

G genert

🌍
Global citizen
View GitHub Profile
@genert
genert / test
Created February 18, 2025 16:28
rpk topic create wm.audit-event -p 1 -r 1
rpk topic create wm.queue.processed-operation-log.protobuf -p 1 -r 1
rpk topic create wm.queue.rule-engine-alert.protobuf -p 1 -r 1
rpk topic create wm.queuing.enrich-operation-log.protobuf -p 1 -r 1
rpk topic create wm.queuing.index-document.protobuf -p 1 -r 1
rpk topic create wm.queuing.index-entity.protobuf -p 1 -r 1
rpk topic create wm.queuing.index-object.protobuf -p 1 -r 1
rpk topic create wm.queuing.process-object.protobuf -p 1 -r 1
rpk topic create wm.queuing.processed-object.protobuf -p 1 -r 1
rpk topic create wm.streaming.import-row.protobuf -p 1 -r 1
---
# Helper for configuring a VM.
- hosts: localhost
become: yes
vars:
path_k3s_etc: /etc/rancher/k3s
path_k3s_base: /var/lib/rancher/k3s
path_k3s_storage: "{{ path_k3s_base }}/storage"
Windows Failover Clustering in AWS provides high availability for critical applications by automatically transferring workloads between EC2 instances (nodes) when one fails. The cluster is built on Windows Server Failover Clustering (WSFC), adapted for AWS cloud infrastructure, and uses multiple nodes working together to ensure uptime and resilience.
The nodes run in the same Virtual Private Cloud (VPC) and are typically distributed across multiple AWS Availability Zones (AZs). This distribution ensures fault tolerance against AZ failures. The cluster uses a quorum mechanism to maintain consistency, enabling the cluster to decide which node should take over when a failure occurs.
Storage in AWS Clustering
Traditional shared storage isn't available in AWS, so alternatives are used:
Amazon FSx for Windows File Server provides shared storage with SMB compatibility.
EBS Multi-Attach allows multiple EC2 instances to access a single Elastic Block Store (EBS) volume, which mimics shared storage.
Appli
Terminology
- **Switchover** - A switchover means flipping the roles of the primary and standby databases. When we need to do some maintenance tasks to the primary database that affect its availability, then we can perform the switchover activity. The standby database will take the primary role after switchover, and it opens its database to read-write mode. The switchover activity is usually carried out because of maintenance tasks. In general it is a preplanned task, so everyone will be aware about the activity.
- **Failover** - There are circumstances where the primary database will be terminated because of unexpected failures, such as a hardware failure or network failure. In those conditions, the standby needs to be activated, and it should take the primary’s role and serve application connections. This standby to the primary role conversion should happen even though the standby is not in sync with the primary database. It means the failover might come with data loss.
- **Data Guard Broker** - Data Guard
@genert
genert / doubly_linked_list.go
Created February 14, 2023 20:04
Linked Lists in Golang
package main
import "fmt"
type Node struct {
Value any
Next *Node
Prev *Node
}
{
"id": "d835f5d5-b3ec-47db-a4b9-0a7db4ac0a2c",
"view_id": "c7880063-110c-45cd-8247-d131fc62c01a",
"collection_id": "f5c6819a-5d75-40a9-ac0b-ca2a3196a7b4",
"workspace_id": "4413dd90-1b8a-4e21-8a75-5b23f72a91f9",
"record_type": "person",
"state": "draft",
"conflict_strategy": "update",
"analysis": null,
"column_mapping": [
/*
* libdatachannel example web server
* Copyright (C) 2020 Lara Mackey
* Copyright (C) 2020 Paul-Louis Ageneau
*
* 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 2
* of the License, or (at your option) any later version.
*
package main
import (
"fmt"
"github.com/mike1808/h264decoder/decoder"
"gocv.io/x/gocv"
// "os"
"net"
)
import React, { useContext, useEffect } from 'react';
import { bindActionCreators, compose } from 'redux';
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import { isEqual, get, sortBy, forEach } from 'lodash';
import moment from 'moment';
import { NavConfigContext } from 'components/Nav/Nav';
import Linkify from 'linkifyjs/react';
import {
Button,
@genert
genert / script.js
Created March 29, 2020 12:37
Lumovest - get course total time
function display (seconds) {
const format = val => `0${Math.floor(val)}`.slice(-2)
const hours = seconds / 3600
const minutes = (seconds % 3600) / 60
return [hours, minutes, seconds % 60].map(format).join(':')
}
// The magic
display([...document.querySelectorAll('.lesson-time')].