Skip to content

Instantly share code, notes, and snippets.

@anandsunderraman
anandsunderraman / .jq
Created November 5, 2024 14:18
jq custom functions to convert json attributes case
def map_keys(mapper):
walk(
if type == "object"
then
with_entries({
key: (.key|mapper),
value
})
else .
end
@anandsunderraman
anandsunderraman / gist:568f55e2201d51a4bd2af1b2e4aafb6a
Created October 5, 2023 19:24 — forked from speric/gist:6096965
vimtutor Lesson Summaries
Lesson 1 SUMMARY
1. The cursor is moved using either the arrow keys or the hjkl keys.
h (left) j (down) k (up) l (right)
2. To start Vim from the shell prompt type: vim FILENAME <ENTER>
3. To exit Vim type: <ESC> :q! <ENTER> to trash all changes.
OR type: <ESC> :wq <ENTER> to save the changes.
@anandsunderraman
anandsunderraman / GNU-Make.md
Created November 6, 2022 09:53 — forked from rueycheng/GNU-Make.md
GNU Make cheatsheet
@anandsunderraman
anandsunderraman / mapofmapofstringtostring.json
Created August 24, 2022 13:32
JSON Schema for a map of map of string and string
{
"$defs":
{
"MapStringToString":
{
"type": "object",
"additionalProperties":
{
"type": "string"
}
@anandsunderraman
anandsunderraman / cheatsheet.md
Created May 10, 2022 15:46 — forked from domanchi/cheatsheet.md
[splunk cheatsheet] Splunk snippets, because their syntax is so confusing. #splunk

Splunk Queries

I really don't like Splunk documentation. Why is it so hard to find out how to do a certain action? So this is a cheatsheet that I constructed to help me quickly gain knowledge that I need.

Analysis

Events over time

index="my_log"
@anandsunderraman
anandsunderraman / grpcurlLibrary.go
Created February 4, 2021 14:32
Using grpcurl as a library
package main
import (
"bytes"
"fmt"
"github.com/fullstorydev/grpcurl"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials"
@anandsunderraman
anandsunderraman / terminal-git-branch-name.md
Created January 8, 2021 14:56 — forked from joseluisq/terminal-git-branch-name.md
Add Git Branch Name to Terminal Prompt (Linux/Mac)

Add Git Branch Name to Terminal Prompt (Linux/Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {
This file has been truncated, but you can view the full file.
{
"format": "graph-model",
"generatedBy": "2.3.0",
"convertedBy": "TensorFlow.js Converter v2.4.0",
"userDefinedMetadata": {
"signature": {
"inputs": {
"input_tensor:0": {
"name": "input_tensor:0",
"dtype": "DT_UINT8",
@anandsunderraman
anandsunderraman / docker-compose.yml
Last active September 21, 2020 03:37
ELK docker compose
version: '3'
services:
elastic:
image: docker.elastic.co/elasticsearch/elasticsearch:6.6.0
ports:
- "9200:9200"
- "9300:9300"
environment:
- discovery.type=single-node
@anandsunderraman
anandsunderraman / logger.js
Created June 11, 2020 05:27
node structured logging configuration
'use strict';
const winston = require('winston');
const MESSAGE = Symbol.for('message');
const jsonFormatter = (logEntry) => {
const base = { timestamp: new Date() };
const json = Object.assign(base, logEntry)
logEntry[MESSAGE] = JSON.stringify(json);
return logEntry;