Skip to content

Instantly share code, notes, and snippets.

View comuttun's full-sized avatar

KOMATSU Seiji comuttun

  • Magmag, Inc.
  • Yokohama, Japan
View GitHub Profile
@yoshikaw
yoshikaw / gist:862031
Created March 9, 2011 11:07
CygwinのscreenでコピーバッファをWindowsクリップボードに流し込むっ!
# changes the filename used for reading and writing with the paste buffer.
bufferfile 'screen/screen-exchange'
# copy the screen pastbuffer to the Cygwin pastebord
bindkey -m ' ' eval 'stuff \040' 'writebuf' 'exec sh -c "/usr/bin/putclip < screen/screen-exchange"'
bindkey -m Y eval 'stuff Y' 'writebuf' 'exec sh -c "/usr/bin/putclip < screen/screen-exchange"'
bindkey -m W eval 'stuff W' 'writebuf' 'exec sh -c "/usr/bin/putclip < screen/screen-exchange"'
@bfg
bfg / apache-2.2-mod_remoteip.c
Created June 23, 2011 09:32
Working backport (doesn't crash when using Allow/Deny ACLs) of Apache 2.3 module mod_remoteip to Apache 2.2.x
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@giuniu
giuniu / Tuples.java
Created March 7, 2012 06:24
tupleっぽいものをJavaで実装する
import java.lang.reflect.Field;
import java.util.Date;
public final class Tuples {
public static void main(String[] args) {
Tuple3<Integer, String, Date> tpl = Tuples.get(1, "a", new Date());
System.out.println(tpl._1);
System.out.println(tpl);
}
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@ritou
ritou / gist:5053810
Last active December 14, 2015 07:49

DM踏んだだけでアレな件はTwitterのOAuth実装がク○だと思う

これの話です。 http://togetter.com/li/463503

(追記 : この考察ではiframeでTwitterの認可URL指定してもX-Frame-Options設定されてるやんけ問題が未解決と思ったらなにやら更新されてたのでもう様子見)

前提条件

あくまでこれ前提で考えてます。間違ってたらごめんなさいね。

@mala
mala / gist:5062931
Last active March 18, 2020 15:31
TwitterのOAuthの問題まとめ

どういう問題があったか

説明するのめんどい http://vividcode.hatenablog.com/entry/twitter-oauth-vulnerability

どういう対策がされたか

とりあえず即座に攻撃できるような状態ではなくなっています。

フィッシング?

#!/usr/bin/ruby
require 'rubygems'
require 'packetfu'
dev = ARGV[0]
mac=`ip link show #{dev} | awk '/ether/ {print $2}'`
ARGV.shift
dests = ARGV
cap = PacketFu::Capture.new(
@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 :`

redcaretとgithub-markdownの違い

  • 両者のソースは割りと似ている(github-markdownがredcarpetを元にしたのか、あるいは両者のもとになったC実装があるとかかな)

オプションについて

github-markdownは、redcapetの提供するオプションの一部をデフォルトで有効化します。 (ちなみに有効化するオプションを選ぶAPIはない模様。用途を考えるとそれで正しいが)

★がついているのが有効化されるもの。gfmモード(.render_gfmメソッド)の場合のみ、★★も有効化される。

@tcnksm
tcnksm / docker_cheat.md
Last active August 5, 2021 03:59 — forked from wsargent/docker_cheat.md
Docker 虎の巻

Docker 虎の巻

何故Dockerを使うべきか

Why Should I Care (For Developers)

"Dockerが面白いのはシンプルな環境に隔離性と再現性をもたらしてくれることだ.ランタイムの環境を一度作れば、パッケージにして別のマシンでも再利用することできる.さらに,すべてはホスト内の隔離された環境で行われる(VMのように).最も素晴らしい点は,シンプルかつ高速であることだ."