Skip to content

Instantly share code, notes, and snippets.

@fallwith
fallwith / README.md
Last active May 15, 2024 21:41
Beta test instructions for observing Ruby based AWS Lambda functions with New Relic

NOTE - Ruby is now fully supported and out of beta

New Relic's support for Ruby AWS Lambda functions is now out of beta and the instructions below should be considered out of date. Please see the official documentation for instructions on instrumenting your Lambda functions. When using the New Relic Lambda CLI tool, everything is automated. When manually introducing New Relic to your Lambda functions, please use one of the official New Relic Lambda layers instead of the .zip files contained in these beta test instructions.

Beta test instructions for observing Ruby based AWS Lambda functions with New Relic

Synopsis

These instructions will explain how to enhance an existing Ruby based AWS Lambda function to have it observed by New Relic.

@fallwith
fallwith / span_events.rb
Created April 19, 2024 23:44
Use the New Relic Ruby agent to report 10,000 spans within a minute
#!/usr/bin/env ruby
# frozen_string_literal: true
# Instructions:
# 1. Copy a valid newrelic.yml file to the same directory as span_events.rb
# 2. Make sure at least the following parameters are set in newrelic.yml:
# - license_key: <your license key>
# - audit_log.enabled: true
# - span_events.max_samples_stored: 10000
# 3. ruby span_events.rb
@fallwith
fallwith / obfus.rb
Created August 21, 2024 03:49
SQL Obfuscation While Exempting Comments Proof of Concept
#!/usr/bin/env ruby
# frozen_string_literal: true
statements = [{ input: 'SELECT this FROM there WHERE userId = 123 AND roleId = 456 LIMIT 11',
expected: 'SELECT this FROM there WHERE userId = ? AND roleId = ? LIMIT ?' },
{ input: "SELECT this FROM there WHERE userId = 123 AND roleId = 456 LIMIT 11\n-- Linking id: 867",
expected: "SELECT this FROM there WHERE userId = ? AND roleId = ? LIMIT ?\n-- Linking id: 867" },
{ input: "SELECT this FROM there WHERE userId = 123 /* linking id:\n867 */ AND roleId = 456 LIMIT 11",
expected: "SELECT this FROM there WHERE userId = ? /* linking id:\n867 */ AND roleId = ? LIMIT ?" }]
@fallwith
fallwith / ANSI.md
Created March 13, 2025 00:40 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27