Skip to content

Instantly share code, notes, and snippets.

View LeeHampton's full-sized avatar

Lee Hampton LeeHampton

  • Timescale
  • New York City
View GitHub Profile
@LeeHampton
LeeHampton / filter_throttle.rb
Created April 1, 2021 17:32
filter throttle
# frozen_string_literal: true
require 'fluent/plugin/filter'
module Fluent::Plugin
class ThrottleFilter < Filter
Fluent::Plugin.register_filter('throttle', self)
desc "Used to group logs. Groups are rate limited independently"
config_param :group_key, :array, :default => ['kubernetes.container_name']
from Crypto.Cipher import AES
import binascii, os
def encrypt_AES_GCM(msg, secretKey):
aesCipher = AES.new(secretKey, AES.MODE_GCM)
ciphertext, authTag = aesCipher.encrypt_and_digest(msg)
print("ciphertext: {}, authTag: {}".format(ciphertext, authTag))
return (ciphertext, aesCipher.nonce, authTag)
def decrypt_AES_GCM(encryptedMsg, secretKey):
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
require_once 'Requests/Library/Requests.php';
Requests::register_autoloader();
exec("mv json/*.json json/old/"); // Backup old files