Skip to content

Instantly share code, notes, and snippets.

View gangsta's full-sized avatar

Karen Harutyunyan gangsta

View GitHub Profile
gangsta /
Last active April 15, 2024 21:48
Mastering JSON Parsing with jq: A Comprehensive Guide for Time and Date Range Filters in API Data Processing with Bash

Welcome! If you're here, chances are you've made an API call, and it's returning JSON data that you want to parse using a jq script. Let's work through it together.

Whether you're a seasoned developer or just starting out, this blog is your go-to resource for mastering the art of JSON parsing with jq. Specifically, if you're searching for insights on how to efficiently filter and process date ranges, you've come to the right place.

Explore topics such as 'jq filter date range', 'jq how to select date range', 'jq filter selected date range', "How to select a date range from a JSON string by using jq", "jq between two dates" and more. Whether you're looking to filter records in the future, select last week's records, or retrieve emails from a specific timeframe using jq, this blog provides a comprehensive guide to help you navigate the intricacies of JSON parsing with precision.

Let's dive into the world of jq and together, master the art of effortlessly filtering and selecting date ranges!

JSON example

gangsta /
Last active February 15, 2023 21:19
Get Started with HashiCorp Vault Presentation Demo Document


# Install
curl -fsSL | sudo apt-key add -
sudo apt-add-repository "deb [arch=amd64] $(lsb_release -cs) main"
sudo apt-get update -y
sudo apt-get install vault -y

# Start
gangsta /
Created November 11, 2022 11:47
Fedora Screen Share - black screen when sharing Wayland / Gnome

Google Chrome

Wayland’s way of screenshare is improving, you can

  • Navigate to page chrome://flags
  • Search for WebRTC
  • flip that switch to Enabled
  • Restart the browser (Chrome will auto ask, if not manually restart the browser)
gangsta /
Last active December 13, 2021 12:48
Fedora 35 Mic issue, No sound , Missing audio on Lenovo ThinkPad t14s | 490s

Common error.

fedora pulseaudio[2352]: Failed to create sink input: sink is suspended.


systemctl --user enable --now wireplumber
gangsta /
Last active March 23, 2023 14:54
Daily Linux Commands Cheat Sheet

Delete Github branches except main or master

git branch | grep -v "main" | xargs git branch -D

Useful Commands list


gangsta /
Created January 11, 2021 10:52
Kubernetes argo tunnel setup via helm charts


Error: validation failed: unable to recognize "": no matches for kind "Deployment" in version "extensions/v1beta1"

Temporary Solution

Kubernetes 1.16+

git clone
cd helm-charts/charts/
gangsta /
Created February 6, 2020 08:55
How to disable fedora 31 problem reporter

How to Disable Fedora 31 problem reporter

/sbin/service abrtd stop
chkconfig abrtd off
gangsta /
Last active January 16, 2020 10:13
How to Remove Vagrant domain from Fedora 30,31

If you removed Vagrantfile but not Vagrant host. you'll get following error:

Name 'vagrantbox_default' of domain about to create is already taken. Please try to run 'vagrant up' command again.

For Fedora users, or force undefine you need following.

To install virsh.

gangsta /
Last active May 25, 2024 21:30
Fedora 30 Connect to OpenVPN

Install Openvpn

sudo dnf install openvpn

Configure Path

mv myopenvpconfig /etc/openvpn/client/
gangsta / Prometheus node_exporter Metrics Data Size and Time Count
Last active April 10, 2019 15:21
Bash Script to Fetching Node_Exporter Data Size and Time for Consuming Metrics
#!/usr/bin/env bash
set -e
bytesToHuman() {
b=${1:-0}; d=''; s=0; S=(Bytes {K,M,G,T,E,P,Y,Z}iB)
while ((b > 1024)); do
d="$(printf ".%02d" $((b % 1024 * 100 / 1024)))"
b=$((b / 1024))
let s++