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
diff --git a/lib/tdcache.rb b/lib/tdcache.rb | |
index a2a295e..767e007 100644 | |
--- a/lib/tdcache.rb | |
+++ b/lib/tdcache.rb | |
@@ -37,6 +37,15 @@ module TDcache | |
run_or_not(file){|file,cachefile| TDcache.file(file,cachefile) } | |
end | |
+ def self.give_url(url) | |
+ run_or_not(url){|url,cachefile| TDcache.url(url,cachefile) } |
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 self.ptitv(p,t,i,ts,v) | |
YS.out({'p' => p, 't' => t, 'i' => i, 'ts' => ts, 'v' => v}) | |
end |
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
<%= log %> { | |
<% options.each do |opt| -%> <%= opt %> | |
<% end -%> | |
<% if postrotate != "NONE" -%> postrotate | |
<%= postrotate %> | |
endscript | |
<% end -%> | |
} |
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
`Here is some code yabba!` | |
*italics!* | |
# Header, bud! # | |
[usg web site](http://www.usg.edu/) | |
## Header2 ## | |
yab |
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
# vim: set sw=4 sts=4 et tw=0 : | |
# Local monkeypatching to string. | |
class String | |
# get/kill first word | |
def firstword | |
self.sub(/^\s*([\S]+).*/,'\1').strip | |
end | |
def rmfirstword |
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
if STDOUT.isatty | |
if ENV['PAGER'] == nil | |
ENV['PAGER'] = 'less' | |
end | |
exec( $0 + %Q{ %s 2>&1| #{ENV['PAGER']}} % ARGV.join(' ')) | |
end |
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
start_logging(){ | |
# Michael is so smart | |
PIPE=/tmp/CornCobPipe.$$ | |
mknod $PIPE p # Create named pipe to talk to logchild | |
trap 'rm -rf $PIPE' exit # Remove pipe on exit | |
:>>$LOG # Create the log if it doesn't exist | |
tee -a $LOG <$PIPE & # And our child is born | |
exec >>$PIPE 2>&1 # All output goes to std{err,out} & log | |
# Michael is no longer smart | |
} |
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
# Return all objects which match one of the types. types can be a | |
# string or an array | |
# | |
# For example: | |
# find_all(vim,'VirtualMachine') | |
def find_all(vim,types,startobj=vim.rootFolder) | |
# Allow types to be a string or an array. | |
types = [types].flatten | |
return vim.serviceContent.viewManager.CreateContainerView({:container => startobj, :type => types, :recursive => true}).view | |
end |
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
equire "win32/service" | |
include Win32 | |
begin | |
Service.new( | |
:service_name => 'yaketystats', | |
:host => 'localhost', | |
:service_type => Service::WIN32_OWN_PROCESS, | |
:description => 'YaketyStats client for Windows', | |
:start_type => Service::AUTO_START, |
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/ruby | |
require 'json' | |
host = 'graphite.example.com' | |
port = 2003 | |
now = Time.now.to_i | |
stats = '' | |
# <metric path> <metric value> <metric timestamp> |
OlderNewer