Skip to content

Instantly share code, notes, and snippets.

@ashishmadeti
ashishmadeti / trivy_csv.tpl
Created November 12, 2021 05:42
Template for generating a trivy report in CSV format
Image,PackageName,VulnerabilityID,Severity,Score,InstalledVersion,FixedVersion,Title
{{ range . }}
{{- $target := .Target -}}
{{- if (eq (len .Vulnerabilities) 0) }}
{{- $target }},,,,,,,
{{- else }}
{{- range .Vulnerabilities }}
{{- $description := .Title }}
{{- if not $description }}
{{- $description = .Description -}}
@ashishmadeti
ashishmadeti / argparse_boilerplate.py
Created October 27, 2021 08:51
Boilerplate code for accepting and parsing command line arguments in Python and Javascript
#!/usr/bin/python3
import argparse
parser = argparse.ArgumentParser(description="Grep for JSON log files")
parser.add_argument('pattern', help='pattern to search for in each line')
parser.add_argument('file', help='file to search the pattern in')
parser.add_argument('-k', help='search only in keys of the JSON object', action="store_true")
# Implement rest of the command line flags here
args = parser.parse_args()
@ashishmadeti
ashishmadeti / investments.csv
Last active September 13, 2020 10:38
Sample investments.csv file
ID Date Amount Sector
1.00 06/01/2020 10 BigData
2.00 23/01/2020 20 E-Commerce
3.00 02/02/2020 35 FinTech
4.00 10/02/2020 65 SaaS
5.00 14/02/2020 15 BigData
6.00 17/02/2020 5 SaaS
7.00 29/02/2020 5 FinTech
8.00 18/03/2020 15 BigData
9.00 03/05/2020 30 E-Commerce
@ashishmadeti
ashishmadeti / budget.csv
Created November 11, 2019 13:25
Sample budget.csv file
ID Amount Time Period Sector
1.00 75 Month
2.00 30 FinTech
3.00 25 Quarter BigData
4.00 70 Year E-Commerce
5.00 350.00 Year
@ashishmadeti
ashishmadeti / example.json
Last active November 11, 2019 13:20
Example.json
{
"petitioner": {
"name": "State Bank of India",
"type": "Company",
"address": {
"building": "B-401",
"street": "Clover Park",
"city": "Pune"
}
},
@ashishmadeti
ashishmadeti / advocates.csv
Created November 11, 2019 13:16
Sample advocates.csv file
Advocate Range
Mohit Mishra 1.1
Jitesh Joshi 1.2.1 - 1.3.1
Pradeep Pandey 1.3.1 - 1.3.3
Rohit Roy 1.3.3
@ashishmadeti
ashishmadeti / read_csv.js
Created November 11, 2019 13:09
Reading a CSV in Node.js
const readline = require('readline');
const fs = require('fs');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
// Consider the following CSV for the purpose of this example
@ashishmadeti
ashishmadeti / read_csv.py
Created November 11, 2019 12:27
Reading a CSV in Python 3
import csv
path_to_csv = input() # Take absolute path to the CSV file as input
# Consider the following CSV for the purpose of this example
# ID,Name
# 1.1,State Bank of India
# 1.2.1,K. L. Nair
# 1.2.2,Joyce Saldanha
# 1.3.1,Jagdish Singh
@ashishmadeti
ashishmadeti / litigants.csv
Last active November 11, 2019 13:17
Sample litigants.csv file
ID Name
1.1 State Bank of India
1.2.1 K. L. Nair
1.2.2 Joyce Saldanha
1.3.1 Jagdish Singh
1.3.2 Neeta Singh
1.3.3 Amit Singh

Keybase proof

I hereby claim:

  • I am ashishmadeti on github.
  • I am madeti (https://keybase.io/madeti) on keybase.
  • I have a public key ASDmzI9kxYfPE60bR3ktafhlCjwELTD2F4SvV91L_sSVyAo

To claim this, I am signing this object: