Skip to content

Instantly share code, notes, and snippets.

@autch
autch / gist:868189
Created March 13, 2011 15:53
輪番停電PDFをMacのpreviewで選択→テキストエディタに貼り付け、そしてこのスクリプトに与える
#!/usr/bin/ruby1.8
# create table rt (
# id integer unsigned not null auto_increment primary key,
# pref char(32) not null,
# city char(32) not null,
# addr char(32) not null,
# rt_group integer not null,
#
# index(pref,city,addr,rt_group)
@autch
autch / do_vlc_live.sh
Created March 28, 2011 16:20
tcpで生TSをもらってVLCでトランスコード結果をHTTPストリーミング
#!/bin/sh
if [ "x$1" = "x" -o "x$2" = "x" ]; then
echo "Usage: $0 inport outport"
exit 1
fi
if [ "x$3" = "x" ]; then
BITRATE=128
else
@autch
autch / vlcserv.php
Created March 28, 2011 16:31
gist:890759 で受け取ったTSへのリバースプロキシ
<?php // bogus reverse-proxy for VLC http streaming output
ini_set("display_errors", 0);
ini_set("log_errors", 1);
if(isset($_REQUEST['port']))
$port = intval($_REQUEST['port']);
else
$port = 12234;
@autch
autch / check_fof.rb
Created June 29, 2011 04:39
Twitter で相互followしているユーザを表示。Grackleが必要。
#!/usr/bin/ruby
#
# gem install grackle
#
# ./check_fof.rb <your_twitter_screen_name>
#
$KCODE = 'u'
require 'rubygems'
@autch
autch / stooq.html
Last active January 15, 2016 03:17
谷岡Stooqテキスト版の代わりに jQuery + YQL + Stooq CSV で数値を表示。使い方はページ下部のコメント参照。 http://jsdo.it/autch/egw6
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
<title>谷岡 Stooq jQuery 版</title>
<script type="text/javascript">
// コンストラクタ
// @param symbols 取得すべき銘柄の文字列配列。取得結果はこの配列の順番で表示する。
@autch
autch / shukan.html
Created July 26, 2011 01:36
習慣^H^H週刊韓国経済をヲンで買う。レートはStooqからその場で取得。
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
<title>習慣^H^H週刊韓国経済をヲンで買う</title>
<style type="text/css">
input { text-align: right; }
</style>
<script type="text/javascript">
@autch
autch / vcgi.rb
Created August 23, 2011 04:41
ERB/CGI/PHP-capable WEBrick server
#!/usr/bin/ruby
ORG_ARGV = ARGV.dup
require 'optparse'
require 'socket'
BasicSocket.do_not_reverse_lookup = true
require 'webrick'
@autch
autch / .emacs
Last active September 27, 2015 01:47
自分の .emacs
(auto-compression-mode t)
(if (file-exists-p "/usr/bin/lgrep")
(setq grep-command "lgrep -n ")
)
(require 'font-lock)
(global-font-lock-mode t)
(global-set-key [delete] 'delete-char)
(global-set-key "\C-h" 'backward-delete-char)
@autch
autch / rtx1000.rb
Created October 14, 2011 02:11
RTX1000 のtelnetインタフェースからFW状況を取得してCSVで出力
#!/usr/bin/ruby1.9.1
# -*- coding: euc-jp -*-
require 'net/telnet'
RT_HOST = 'YOUR_RTX1000_ADDR'
RT_PW = 'YOUR_RTX1000_PASSWORD'
telnet = Net::Telnet.new("Host" => RT_HOST,
"Waittime" => 1,
@autch
autch / gist:1333518
Created November 2, 2011 12:39
赤人てんてーを自動通報
#!/usr/bin/ruby1.9.1
# -*- encoding: utf-8-unix; -*-
require 'rubygems'
require 'grackle'
# add :auth parameter to retweet/post
client = Grackle::Client.new()
tw = client.statuses.user_timeline.json?(:screen_name => 'akahito65535')