This file contains hidden or 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
| #include <linux/bpf.h> | |
| #include <bpf/bpf_helpers.h> | |
| #include <bpf/bpf_tracing.h> | |
| char LICENSE[] SEC("license") = "GPL"; | |
| #define MAX_PAYLOAD_SIZE 128 | |
| struct ssl_event_t { | |
| __u32 pid; |
This file contains hidden or 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
| package ipc | |
| import ( | |
| "fmt" | |
| "os" | |
| "syscall" | |
| ) | |
| // MmapSharedMemory opens or creates a file at the specified path, | |
| // truncates it to the target size, and maps it into virtual memory. |
This file contains hidden or 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
| agent { | |
| data_dir = "/run/spire/data" | |
| log_level = "info" | |
| server_address = "spire-server.spire.svc.cluster.local" | |
| server_port = 8081 | |
| socket_path = "/run/spire/sockets/agent.sock" | |
| trust_bundle_path = "/run/spire/bundle/bundle.crt" | |
| trust_domain = "prod.muklis.dev" | |
| } |
This file contains hidden or 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
| package storage | |
| import ( | |
| "encoding/binary" | |
| "fmt" | |
| ) | |
| // KeyLayout defines the internal binary representation of a key in the LSM-tree. | |
| // Keys are formatted as: [User Key (Variable)] [Raft Index (8 Bytes)] [Type (1 Byte)] | |
| // Sorting by User Key ascending, and then Raft Index descending ensures that |
This file contains hidden or 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
| use std::alloc::{alloc, dealloc, Layout}; | |
| use std::ptr::NonNull; | |
| pub struct VectorTable { | |
| ptr: NonNull<f32>, | |
| dimension: usize, | |
| capacity: usize, | |
| len: usize, | |
| } |
This file contains hidden or 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
| #include <vmlinux.h> | |
| #include <bpf/bpf_helpers.h> | |
| #include <bpf/bpf_core_read.h> | |
| char LICENSE[] SEC("license") = "GPL"; | |
| struct hist_key { | |
| u32 dev; | |
| u32 bucket; | |
| }; |
This file contains hidden or 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
| apiVersion: cert-manager.io/v1 | |
| kind: Certificate | |
| metadata: | |
| name: spire-upstream-ca | |
| namespace: spire | |
| spec: | |
| secretName: spire-upstream-ca-secret | |
| duration: 2160h # 90 days | |
| renewBefore: 360h # 15 days | |
| commonName: spire-ca.prod.mycompany.internal |
This file contains hidden or 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
| // Add these dependencies to your Cargo.toml for building the semantic cache | |
| /* | |
| [dependencies] | |
| faiss = "0.12.0" | |
| moka = { version = "0.12.0", features = ["future"] } | |
| ort = "1.16.0" | |
| serde = { version = "1.0", features = ["derive"] } | |
| serde_json = "1.0" | |
| tokio = { version = "1.35", features = ["full"] } | |
| tokenizers = "0.13.4" |
This file contains hidden or 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
| const { PerformanceObserver } = require('perf_hooks'); | |
| const v8 = require('v8'); | |
| class MemoryAnomalyDetector { | |
| constructor(thresholdPercentage = 0.85, sampleWindow = 5) { | |
| this.thresholdPercentage = thresholdPercentage; | |
| this.sampleWindow = sampleWindow; | |
| this.postGcHeapHistory = []; | |
| this.isDumping = false; | |
| this.initGCListener(); |
This file contains hidden or 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
| use bb8::Pool; | |
| use bb8_redis::RedisConnectionManager; | |
| /// Convenient type alias for the thread-safe connection pool. | |
| pub type RedisPool = Pool<RedisConnectionManager>; | |
| /// Initializes the asynchronous Redis connection pool with customizable limits. | |
| pub async fn create_redis_pool( | |
| redis_uri: &str, | |
| max_pool_size: u32, |