Skip to content

Instantly share code, notes, and snippets.

yanbe yanbe

Block or report user

Report or block yanbe

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
yanbe /
Created Oct 2, 2018 — forked from CLCL/
L2TP/IPsec(AndroidやiPhoneからのVPN接続)を経路を用意すべくVPSにL2TP/IPsecサーバを設置するとき、ネットにある情報だとなかなかつながらないから、標準環境としてAWSのCentOS 6.3 x86_64 Release Media(ami-3fe8603e)の起動直後から最短距離で設定する方法をまとめた。

CentOS 6でとにかくL2TP/IPsecサーバ

  • AWSでEC2のインスタンスを借りる
  • 今回は東京リージョンのCentOS 6.3 x86_64 Release MediaのAIM(ami-3fe8603e)でインスタンスを建てる
  • Security Group: L2TP/IPsec(Inbound 22/TCP: SSH, 500/UDP: ISAKMP, 1701/UDP: L2TP, 4500/UDP: IPSec NAT Traversal)を許可


[root@ip-10-132-164-105 ~]# setenforce 0
View gist:2977971
reduce(lambda a, b: a+b,map(lambda e: e*2, (1,2,3)))
yanbe /
Created May 12, 2011
while true
ping -t 6 -i 2 1>/dev/null 2>/dev/null
if [ $? -ne 0 ]
echo "Network Has Gone"
if [ `cat ~/.netcheck.last` = "OK" ]
yanbe / gist:961328
Created May 8, 2011
View gist:961328
1. Safariでブラウジング中調べたい単語が見つかったら,ブックマークレットを起動する
yanbe /
Created Dec 7, 2010
Check arbitrary PDF file on the web and mail diff from last version if it has changed.
export PATH=/opt/bin:$PATH
CUR_LENGTH=`curl --head $URL 2>/dev/null | awk '/Content-Length:/ {print $2}'`
cd /home/john/kushitu_checker
if [ $CUR_LENGTH != `cat last_length` ]; then
curl $URL > kushitu.pdf
pdftotext -enc UTF-8 -raw kushitu.pdf /dev/stdout | sed 's/^.*現在//g' > kushitu.txt
diff -U 0 kushitu.txt last_kushitu.txt | nail -A myaccount -s "Room Updates"
echo $CUR_LENGTH > last_length; rm kushitu.pdf; mv kushitu.txt last_kushitu.txt
yanbe / gist:718643
Created Nov 28, 2010
Easiest way to get text from malformed HTML
View gist:718643
$ wget -q -O /dev/stdout | w3m -dump -T text/html > formatted.txt
yanbe / gist:673924
Created Nov 12, 2010
Skype 5 for MacのDebug consoleで表示中のチャットの内容をTumblrのチャット形式(sender: body)に変換
View gist:673924
var s=jQuery.makeArray($('img + a')), b=jQuery.makeArray($('.body')), lines=new Array(); for(var i=0; i<s.length; i++) {lines.push([s[i].innerText,': ',b[i].innerText].join(''))} console.log(lines.join('\n'));
yanbe / installing-pptpd-on-qnap-nas.txt
Created Nov 9, 2010
QNAP製のNAS (Intel CPU) で PPTP Server を起動するまでの手順
View installing-pptpd-on-qnap-nas.txt
# デフォルトではppp関連のモジュールが存在しないのでQNAPが公開しているカーネル
# コンフィグファイルを取得し、自分でコンパイルする必要がある
$ cd /share/MD0_DATA/(適当な作業ディレクトリ)
$ wget
$ wget
$ tar xzvf QNAP_GPL_3.3.3-20100928.tar.gz
$ tar xzvf linux-
$ cp GPL_TS/kernel_cfg/TS-459/linux- linux-
$ cd linux-
$ sudo ipkg install gcc
yanbe / ac-python-complete.el
Created Sep 25, 2010
Source definition of Auto Complete Mode for Python module contents.
View ac-python-complete.el
(defun ac-python-candidates ()
(car (read-from-string
(format "emacs.complete(%S,%s)"
(ac-define-source python
'((candidates . ac-python-candidates)
yanbe / userstreams.go
Created Jul 20, 2010
Reads ChirpUserStreams continuously, format chunks, then put them into standard output.
View userstreams.go
userstreams.go: Reads ChirpUserStreams continuously, format tjem, then put them
into standard output. For detail, read: .
Author: Yusuke Yanbe (
package main
import (
You can’t perform that action at this time.