Skip to content

Instantly share code, notes, and snippets.

View arajkumar's full-sized avatar
🏡

Arunprasad Rajkumar arajkumar

🏡
View GitHub Profile
@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
@arajkumar
arajkumar / grafana-query-variable.json
Created February 10, 2022 16:41
grafana-query-variable
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@arajkumar
arajkumar / extract-court-stamp.js
Last active February 8, 2022 17:50
extract-court-stamp.js
javascript:(() => {const doc = document.getElementsByName('loginFrame')[0].contentWindow.document.getElementById('prodPage').contentWindow.document.getElementsByName('actionFrame')[0].contentWindow.document;const e = doc.getElementsByTagName('embed')[0];document.location.replace(`${document.location.href}/../${e.getAttribute('pprintpg')}?vRcptNo=${encodeURIComponent(e.getAttribute('vpar'))}&vUsrID=${e.getAttribute('pusrid')}&vSession=${e.getAttribute('psession')}`)})