Skip to content

Instantly share code, notes, and snippets.

View mabdi's full-sized avatar
😷

Mehrdad Abdi mabdi

😷
  • Universitet Antwerpen
  • Belgium
View GitHub Profile
@ctalkington
ctalkington / Gemfile
Last active May 16, 2023 20:19
Nginx, Sinatra, and Puma.
source :rubygems
gem "puma"
gem "sinatra"
Entry = Struct.new(:timestamp, :clientID, :objectID, :size, :method, :status, :type, :server) do
REGIONS = [:SantaClara, :Plano, :Herndon, :Paris]
PROTOCOLS = [:HTTP_09, :HTTP_10, :HTTP_11, :HTTP_XX]
METHODS = [:get, :head, :post, :put, :delete, :trace, :options, :connect, :other]
STATUS_CODES = [100, 101, 200, 201, 202, 203, 204, 205, 206, 300, 301, 302, 303, 304, 305, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 500, 501, 502, 503, 504, 505, :other]
FILE_TYPES = [:html, :image, :audio, :video, :java, :formatted, :dynamic, :text, :compressed, :programs, :directory, :icl, :other]
def self.parse(bytes)
values = bytes.unpack("NNNNCCCC")
entry = self.new