This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'uri' | |
require 'rubygems' | |
require 'atom' | |
# Light lava lamps based on Jenkins build status RSS feed | |
# Green lamp lights if all builds are good; | |
# Red lamp lights if any build fails. | |
# | |
# Requires atom gem and bottlerocket X10 control software to be installed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
╰─ [0]% puppetsudo irb | |
Password: | |
irb(main):001:0> require 'mcollective'; include MCollective::RPC => Objectirb(main):002:0> require 'puppet' => true | |
irb(main):003:0> Puppet::Resource.new('user', 'harry', :parameters => {:ensure => :present}).save=> User[harry]{:membership=>:minimum, :ensure=>:present, :loglevel=>:notice, :key_membership=>:minimum, :auth_membership=>:minimum, :provider=>:directoryservice, :name=>"harry", :role_membership=>:minimum, :profile_membership=>:minimum} | |
irb(main):004:0> client0 = rpcclient('puppetral'); client0.identity_filter(/lan-0/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==> /var/log/pe-httpd/error.log <== | |
24 / 24 | |
memcached retrieving ["ab39482cf4abc59ced1fc65bba0cc5ad"] [a1880232341f3425d8c34e7d0a81930d] => [nil] [3] | |
memcached saving ["ab39482cf4abc59ced1fc65bba0cc5ad"] [a1880232341f3425d8c34e7d0a81930d] -> [["ip-10-112-67-14", "ip-10-114-85-11", "ip-10-118-49-17", "ip-10-1 | |
94-138-254", "ip-10-204-55-216", "ip-10-205-14-132", "ip-10-205-2-130", "ip-10-244-145-203", "ip-10-244-15-192", "ip-10-245-207-28", "ip-10-245-218-150", "ip-1 | |
0-245-91-164", "ip-10-36-30-238] [277] | |
74.85.255.4 - - [25/Oct/2011 18:12:32] "GET /lm/nodes " 200 440 6.2160 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Running passenger with RI's oversubscription patches doing an "Inspect All" with 2 second discovery timeout | |
==> /var/log/pe-activemq/activemq.log <== | |
2011-11-09 02:30:20,337 | WARN | Ack for non existent subscription, ack:MessageAck {commandId = 0, responseRequired = false, ackType = 2, consumerId = ID:ip-10-212-86-245-42499-1320800856049-3:6743:-1:1, firstMessageId = null, lastMessageId = ID:ip-10-212-86-245-42499-1320800856049-3:6674:-1:1:76, destination = topic://mcollective.puppetral.reply, transactionId = null, messageCount = 1, poisonCause = null} | org.apache.activemq.broker.region.AbstractRegion | ActiveMQ Connection Dispatcher: /10.212.86.245:438872011-11-09 02:30:20,380 | WARN | Async error occurred: java.lang.IllegalArgumentException: The subscription does not exist: ID:ip-10-212-86-245-42499-1320800856049-3:6743:-1:1 | org.apache.activemq.broker.TransportConnection.Service | ActiveMQ Connection Dispatcher: /1 | |
0.212.86.245:43887 | |
java.lang.IllegalArgumentException: The subscription does not exist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# tests to see what happens to facts, types and manifests in modules if the the module | |
# exists multiple times in the module path | |
# example modulepath = 'modpath1:modpath2' | |
# whatever definition of root_home lives in the later part of the module path wins | |
# modpath1 defintion = myhome | |
# modpath2 defintion = yourhome | |
# result = yourhome | |
notify { $root_home : } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/mmrobins/puppet/tree/2.6.x.speed_investigate | |
╭─[~/work/puppet]─[matthewrobinson@mattmac]─[20120202 - 14:07]-‹2.6.x.speed_investigate› | |
╰─ [1]% puppet apply ~/work/puppet/test.pp --debug | egrep "Start|Finished" | |
debug : Start (14:09:37) main | |
debug : | Start (14:09:37) Set our code or file to use. | |
debug : | Finished (Time elapsed 0.000242) Set our code or file to use. | |
debug : | Start (14:09:37) Collect our facts | |
debug : | Finished (Time elapsed 0.992216) Collect our facts | |
debug : | Start (14:09:38) Find our Node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% cookie=mycookieicopied | |
% token=mytokenicopied | |
% vim ingress_payload # paste in your payload data you copied and save | |
% curl -v -X POST -H "Cookie:$cookie" -H "X-CSRFToken:$token" --data @ingress_payload http://www.ingress.com/rpc/dashboard.getThinnedEntitiesV2 | |
* About to connect() to www.ingress.com port 80 (#0) | |
* Trying 72.14.249.180... connected | |
* Connected to www.ingress.com (72.14.249.180) port 80 (#0) | |
> POST /rpc/dashboard.getThinnedEntitiesV2 HTTP/1.1 | |
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5 | |
> Host: www.ingress.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% cookie=mycookieicopied | |
% token=mytokenicopied | |
% vim ingress_payload # paste in your payload data you copied and save | |
% curl -v -X POST -H "Cookie:$cookie" -H "X-CSRFToken:$token" --data @ingress_payload http://www.ingress.com/rpc/dashboard.getThinnedEntitiesV2 | |
* About to connect() to www.ingress.com port 80 (#0) | |
* Trying 72.14.249.180... connected | |
* Connected to www.ingress.com (72.14.249.180) port 80 (#0) | |
> POST /rpc/dashboard.getThinnedEntitiesV2 HTTP/1.1 | |
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5 | |
> Host: www.ingress.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def LRU(n, &b) | |
h={} | |
->(*k) do | |
h[k] = h.delete(k) do | |
puts "cache miss" | |
if h.length >= n | |
puts "clearing cache past #{n}" | |
h.shift | |
end | |
b[*k] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mod 10 | |
# cards: 0-9 | |
# each one card face up | |
# goal high score | |
# mod 10 | |
# dealer required to take card if < otherwise stands | |
# known card order | |
# | |
# moves = [] | |
# [ |
OlderNewer