Skip to content

Instantly share code, notes, and snippets.

View mattchainsaw's full-sized avatar

Matthew Meyer mattchainsaw

View GitHub Profile
@mattchainsaw
mattchainsaw / run.sh
Created May 11, 2016 21:37
Notification of job completion
#!/bin/bash
#
# This still works with piping and redirection of output.
# Ex)
# bash run.sh ./long_computation > long_computation.out
if [ ! $1 ]
then
echo "Usage: $0 <command>" >&2
fi
@mattchainsaw
mattchainsaw / where.sh
Last active May 11, 2016 21:37
Poetry for Plebs. Recursively search for instance of a string in all files and subfolders. Usage: ./where.sh <regex>
#!/bin/bash
find . -type f |
while read x
do
cat $x | egrep --color=always "$1" &&
echo -e "\e[36m$x\e[0m" &&
echo
done

Keybase proof

I hereby claim:

  • I am mattchainsaw on github.
  • I am mattchainsaw (https://keybase.io/mattchainsaw) on keybase.
  • I have a public key ASCo1XyYGed3gbZlrS6ZJhJJj_bL9b2ea3NFjHqJ8CguOwo

To claim this, I am signing this object:

@mattchainsaw
mattchainsaw / cve.py
Created June 29, 2023 02:09
CLI for retrieving CVE data from NIST with caching.
import sqlite3
import sys
import requests
# The public rate limit (without an API key) is 5 requests in a rolling 30 second window.
# The rate limit with an API key is 50 requests in a rolling 30 second window
# https://nvd.nist.gov/developers/start-here
nist_url = 'https://services.nvd.nist.gov/rest/json/cves/2.0'
db_file = 'cve.db'