Skip to content

Instantly share code, notes, and snippets.

View alessandrobologna's full-sized avatar

Alessandro Bologna alessandrobologna

View GitHub Profile
@alessandrobologna
alessandrobologna / delete_honeycomb_datasets.py
Last active April 22, 2025 00:47
script to delete honeycomb datasets
#!/usr/bin/env python3
# /// script
# requires-python = ">=3.13"
# dependencies = [
# "requests<3",
# "click>=8.0.0",
# "rich>=13.0.0",
# ]
# ///
"""
@alessandrobologna
alessandrobologna / build-output.txt
Created October 2, 2024 15:59
rust otel 0.26.0 tracing opentelemetry
Compiling otel26 v0.1.0 (/Users/abologna/git/rust/otel26)
error[E0277]: the trait bound `opentelemetry_sdk::trace::Tracer: opentelemetry::trace::tracer::Tracer` is not satisfied
--> src/main.rs:15:64
|
15 | let telemetry = tracing_opentelemetry::layer().with_tracer(tracer);
| ----------- ^^^^^^ the trait `opentelemetry::trace::tracer::Tracer` is not implemented for `opentelemetry_sdk::trace::Tracer`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `opentelemetry::trace::tracer::Tracer`:
@alessandrobologna
alessandrobologna / abtest.md
Last active April 14, 2024 04:07
apache benchmark test

Test from us-west-2

FURL direct invocation

[cloudshell-user@ip-10-134-76-174 ~]$ ab -c 1 -n 100 -k -H "authorization: $AUTH" https://dbnmtkykig3vobqu6f73dbgiam0qxeot.lambda-url.us-west-2.on.aws/todo-lists
This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking dbnmtkykig3vobqu6f73dbgiam0qxeot.lambda-url.us-west-2.on.aws (be patient).....done
@alessandrobologna
alessandrobologna / main.py
Created February 24, 2023 12:30
sigv4 sample
import boto3
from botocore.auth import SigV4Auth
from botocore.awsrequest import AWSRequest
session = boto3.Session()
credentials = session.get_credentials().get_frozen_credentials()
def make_signed_request(method, url, service_name, region, data=None, params=None, headers=None):
request = AWSRequest(method=method, url=url, data=data, params=params, headers=headers)
SigV4Auth(credentials, service_name, region).add_auth(request)
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "AWS CloudFormation Sample Template EC2ChooseAMI: Example to show how to chose an AMI based on the region and the architecture type. **WARNING** This template creates an Amazon EC2 instance. You will be billed for the AWS resources used if you create a stack from this template.",
"Parameters" : {
"InstanceType" : {
"Description" : "WebServer EC2 instance type",
"Type" : "String",
"Default" : "m1.small",
CREATE EXTERNAL TABLE `ticker_symbols`(
`ticker_symbol` string,
`sector` string,
`change` double,
`price` double,
`firehose` struct<record_id:string,timestamp:bigint>
)
PARTITIONED BY (
`year` string,
`month` string,
GlueNotificationEventRule:
Type: AWS::Events::Rule
Properties:
Name: !Sub '${ProjectName}-glue-events-${Stage}'
State: ENABLED
EventPattern:
source:
- aws.glue
detail-type:
- Glue Data Catalog Database State Change
{
"version": "0",
"id": "5089ddb8-2ab5-4739-7323-8519741f53d7",
"detail-type": "Glue Data Catalog Database State Change",
"source": "aws.glue",
"account": "123456789012",
"time": "2019-04-25T15:40:07Z",
"region": "us-east-1",
"resources": [
"arn:aws:glue:us-east-1:123456789012:table/dbname/table_name"
GlueNotificationEventRule:
Type: AWS::Events::Rule
Properties:
Name: !Sub '${ProjectName}-glue-events-${Stage}'
State: ENABLED
EventPattern:
source:
- aws.glue
detail-type:
- Glue Data Catalog Database State Change
@alessandrobologna
alessandrobologna / all-conditons.json
Last active August 6, 2018 16:04
s3 tag policies
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "test01",
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": "*",
"Condition": {
"ForAllValues:StringEquals": {