Skip to content

Instantly share code, notes, and snippets.

View NickLaMuro's full-sized avatar
:bowtie:
probably definitely most likely rebasing...

Nick LaMuro NickLaMuro

:bowtie:
probably definitely most likely rebasing...
View GitHub Profile
@NickLaMuro
NickLaMuro / json_aliases.sh
Last active August 29, 2015 14:17
Bash aliases/functions for parsing and viewing json
# Pretty print json in the terminal like so:
# $ echo "{'json': 'stuff'}" | json
alias json='python -mjson.tool'
# Parses json. Each arg is a level deeper in the tree:
#
# Examples
#
# echo "{'json': {'foo': 'bar'}}" | parse_json
# => {'json': {'foo': 'bar'}}
@NickLaMuro
NickLaMuro / Instructions.md
Created December 5, 2011 21:34
Flash on chrome for linux

This is just a quick set of instructions to install google chrome with flash for ubuntu.

###1. Install chrome

I just grabbed the install from www.google.com/chrome and installed it that way.

###2. Install the flash plugin

sudo apt-get install flashplugin-nonfree
@NickLaMuro
NickLaMuro / setup.sh
Created April 2, 2012 20:07 — forked from pbyrne/setup.sh
Set Up Work Laptop
#!/bin/bash
echo "Updating Homebrew and bash completion"
brew update
echo "
# homebrew completion files for installed libraries
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
" >> ~/.bash_profile
@NickLaMuro
NickLaMuro / .ackrc
Created March 5, 2013 19:47
My Ack config file.
--ignore-dir=cache
--ignore-dir=coverage
--ignore-dir=tmp
--ignore-dir=log
@NickLaMuro
NickLaMuro / .gitignore
Last active April 26, 2016 16:36
Ruby Default File Sorting on different Operating systems
.vagrant
@NickLaMuro
NickLaMuro / README.md
Last active July 25, 2016 16:32
Debugging bundler stalling issues

The following is a way to determine where in the codebase bundler is stalling when fetching from external sources (rubygems.org, github.com, etc.). Use this as a way to determine where in the codebase bundler is stalling when it is happening without stopping the process or requiring modifications to the source directly.

Usage

  1. Download the bundler_trap.rb script and put is somewhere easily accessible (I use the home directory in my examples).
  2. Run bundler using the following command: ruby -I~ -rbundler_trap bin/bundle update
  3. You will have to repeat step to until you get to a situation where bundler has stalled. When it does, send the INFO signal to the process (CMD+t on OSX, and on Linux, it should be kill -sINFO pid, but you might have to use a different signal).
@NickLaMuro
NickLaMuro / hawkular-metrics-admin-cluster-role.json
Last active April 27, 2017 08:15
Minishift addon for management with ManageIQ
{
"apiVersion": "v1",
"kind": "ClusterRole",
"metadata": {
"name": "hawkular-metrics-admin"
},
"rules": [
{
"apiGroups": [""],
"resources": ["hawkular-metrics","hawkular-alerts"],
@NickLaMuro
NickLaMuro / perf_capture_realtime_test
Last active August 8, 2017 02:00
ManageIQ perf_capture_realtime profiling script
#!/usr/bin/env ruby
require "optparse"
options = { :loops => 5 }
OptionParser.new do |opts|
opts.banner = "usage: #{File.basename $PROGRAM_NAME, '.rb'} [options]"
opts.on("-D", "--[no-]debug", "Toggle debug mode (includes verbose)") do |val|
@NickLaMuro
NickLaMuro / test_acronym_fixes.rb
Last active October 3, 2017 21:56
Performance benchmarks on `ActiveSupport`'s `String#camelize` and `String#underscore`
#!/usr/bin/env ruby
#
# This script has been adapted from a similar script by Dave Gynn (@dgynn):
#
# - https://gist.github.com/dgynn/bd54e970f8942ce2ca532e4adc3fd30a
#
# This can be run against a local version of ActiveSupport or the latest
# release for comparison (ideally, you would put this in your `rails/`
# dir locally and run against local changes from there)
#
@NickLaMuro
NickLaMuro / azure_private_images_benchmark.rb
Created October 5, 2017 21:52
Benchmarks getting azure private images
#
# This script has been adapted from a similar script by Dave Gynn (@dgynn):
#
# - https://gist.github.com/dgynn/bd54e970f8942ce2ca532e4adc3fd30a
#
# And the functionality has been heavily modified and made configurable from a
# script by Daniel Berger (@djberg96)
#
# - https://gist.github.com/djberg96/809562e6e7868966a22032935ee6e5e8
#