Skip to content

Instantly share code, notes, and snippets.

View briri's full-sized avatar

Brian Riley briri

View GitHub Profile
@briri
briri / gist:92c432da6793acbf0f52
Last active August 29, 2015 14:02
Make JSON readable
# This is just a quick little script to use Ruby's JSON.pretty_generate() method without having to start an irb session.
# To call this JSON prettier just pass the flattened JSON in as an argument.
# To run it:
# 1) copy the code below into a file called json_viewer.rb
# 2) > ruby json_viewer.rb '{"foo":"bar","yadda":"yadda","blah":["blah1","blah2"]}'
require 'json'
unless ARGV[0].nil?
@briri
briri / gist:721b5d97df2280784c73
Last active August 29, 2015 14:06
OS X Nokogiri Nightmares

Nightmares trying to install Nokogiri on OS X Mavericks after installing RBENV

I used to have RVM installed to manage my Ruby environment and decided to move to rbenv. I did the 'rvm implode' and removed it from Homebrew. Once I installed rbenv though, bundler stopped working whenever it tried to install Nokogiri.

Anyway, I hope this is useful and saves someone else from hours of grief!

$ bundle install
...
Building nokogiri using packaged libraries.
@briri
briri / DMPRoadmap_madmp.json
Last active July 6, 2020 21:43
Example RDA Common Standard JSON from DMPRoadmap
{
"application": "dmptool-dev",
"source": "GET /api/v1/plans/44247",
"time": "2020-05-08T15:41:39Z",
"caller": "dmproadmap-test",
"code": 200,
"message": "OK",
"page": 1,
"per_page": 20,
"total_items": 1,

Keybase proof

I hereby claim:

  • I am briri on github.
  • I am briri (https://keybase.io/briri) on keybase.
  • I have a public key ASDSz0A3vBI0eEgYPpHKzQ7WTagymzWa6hOB67rSn7zrHgo

To claim this, I am signing this object:

# Apache Log processor to analize the logs and determine the number of times each path was called, what the response
# was, who called it, and whether or not it looks suspicious
#
# To run it, you should pull down the logs that you want to analize (unzip them) and then combine them into a single log
# file. For example:
# > touch combined.log
# > cat dmptool-stg.cdlib.org-access_log-20230123 >> combined.log
# > cat dmptool-stg.cdlib.org-access_log-20230122 >> combined.log
#
# Then process the combined log file:
@briri
briri / README.md
Last active February 9, 2023 15:45
Using AWS search-resources to find resources by tag(s)