Skip to content

Instantly share code, notes, and snippets.

@mechamogera
mechamogera / index.html
Created Feb 25, 2016
CCVでWebカメラ画像認識サンプル
View index.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Webカメラの映像をface++に送信</title>
</head>
<body>
<h2>Video</h2>
<video id="camera" autoplay></video>
<h2>Canvas</h2>
<canvas id="canvas"></canvas>
@mechamogera
mechamogera / basic_awareness.py
Created Feb 5, 2016
PepperのBasicAwarenessをオン、オフするスクリプトサンプル
View basic_awareness.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import sys
from naoqi import ALProxy
def on(args, bap):
bap.startAwareness()
bap.setEngagementMode("Unengaged")
@mechamogera
mechamogera / all_event_get.rb
Created Aug 5, 2013
AWS EC2の全イベント取得サンプル
View all_event_get.rb
module AWSOperation
def self.get_ec2_events(config = {})
report = []
config[:proxy_uri] ||= ENV['HTTP_PROXY'] || ENV['http_proxy']
ec2 = AWS::EC2.new(config)
ec2.regions.each do |region|
reg = ec2.regions[region.name]
reg.instances.each do |instance|
status = reg.client.describe_instance_status({"instance_ids" => [ instance.id ]})
@mechamogera
mechamogera / Gemfile
Last active Dec 20, 2015
Jenkinsの休み中のジョブ結果確認ツール
View Gemfile
# A sample Gemfile
source "https://rubygems.org"
gem "holidays"
gem "trollop"
gem "rest-client"
@mechamogera
mechamogera / Gemfile
Last active Dec 20, 2015
AWSのAMI管理ツール
View Gemfile
# A sample Gemfile
source "http://rubygems.org"
gem "trollop"
gem "aws-sdk"
View get_s3_access_log.rb
require 'rubygems'
gem 'aws-sdk'
require 'aws'
require 'optparse'
require 'ostruct'
require 'time'
require 'yaml'
require 'csv'
options = OpenStruct.new
@mechamogera
mechamogera / Gemfile
Created Jun 7, 2013
Jenkinsで勤務時間外に失敗したジョブを調べるrubyスクリプト
View Gemfile
source "https://rubygems.org"
gem "holidays"
gem "trollop"
gem "rest-client"
@mechamogera
mechamogera / irc-socket-test.rb
Created Apr 15, 2013
irc-socket gemを用いたIRCメッセージ送信Rubyスクリプトサンプル
View irc-socket-test.rb
require 'irc-socket'
irc = IRCSocket.new('example.com')
irc.connect
if irc.connected?
irc.nick "hulk"
irc.user "hulk", 0, "*", "I am hulk hogan"
while line = irc.read
@mechamogera
mechamogera / Gemfile
Last active Dec 15, 2015
S3アクセスログ取得Rubyスクリプト
View Gemfile
source "https://rubygems.org"
gem "aws-sdk"