This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script to tar all files within a given source directory aggregated by year and month | |
# generates files like: | |
# 201701.tar.gz 201805.tar.gz etc... | |
# Check to see if parallel command & pigz command is available | |
command -v parallel >/dev/null 2>&1 || { echo >&2 "I require Parallel but it's not installed. Aborting."; exit 1; } | |
command -v pigz >/dev/null 2>&1 || { echo >&2 "I require Pigz but it's not installed. Aborting."; exit 1; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from collections import namedtuple | |
from itertools import groupby | |
from fastnumbers import isint | |
from ipaddress import ip_address | |
def is_ip(test_string): | |
"""Checks whether a given string contains IP address or IP address with port | |
:param test_string: The string to test for IP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
import re2 as re | |
except: | |
import re | |
import csv | |
from typing import List, Dict | |
__all__ = ["cef_to_csv"] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import datetime | |
import time | |
import calendar | |
from typing import List | |
def dedupe_dates(lst: list, precision: str="day", tz_aware: bool=False) -> List: | |
"""Dedupe a given list of dateobjects | |
:param lst: list of date objects |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Very simple HTTP server in python for logging requests including JSON BODY | |
Usage:: | |
./server.py [<port>] | |
""" | |
from http.server import BaseHTTPRequestHandler, HTTPServer | |
import json | |
import logging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install the toolchain | |
```bash | |
brew tap SergioBenitez/osxct | |
brew install x86_64-unknown-linux-gnu | |
``` | |
# this should get installed in: | |
# /opt/homebrew/Cellar/x86_64-unknown-linux-gnu/ | |
# Installing the macOS OpenSSL - if not already installed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download the Source | |
```bash | |
cd /tmp/ | |
wget https://ftp.postgresql.org/pub/source/v14.2/postgresql-14.2.tar.gz | |
tar xvf postgresql-14.2.tar.gz | |
cd postgresql-14.2 | |
``` | |
# Configure | |
# - with openssl |