Skip to content

Instantly share code, notes, and snippets.

View sorah's full-sized avatar

Sorah Fukumori sorah

View GitHub Profile
@sorah
sorah / a.sh
Created October 17, 2012 11:49
#!/bin/bash
cat <<EOF
net-setup has been done?
"yes" to continue
EOF
read confirmation
[ "$confirmation" == "yes" ] || exit
@qnighy
qnighy / what-is-agitsune.md
Last active October 12, 2015 23:28
What is Agitsune?

Author: qnighy

What is Agitsune?

"University of Agitsune" is a team which will participate in ICPC 2013 World Final. The members are hos_lyric, rng_58, and wrong(japlj).

This is what I heard about What is Agitsune.

Animals

@nurse
nurse / gist:4324519
Last active February 28, 2018 11:53
ぼくの考えた最強のRuby新機能案

ぼくの考えた最強のRuby新機能案

野心的な新機能案や、互換性等の理由でおよそ採用されないであろう夢を書き連ねています。

Remove Fixnum and Bignum

Fixnum と Bignum を削除して、Integer クラスに統合する。両者は Flonum のように内部的に切り替えられる。

1 / 2 is Rational

Integer#/ の結果を Rational で返すようにする。 https://bugs.ruby-lang.org/issues/5512#change-37021

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

2013 年の新卒研修メニュー

Rails Tutorial

目的

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

教材と教える項目

#!/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`
#!/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'
@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

@kntyskw
kntyskw / ec2_multicast.sh
Last active June 8, 2021 14:18
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 :`
@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']