Skip to content

Instantly share code, notes, and snippets.

View gotbadger's full-sized avatar
🦡
Set your status

Philip Hayton gotbadger

🦡
Set your status
View GitHub Profile
@gotbadger
gotbadger / ways_to_use_vcr.rb
Created November 3, 2017 10:21 — forked from myronmarston/ways_to_use_vcr.rb
Ways to use VCR for a request made by a let block
# 1) Use VCR.use_cassette in your let block. This will use
# the cassette just for requests made by creating bar, not
# for anything else in your test.
let(:foo) { VCR.use_cassette("foo") { create(:bar) } }
it "uses foo" do
foo
end
# 2) Wrap the it block that uses #foo in VCR.use_cassette.
@gotbadger
gotbadger / Makefile
Last active July 17, 2016 13:18 — forked from caius/Makefile
Save edge router config & scripts to current directory
.PHONY: save save_config save_commands save_scripts
save:
make -j save_config save_commands save_scripts
save_config:
ssh 192.168.1.1 "/opt/vyatta/bin/vyatta-op-cmd-wrapper show configuration" 2> /dev/null > config.txt
save_commands:
ssh 192.168.1.1 "/opt/vyatta/bin/vyatta-op-cmd-wrapper show configuration commands" 2> /dev/null > commands.txt