Skip to content

Instantly share code, notes, and snippets.

View arajkumar's full-sized avatar
🏡

Arunprasad Rajkumar arajkumar

🏡
View GitHub Profile
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Tigerlake vs live-sync — starting with 4 tables</title>
<style>
:root {
--bg: #0f1320;
--panel: #161c2e;
--panel-2: #1d2540;
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>commitLSN vs endLSN in logical replication</title>
<style>
body { font: 14px/1.5 -apple-system, system-ui, sans-serif; max-width: 980px; margin: 32px auto; padding: 0 16px; color: #1e293b; }
h1 { font-size: 22px; }
h2 { font-size: 17px; margin-top: 32px; border-bottom: 1px solid #e2e8f0; padding-bottom: 4px; }
code, pre { font-family: "SF Mono", Menlo, monospace; font-size: 13px; }
@arajkumar
arajkumar / pq.c
Created February 26, 2024 18:05
pipeline benchmarking
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
#include <libpq-fe.h>
bool exit_pipe(PGconn *connection )
{
PGpipelineStatus status = PQpipelineStatus(connection);
@arajkumar
arajkumar / auth_request.js
Created April 4, 2023 05:07
nginx config to validate client credentials
// /etc/nginx/njs/stream/auth_request.js
async function authValidate(r) {
const basicAuth = r.headersIn['Authorization'];
if (!basicAuth.toLowerCase().startsWith("basic")) {
r.error("Only BasicAuth is supported");
r.return(401);
return;
}
const basicAuthDecoded = atob(basicAuth.replace(/Basic/gi, "").trim());
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
# Apply your stack customization here. This file is not tracked by git.
# If you want to make persistent changes to this file you can do so by using
# `git update-index --no-assume-unchanged values-overrides.yaml` command,
# commiting changes, and then disabling file tracking by running
# `git update-index --assume-unchanged values-overrides.yaml` command.
prometheus:
# Configuration options in https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#monitoring.coreos.com/v1.RemoteWriteSpec
remoteWrite:
@arajkumar
arajkumar / dashboard.yaml
Created September 12, 2022 10:10
promscale jaeger grpc write perf
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
@arajkumar
arajkumar / ocp-uwm.yaml
Created March 23, 2022 07:53
OCP UWM Monitoring with example app
apiVersion: v1
kind: ConfigMap
metadata:
name: cluster-monitoring-config
namespace: openshift-monitoring
data:
config.yaml: |
enableUserWorkload: true
---
apiVersion: v1
@arajkumar
arajkumar / avalanche.yaml
Created February 25, 2022 10:35
avalanche.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: cluster-monitoring-config
namespace: openshift-monitoring
data:
config.yaml: |
enableUserWorkload: true
prometheusK8s:
@arajkumar
arajkumar / get-fmb.sh
Last active February 23, 2022 12:07
FMB Sketch
SURVEY_NUM=$1
curl 'https://collabland-tn.gov.in/rest/Collabland/FMBMapServicePDF' \
--data-raw "state=33&giscode=S1204004${SURVEY_NUM}&plotno=&scale=0&width=500&height=500" \
--compressed | jq -r '.success' | base64 -D > $PWD/FMB-${SURVEY_NUM}.pdf