Skip to content

Instantly share code, notes, and snippets.

View RobinDaugherty's full-sized avatar

Robin Daugherty RobinDaugherty

View GitHub Profile
@RobinDaugherty
RobinDaugherty / apply_this.sh
Last active December 7, 2018 12:45
Fix Pow's nack so that better_errors works on ruby 2.1+
curl -L https://gist.githubusercontent.com/RobinDaugherty/2731f20d303e6506d451384df2189210/raw/b52e6231170b3dce39633db29634dc892751910f/pow_better_errors_fix.patch |
patch ~/Library/Application\ Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb
@RobinDaugherty
RobinDaugherty / database_cleaner.rb
Last active June 10, 2021 18:56
Rspec with DatabaseCleaner
# spec/support/database_cleaner.rb
RSpec.configure do |config|
# We don't use Rails' transactional tests because we use DatabaseCleaner instead.
# http://weilu.github.io/blog/2012/11/10/conditionally-switching-off-transactional-fixtures/
config.use_transactional_tests = false
TABLES_NOT_TO_TRUNCATE = %w[
schema_migrations
ar_internal_metadata
@RobinDaugherty
RobinDaugherty / commands.sh
Created January 20, 2017 15:22
fix flynn old release
$ flynn -c cluster1 -a bandit-api-production ps
ID TYPE STATE CREATED RELEASE
dennis.omnib.net-1958ccf8-5c7b-4568-945d-9e8c44b83044 acquisuitedriver up 2 days ago 399ef683-763f-46e0-a9d7-74791f85d7ee
charlie.omnib.net-087847fb-b151-47d5-9992-d4c47ede9d59 ruleprocessor up 2 days ago 399ef683-763f-46e0-a9d7-74791f85d7ee
charlie.omnib.net-49dd084e-fff3-4bdc-a9b6-2662ea4916fc maverickinstaller up 2 days ago 399ef683-763f-46e0-a9d7-74791f85d7ee
charlie.omnib.net-1c63e93f-be77-4b35-95cc-06060b39ebfe web up 2 days ago 399ef683-763f-46e0-a9d7-74791f85d7ee
dennis.omnib.net-ac72f239-812f-479c-8c36-99410495d771 web up 2 days ago 399ef683-763f-46e0-a9d7-74791f85d7ee
dennis.omnib.net-7704981b-173f-461e-8d38-ef3dae93879f web up 2 days ago 399ef683-763f-46e0-a9d7-74791f85d7ee
mac.omnib.net-0c4e57c7-4110-45ce-96ae-a0511e0cc2aa web
@RobinDaugherty
RobinDaugherty / bitium_export.js
Last active December 10, 2019 20:04
Bitium export to 1Password
// Paste this into the console on the Manage Apps page of Bitium.
//
// To make the process easier, it may be best to show as many items on the page as possible. By default, it shows 20,
// and it can be changed to 200.
//
// The items that are shown on the current page will be exported as a CSV, which will be downloaded as a file once
// all of the passwords have been fetched. (It fetches them slowly so that Bitium does not see it as suspicious activity.)
//
// If a password cannot be fetched, the row will be changed to a red background and it will have a "Fix admin visibility"
// button. This button will open the Credentials page in a new browser tab where you can use "Add Policy" to make
@RobinDaugherty
RobinDaugherty / 0_troubleshoot_inside_docker_image.sh
Created November 18, 2016 15:49
Cloud66 docker helpful commands
docker commit 41cd9fbd7839 debug_41cd9fbd7839
docker run -it --entrypoint=bash debug_41cd9fbd7839
apt-get update
apt-get install vim
vim dockerServer.js
node dockerServer.js
@RobinDaugherty
RobinDaugherty / extract_dyn_zone.js
Last active December 7, 2017 14:50
Export zone from Dyn Standard DNS
// Since Dyn provides no way to export a zone, this extracts the zone data from the "advanced editor" form.
// Run this in the console on the editor page, and it will produce a single string.
// You may need to clean up the string slightly. Look for hostnames that end with multiple dots and clean those out.
dyn_zone_getter = {
host: jQuery("#adv_table tr > td:nth-child(1)").map(function(){return $(this).text()}),
ttl: jQuery("#adv_table tr > td:nth-child(2) > input").map(function(){return $(this).val()}),
type: jQuery("#adv_table tr > td:nth-child(3)").map(function(){return $(this).text()}),
data: jQuery("#adv_table tr > td:nth-child(4) > input").map(function(){return $(this).val()}),
as_zone: function() {
@RobinDaugherty
RobinDaugherty / pressure_monitor.py
Created July 26, 2016 20:01
Pressure monitor on Raspberry Pi 3 with MCP3008 ADC and Nokia 5110 display
import time
import datetime
import array
import Adafruit_GPIO.SPI as SPI
import RPi.GPIO as GPIO
import Adafruit_Nokia_LCD as LCD
import Adafruit_MCP3008
from m2x.client import M2XClient
@RobinDaugherty
RobinDaugherty / newrelic.yml
Last active July 14, 2016 13:25
Generic New Relic config
#
# This file configures the New Relic Agent. New Relic monitors Ruby, Java,
# .NET, PHP, Python and Node applications with deep visibility and low
# overhead. For more information, visit www.newrelic.com.
#
# For full documentation of agent configuration options, please refer to
# https://docs.newrelic.com/docs/agents/ruby-agent/installation-configuration/ruby-agent-configuration
common: &default_settings
# To disable the agent regardless of other settings, uncomment the following:

Keybase proof

I hereby claim:

  • I am RobinDaugherty on github.
  • I am robindaugherty (https://keybase.io/robindaugherty) on keybase.
  • I have a public key whose fingerprint is 410A 8C19 A5E6 5817 FBDA 7F6F A002 E0D6 096A C62C

To claim this, I am signing this object:

@RobinDaugherty
RobinDaugherty / pre-commit
Last active April 14, 2016 16:15 — forked from mileszs/pre-commit
Git pre-commit hook for prompting to remove binding.pry and debugger lines lines. (Includes a commented example of adding a check for focus in spec files.)
#!/usr/bin/env ruby
hits = []
checks = {
'_spec\.rb$' => ['focus:[:space:]*true', ',[:space:]*:focus'],
'\.(rb|haml|slim|erb)$' => ['binding\.pry', 'debugger', 'byebug'],
'\.(js|coffee)$' => ['debugger'],
}
# Find the names of all the filenames that have been (A)dded (C)opied or (M)odified