Skip to content

Instantly share code, notes, and snippets.

booger:python_in_ruby evan$ irb
jruby-1.7.19 :001 > require 'ffi'
=> false
jruby-1.7.19 :002 > module Python
jruby-1.7.19 :003?> extend FFI::Library
jruby-1.7.19 :004?> ffi_lib 'python'
jruby-1.7.19 :005?> attach_function 'Py_Initialize', [], :void
jruby-1.7.19 :006?> attach_function 'PyRun_SimpleString', [:string], :int
jruby-1.7.19 :007?> end
=> #<#<Class:0x56aac163> address=0x122202b70 size=0>
Illustrating that mapped executable segments cannot be modified -- by anyone at any privilege level.
[eam@nitre ~]$ cp $(which sleep) /tmp/my_sleep
[eam@nitre ~]$ /tmp/my_sleep 60
[root@nitre ~]# echo test >> /tmp/my_sleep
-bash: /tmp/my_sleep: Text file busy
$ mssh -t 10 -c -r "foo1..10.site.com, @databases - @secure_hosts" 'md5sum /etc/passwd'
foo{1..4,7..10}.site.com,db001..007.site.com: '928c3a57983e701b53a52c9e45da38e5 /etc/passwd'
foo5..6.site.com: '4b49612f85a5a64eed93a53c35eec1c9 /etc/passwd'
>+[>,]<[<]>>[<[-]+++++++++++++++++++++++++++++++++++++++++++>[<.>-]++++++++++++
++++++++++++++++++++++++++++++++++.++++++++++++++++++++++++++++++++++++++++++++
+.----------------------------------------------.++++++++++++++++++++++++++++++
++++++++++++++++++.[-]>]
#!/usr/bin/ruby
DATA.seek(0)
puts DATA.readlines
__END__
@eam
eam / pony.rb
Created January 25, 2016 23:54
#!/usr/bin/ruby -00 -a
puts DATA.readlines.sample
__END__
|V\_ __
) o`-(..)
>L (_\__/
/ \ \ ___
/ ( \//(n)
# invalid ruby
raise "omg"
if false
# valid perl
die "omg"
if 0;
#!/usr/bin/env ruby
$elements = {
:H => { :string => "22", :evolution => [:H], },
:He => { :string => "13112221133211322112211213322112", :evolution => [:Hf,:Pa,:H,:Ca,:Li], },
:Li => { :string => "312211322212221121123222112", :evolution => [:He], },
:Be => { :string => "111312211312113221133211322112211213322112", :evolution => [:Ge,:Ca,:Li], },
:B => { :string => "1321132122211322212221121123222112", :evolution => [:Be], },
:C => { :string => "3113112211322112211213322112", :evolution => [:B], },
:N => { :string => "111312212221121123222112", :evolution => [:C], },
#!/usr/bin/env ruby
num, iters = ARGV
def encode_string s
s.gsub(/(0+|1+|2+|3+|4+|5+|6+|7+|8+|9+)/) { |m| l = m.length; "#{m.length}#{m[0]}" }
end
puts "encoding #{num} with #{iters} iterations"
%{#{%}#{%}#{%}#{%}#{%}#{????? "huuuuu" :?:}}}}}}}}}}}}.reverse