Skip to content

Instantly share code, notes, and snippets.

anandsunderraman / logback.xml
Last active February 2, 2024 02:21
logback configuration for structured logging
View logback.xml
<?xml version="1.0" encoding="UTF-8"?>
<appender class="ch.qos.logback.core.ConsoleAppender" name="stdout">
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %5p [appName:%thread:%X{X-B3-TraceId}:%X{X-B3-SpanId}] %logger{40} - %msg%n
<appender class="ch.qos.logback.core.ConsoleAppender" name="jsonstdout">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
anandsunderraman / gist:568f55e2201d51a4bd2af1b2e4aafb6a
Created October 5, 2023 19:24 — forked from speric/gist:6096965
vimtutor Lesson Summaries
View gist:568f55e2201d51a4bd2af1b2e4aafb6a
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 / setChromeOptions.js
Last active February 21, 2023 01:07
Selenium Web Driver Set Chrome Options
View setChromeOptions.js
//import the selenium web driver
var webdriver = require('selenium-webdriver');
var chromeCapabilities =;
//setting chrome options to start the browser fully maximized
var chromeOptions = {
'args': ['--test-type', '--start-maximized']
chromeCapabilities.set('chromeOptions', chromeOptions);
var driver = new webdriver.Builder().withCapabilities(chromeCapabilities).build();
anandsunderraman /
Created November 6, 2022 09:53 — forked from rueycheng/
GNU Make cheatsheet
anandsunderraman / mapofmapofstringtostring.json
Created August 24, 2022 13:32
JSON Schema for a map of map of string and string
View mapofmapofstringtostring.json
"type": "object",
"type": "string"
anandsunderraman /
Created May 10, 2022 15:46 — forked from domanchi/
[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.


Events over time

anandsunderraman / arrayToCSV.js
Created September 23, 2019 20:16
Robo 3T array to csv
View arrayToCSV.js
//function to print CSV from an array for robomongo
//place this in .robomongorc.js which should be present in your home directory
//inspired by
function toCSV(array) {
let deliminator = ',';
let textQualifier = '\"';
let headers = [];
var data = {};
var count = -1;
anandsunderraman / grpcurlLibrary.go
Created February 4, 2021 14:32
Using grpcurl as a library
View grpcurlLibrary.go
package main
import (
anandsunderraman /
Created January 8, 2021 14:56 — forked from joseluisq/
Add Git Branch Name to Terminal Prompt (Linux/Mac)

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


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

# Git branch in prompt.

parse_git_branch() {
anandsunderraman / gist:5852834
Created June 24, 2013 19:34
Regular Expression to Format Currency In Javascript
View gist:5852834
function formatCurrency(amount)
//truncate the amount to 0 decimals
//for every digit that is followed by 3 digits and a word boundary
//add a comma
amount = amount.toFixed(0).replace(/(\d)(?=(\d{3})+\b)/g, "$1,");
return amount;