Skip to content

Instantly share code, notes, and snippets.

Deface::Override.new(
:virtual_path => "spree/layouts/spree_application",
:name => "banner",
:replace => ".container",
:text => <<-end
<%= render :partial => 'spree/shared/header' %>
<div class="container" id="main_content">
<% if store_menu? %>
<div id="cart_wrapper">
Deface::Override.new(
:virtual_path => "spree/layouts/spree_application",
:name => "banner",
:replace => ".container",
:text => <<-end
<%= render :partial => 'spree/shared/header' %>
<div class="container" id="main_content">
<% if store_menu && current_order? %>
<div id="cart_wrapper">
from pysnmp.entity.rfc3413.oneliner import cmdgen
def MACPORT(ipaddress):
cmdGen = cmdgen.CommandGenerator()
community = 'public'
errorIndication, errorStatus, errorIndex, MacTable = cmdGen.nextCmd(
cmdgen.CommunityData(community),
cmdgen.UdpTransportTarget((ipaddress, 161)),
'1.3.6.1.2.1.17.4.3.1.1',
)
<div id="sushi-review">
<style type="text/css">
#sushi-review{
font-size: 20px;
min-width: 700px;
/*height: 80px;*/
background-color: #f7931a;
font-family: 'Roboto Condensed', helvetica, sans-serif;
}
src/gz barrier_breaker http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages
dest root /
dest ram /tmp
lists_dir ext /var/opkg-lists
option overlay_root /overlay
cap production deploy --trace
** Invoke production (first_time)
** Execute production
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke deploy (first_time)
** Execute deploy
** Invoke deploy:starting (first_time)
** Execute deploy:starting
** Invoke deploy:check (first_time)
Net::SSH.start(ipaddress, "root", :password => "root") do |ssh|
puts "reloading network interface"
begin
Timeout::timeout(network_reload_timeout) do
ssh.exec!("/etc/init.d/network reload")
end
rescue Timeout::Error
puts "connection closed from network change"
ssh.shutdown!()
end
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config interface 'lan'
option ifname 'eth0'
option type 'bridge'
require 'net/scp'
require 'net/ssh'
require 'timeout'
require 'net/ping'
ipaddress = ARGV[0]
current_ip = ipaddress
fw_latest = "Linux antMiner 3.10.12 #2 Fri Feb 7 18:50:12 CST 2014 mips GNU/Linux"
known_outdated_fw = ["Linux antMiner 3.10.12 #10 Thu Dec 26 09:03:53 CST 2013 mips GNU/Linux" => "antMiner_openwrt20131226.bin"]
error:
firmware.rb:20:in `block in <main>': undefined method `known_outdated_fw' for main:Object (NoMethodError)
from /Users/jameshilliard/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.8.0/lib/net/ssh.rb:208:in `start'
from firmware.rb:14:in `<main>