Skip to content

Instantly share code, notes, and snippets.

View swedishmike's full-sized avatar
🤡
Beavering away...

Mike Eriksson swedishmike

🤡
Beavering away...
View GitHub Profile
@chloegrace94
chloegrace94 / decrypt_environment_variable.py
Created October 2, 2018 15:14
How to decrypt an AWS Lambda environment variable
import boto3 # AWS SDK for Python
import os
from base64 import b64decode
# Retrieve environment variables
encrypted_environment_variable_a = os.environ['a']
encrypted_environment_variable_b = os.environ['b']
# KMS Client
@neu5ron
neu5ron / additional_http_headers-main.bro
Last active January 9, 2019 11:18
Add Additional HTTP Header fields to Bro http logs
module HTTP;
# Add additional HTTP Headers
redef record Info += {
#Origin "Origin"
origin: string &log &optional;
};
event http_header(c: connection, is_orig: bool, name: string, value: string) &priority=5
@martinapugliese
martinapugliese / ref_es_queries.md
Last active August 14, 2023 08:08
Sample Elasticsearch queries in Python, as reference.

Collection of sample Elasticsearch queries

Use the Python client elasticsearch.

Connect to cluster (the client)

from elasticsearch import Elasticsearch

es_client = Elasticsearch() # local