Skip to content

Instantly share code, notes, and snippets.

View gist:76a5ca396d361dfc9075
require 'net/http'
require 'uri'
uri = URI.parse(ARGV[0])
http = Net::HTTP.new(uri.host, uri.port)
http.set_debug_output $stderr
http.start{|http|
req = Net::HTTP::Get.new(uri.path + (uri.query.empty? ? "" : "?" + uri.query))
res = http.request(req)
puts res.body
View gist:45811ed2e9126a4477e2
require 'aws-sdk'
ACCESS_KEY_ID ="your_access_key"
SECRET_ACCESS_KEY="your_secret_access_key"
AWS.config(
:access_key_id => ACCESS_KEY_ID,
:secret_access_key => SECRET_ACCESS_KEY
)
View twplay.rb
require 'twitter'
CONSUMER_KEY = 'CONSUMER_KEY'
CONSUMER_SECRET = 'CONSUMER_SECRET'
OAUTH_TOKEN = 'OAUTH_TOKEN'
OAUTH_TOKEN_SECRET = 'OAUTH_TOKEN_SECRET'
API_KEY = 'VOICETEXT_WEB_API_KEY'
begin
twcli = Twitter::REST::Client.new do |config|
View wcresult.rb
#!/usr/bin/ruby
require 'rubygems'
require 'uri'
require 'net/http'
require 'json'
require 'date'
require 'twitter'
begin
View cfn-chef.template
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Parameters" : {
"KeyName" : {
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instance",
"Type" : "String"
},
"RecipeURL" : {
"Description" : "The location of the recipe tarball",
View mkgruff.rb
#!/usr/bin/ruby -Ku
require 'rubygems'
require 'gruff'
require 'csv'
day = Hash.new
weight = Array.new
fat = Array.new
i=0
View twJVN.rb
#! /usr/bin/ruby
require "rubygems"
require 'oauth'
require 'rubytter'
require 'rss/1.0'
require 'open-uri'
# 設定ファイルをロードする
View twRecent.rb
#! /usr/bin/ruby
require "rubygems"
require 'oauth'
require 'rubytter'
require 'rss/2.0'
require 'open-uri'
# 設定ファイルをロードする
View twJoyfit.rb
#! /usr/bin/ruby -Ku
require 'rubygems'
require 'oauth'
require 'rubytter'
require 'open-uri'
require 'nokogiri'
#require 'rexml/document'
View pcap.rb
#!/usr/bin/ruby
require 'pcap'
def cap_data(dev,filstr,count)
# [device],[snaplen],[promisc?],[read timeout(ms)]
pcaplet = Pcap::Capture.open_live(dev,1460,true,1000)
access = Pcap::Filter.new(filstr,pcaplet)
pcaplet.setfilter(access)