Skip to content

Instantly share code, notes, and snippets.

View sorah's full-sized avatar

Sorah Fukumori sorah

View GitHub Profile
@mattn
mattn / err.go
Last active August 29, 2015 13:59
package main
import (
"log"
"os"
"syscall"
)
func main() {
f, err := os.Open("not-found-file.txt")
@motemen
motemen / Ojisan-Patterns.md
Last active March 7, 2025 08:19
おじさんパターン集
  • その面白そうな話、私も参加していいよね?なぜなら私は無条件に受け入れられているからおじさん(闖入おじさん) #おじさんパターン
  • 後出し難癖おじさん #おじさんパターン
  • 困難は成長のチャンス!だから君たちに成長の機会をあげようおじさん (成長おじさん) #おじさんパターン
  • あらゆる事案に一般論コメントおじさん #おじさんパターン
  • 俺ってあらゆることに精通してるじゃん?だから力になるよおじさん (精通おじさん) #おじさんパターン
// ==UserScript==
// @name pixiv_secure_login
// @namespace http://sorah.jp/
// @description secure
// @include http://www.pixiv.net/*
// ==/UserScript==
var forms = document.querySelectorAll('form[action="/login.php"]')
for(var i = 0; i < forms.length; i++)
@eagletmt
eagletmt / sd-hd.rb
Last active December 18, 2015 16:19
SD -> HD または HD -> SD の切り替えがあるときに、HD または SD の先頭オフセットを見つける
#!/usr/bin/env ruby
# coding: utf-8
require 'open3'
require 'tempfile'
class Avconv
def initialize(path, bin = 'avconv')
@path = path
@bin = bin
@tempfile = Tempfile.new ['sd-hd', '.ts']
@kntyskw
kntyskw / ec2_multicast.sh
Last active June 13, 2024 22:44
Script to enable IP multicast without using Ethernet broadcast. It uses tc mirred and pedit actions to copy and edit an IP multicast packet to send over multiple Ethernet unicast frames. It requires two network interfaces to work. One is the interface to grab original multicast packets from and the other is to send out modified packets. This is …
#!/bin/sh
[[ -n "$1" && -n "$2" ]] || { echo "Usage: $0 <interface to grab multicast packets from> <interface to send modified packets to> [target MAC address 1] [target MAC address 2] ..."; exit 0 ; }
IIF=$1
OIF=$2
shift
shift
SRC_MACADDR=`ip link show $OIF | awk '/ether/ {print $2}' | tr -d :`
@sorah
sorah / 0.mkd
Last active December 17, 2015 06:59

録画の話

ハードウェア構成

  • HP ProLiant MicroServer http://h50146.www5.hp.com/products/servers/proliant/micro/

    • ちっこいやつ。18000 円くらいで手に入る。低消費電力だけど CPU が Atom 相当なのでそれなりに遅い。
  • CPU model name: AMD Turion(tm) II Neo N40L Dual-Core Processor

  • CPU MHz: 800.000

#!/usr/bin/env ruby
Dir.chdir(File.dirname(__FILE__))
require 'digest/sha2'
require 'uri'
require 'open-uri'
require 'json'
API_KEY = 'api_key'
TUMBLELOG = 'scrap.sorah.jp'
#!/bin/sh
IF=$1
# Gets MAC address of the interface
MY_MAC_ADDR=`ip link show $IF | awk '/ether/ {print $2}'`
# Get the ID of the subnet that the interface is connected to
MY_SUBNET_ID=`curl http://169.254.169.254/latest/meta-data/network/interfaces/macs/$MY_MAC_ADDR/subnet-id 2> /dev/null`

2013 年の新卒研修メニュー

Rails Tutorial

目的

  • 2013 年で Web アプリケーションを作る時にモダンな方法で一通り Web アプリケーションを自分一人で作れるようになってもらう
  • 作る過程で Web 開発で必要とされるスキルセットを身につけてもらう

教材と教える項目

$OutputEncoding = New-Object -typename System.Text.UTF8Encoding
[Console]::OutputEncoding = New-Object -typename System.Text.UTF8Encoding