This file contains hidden or 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
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does | |
import hudson.model.*; | |
import hudson.util.*; | |
import jenkins.model.*; | |
import hudson.FilePath.FileCallable; | |
import hudson.slaves.OfflineCause; | |
import hudson.node_monitors.*; | |
for (node in Jenkins.instance.nodes) { |
This file contains hidden or 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
require 'open-uri' | |
require 'ipaddr' | |
def generate_lookup_table | |
delegation_lists = [ | |
'ftp://ftp.afrinic.net/pub/stats/afrinic/delegated-afrinic-latest', | |
'ftp://ftp.apnic.net/pub/stats/apnic/delegated-apnic-latest', | |
'ftp://ftp.arin.net/pub/stats/arin/delegated-arin-latest', | |
'ftp://ftp.lacnic.net/pub/stats/lacnic/delegated-lacnic-latest', | |
'ftp://ftp.ripe.net/pub/stats/ripencc/delegated-ripencc-latest' |
This file contains hidden or 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
require "rubygems" | |
require 'rethinkdb' | |
require 'oj' | |
require 'multi_json' | |
include RethinkDB::Shortcuts | |
r.connect({:db => 'testing'}).repl | |
r.db_drop('test_db').run rescue nil | |
r.db_create('test_db').run | |
r.db('test_db').table_create('data', {:durability => 'soft'}).run |
This file contains hidden or 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
*** longjmp causes uninitialized stack frame ***: ruby terminated | |
======= Backtrace: ========= | |
/lib/libc.so.6(__fortify_fail+0x37)[0x7fee7967e217] | |
/lib/libc.so.6(+0xff1a9)[0x7fee7967e1a9] | |
/lib/libc.so.6(__longjmp_chk+0x33)[0x7fee7967e113] | |
/usr/lib/libcurl.so.4(+0x91e5)[0x7fee75ae21e5] | |
/lib/libpthread.so.0(+0xf8f0)[0x7fee79dab8f0] | |
/lib/libpthread.so.0(pthread_cond_wait+0xcc)[0x7fee79da785c] | |
ruby(_ZN8rubinius7Channel15receive_timeoutEPNS_5StateERNS_11GCTokenImplEPNS_6ObjectEPNS_9CallFrameE+0x3f4)[0x6791e4] | |
ruby(_ZN8rubinius10Primitives15channel_receiveEPNS_5StateEPNS_9CallFrameEPNS_10ExecutableEPNS_6ModuleERNS_9ArgumentsE+0x100)[0x62c4f0] |
This file contains hidden or 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
*** longjmp causes uninitialized stack frame ***: ruby terminated | |
======= Backtrace: ========= | |
/lib/libc.so.6(__fortify_fail+0x37)[0x7f1bc849d217] | |
/lib/libc.so.6(+0xff1a9)[0x7f1bc849d1a9] | |
/lib/libc.so.6(__longjmp_chk+0x33)[0x7f1bc849d113] | |
/usr/lib/libcurl.so.4(+0x91e5)[0x7f1bc5f001e5] | |
/lib/libpthread.so.0(+0xf8f0)[0x7f1bc8ff88f0] | |
/lib/libpthread.so.0(pthread_cond_wait+0xcc)[0x7f1bc8ff485c] | |
/usr/local/rvm/rubies/ruby-1.9.3-p0/lib/libruby.so.1.9(+0x180d69)[0x7f1bc9386d69] | |
/usr/local/rvm/rubies/ruby-1.9.3-p0/lib/libruby.so.1.9(+0x18549b)[0x7f1bc938b49b] |
This file contains hidden or 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
import numpy | |
#your regular array | |
myarray = [123, 221, 3, 16, 199, 0] | |
#convert that to 32 bit integers | |
tmp=numpy.array(myarray, numpy.int32) |
This file contains hidden or 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
class Array | |
def sum | |
inject( nil ) { |sum,x| sum ? sum+x : x } | |
end | |
def mean | |
sum.to_f / size.to_f | |
end | |
end |
This file contains hidden or 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
class Foo | |
def self.doit | |
puts "nike" | |
end | |
def bar | |
Foo.doit() | |
end | |
def bar2 |
This file contains hidden or 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
require "rubygems" | |
rack_app = Proc.new do |env| | |
[200, {"Content-Type"=>"text/html"}, env["REMOTE_ADDR"]] | |
end | |
run rack_app |
This file contains hidden or 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
$ sudo greenpois0n.app/Contents/MacOS/greenpois0n | |
2011-02-13 12:22:09.632 greenpois0n[302:e07] Could not connect the action buttonPressed: to target of class NSApplication | |
2011-02-13 12:22:09.635 greenpois0n[302:e07] Could not connect the action buttonPressed: to target of class NSApplication | |
2011-02-13 12:22:09.636 greenpois0n[302:e07] Could not connect the action buttonPressed: to target of class NSApplication | |
2011-02-13 12:22:09.637 greenpois0n[302:e07] Could not connect the action buttonPressed: to target of class NSApplication | |
Initializing libpois0n | |
No matching processes were found | |
Device must be in DFU mode to continue | |
Device must be in DFU mode to continue | |
opening device 05ac:1227... |