root@ubuntu:~# cat syncip.rb #!/usr/bin/env ruby #encoding:utf-8 #code by johnlen shaw req…
require 'rubygems' require 'net/ssh' def copy_file(session, source_path, destination_path=…
#!/usr/bin/ruby -w =begin /***************************************************************…
示例1: require 'sqlite' db = SQLite::Database.new("library.db") db.execute("…
require 'mysql' m = Mysql.new("localhost","name","password&quo…
require 'postgres' conn = PGconn.connect("",5432, "", "", &q…
require 'mysql' m = Mysql.new("localhost","ruby","secret",&q…
def generate_passwd(length=16) chars = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ23…
require 'tk' root = TkRoot.new button = TkButton.new(root) { text "Hello, World!" command …
result = "0"*8 # Eight bytes (enough for two longs) getCursorXY = Win32API.new("user32","G…
#coding utf-8 #!/usr/bin/env ruby -w require "open-uri" require "nokogiri" require "thread…
require 'spreadsheet' # to create a spreadsheet file @selectedevent=Event.find_by_id(param…