Skip to content

Instantly share code, notes, and snippets.

View harupong's full-sized avatar

Haruo Nakayama harupong

View GitHub Profile
@btoone
btoone / curl.md
Last active December 8, 2024 05:16
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@mm53bar
mm53bar / Gemfile
Created March 26, 2012 18:41
Automagically launch an EC2 image and then provision it using sunzi
source 'http://rubygems.org'
gem 'sunzi'
gem 'rake'
gem 'fog'
@nesquena
nesquena / linode_fog.rb
Created October 28, 2011 09:24
Linode and Fog Samples
## DNS
@dns = Fog::DNS.new(:provider => 'Linode', :linode_api_key => LINODE_KEY)
if @zone = @dns.zones.all.find { |z| z.domain == ZONE }
puts "Found zone #{@zone.inspect}"
else
@zone = @dns.zones.create(:domain => ZONE, :email => ZONE_EMAIL)
puts "Creating zone #{@zone.inspect}"
end
@saiten
saiten / radiru.txt
Created September 1, 2011 09:02
らじるらじるをrtmpdumpで録音する
# RTMPEのtype9 handshakeに対応している必要があるのでRTMPDump v2.4必須
# CentOS5 32bitのさくらVPS、OSX Lionで動作確認。(OSX LionではRTMPDumpを32bitでビルド)
# ラジオ第1
rtmpdump --rtmp "rtmpe://netradio-r1-flash.nhk.jp" \
--playpath 'NetRadio_R1_flash@63346' \
--app "live" \
-W http://www3.nhk.or.jp/netradio/files/swf/rtmpe.swf \
--live \
-o r1.m4a
@fguillen
fguillen / crontab
Created August 9, 2011 09:05
Cron & RVM & Bundle & Rails & Rake & log
00 01 * * * /bin/bash --login -c 'cd <your app> && RAILS_ENV=production /usr/bin/env bundle exec rake <your rake>' >> /var/log/<your app>.log 2>&1
@honda0510
honda0510 / TheEndOfTheMonth.ics
Created May 31, 2011 04:35
Google カレンダーに月末の予定を追加するiCalendarファイル
BEGIN:VCALENDAR
PRODID:-//Google Inc//Google Calendar 70.9054//EN
VERSION:2.0
METHOD:PUBLISH
BEGIN:VTIMEZONE
TZID:Asia/Tokyo
BEGIN:STANDARD
TZOFFSETFROM:+0900
TZOFFSETTO:+0900
TZNAME:JST
@koko-u
koko-u / mkstardicttab.rb
Created May 10, 2011 02:22
英辞郎のTXTファイルをStardictの扱えるTAB形式に変換
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
# 英辞郎が提供する txt ファイルを Stardict が読める .tab 形式に変換する
# iconv の Shift_jis -> Utf-8 変換はうまくないみたいなので、nkf を使いましょう。
# cat EIJI-129.TXT | nkf -w8Lu | ./mkstardicttab > eijirou.tab
# 最終的には stardict-tools の tabfile を使って
# /usr/lib/stardict-tools/tabfile eijirou.tab
# としてできたファイルを /usr/share/stardict/dic に置く
@saiten
saiten / rec_radiko.sh
Last active December 2, 2021 05:57
簡易radiko録音ツール。要swftools
#!/bin/sh
playerurl=http://radiko.jp/apps/js/flash/myplayer-release.swf
cookiefile=./cookie.txt
playerfile=./player.swf
keyfile=./authkey.png
if [ $# -eq 1 ]; then
channel=$1
output=./$1.flv