Skip to content

Instantly share code, notes, and snippets.

View int128's full-sized avatar

Hidetake Iwata int128

View GitHub Profile
@vmihailenco
vmihailenco / proxy.go
Created November 20, 2011 15:22
Simple TCP proxy in Golang
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"
@ymnk
ymnk / AES.java
Last active July 20, 2023 15:54
JSch examples
/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
/**
* This program will demonstrate how to use "aes128-cbc".
*
*/
import com.jcraft.jsch.*;
import java.awt.*;
import javax.swing.*;
public class AES{
@mariussoutier
mariussoutier / Mail.scala
Created August 23, 2012 12:13
Sending mails fluently in Scala
package object mail {
implicit def stringToSeq(single: String): Seq[String] = Seq(single)
implicit def liftToOption[T](t: T): Option[T] = Some(t)
sealed abstract class MailType
case object Plain extends MailType
case object Rich extends MailType
case object MultiPart extends MailType
@fernandoaleman
fernandoaleman / gist:5083680
Last active October 17, 2023 12:02
How to update VirtualBox Guest Additions with vagrant
# Start the old vagrant
$ vagrant init centos-6.3
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.
@CLCL
CLCL / CentOS6-L2TP-IPsec.md
Last active September 26, 2022 18:21
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)を許可
  • ec2-54-249-173-214.ap-northeast-1.compute.amazonaws.com(グローバルIPアドレス:54.249.173.214)にrootでログイン

SELinuxを無効にする

[root@ip-10-132-164-105 ~]# setenforce 0
@ysb33r
ysb33r / RelativePath.groovy
Last active November 4, 2022 14:18
The Groovy way to obtain a relative path given two paths.
def root= new File('/usr/share')
def full= new File('/usr/share/docs/rpm-4.4')
// Print the relative path of 'full' in relation to 'root'
// Notice that the full path is passed as a parameter to the root.
def relPath= new File( root.toURI().relativize( full.toURI() ).toString() )
@Kuniwak
Kuniwak / Promises_A_plus_JP.markdown
Last active December 19, 2015 05:19
JavaScript でスマートに非同期なコードを書くための Promise パターンの仕様(改良版)の邦訳です。

JavaScript でスマートに非同期なコードを書くための Promise パターンの仕様のうち、thenメソッドに関する仕様であるPromises/A+の邦訳です。 お約束の文言ですが、この翻訳は間違ってるかもしれません。ご指摘・ご質問は大歓迎です。

原文(英語)


Promise/A+

この提言はPromises/A 仕様の提言の振る舞いを明確にし、かつ事実上の標準をカバーしつつ曖昧・問題のある部分を除いたものである。

apply plugin: 'java'
apply plugin : 'war'
group = 'com.cadrlife'
version = '1.0.0'
buildscript {
repositories {
mavenCentral()
}
@katzchang
katzchang / readme.md
Last active January 1, 2016 03:19
VOYAGE GROUPに転職して2年とちょっとが経ちました #vgadvent2013 @katzchang.gist

VOYAGE GROUPに転職して2年とちょっとが経ちました

2年経ったらなんとなくまとめる流れがあったので、それに習い、2年間を振り返ってみます。

adingo Fluct開発チーム

入社当時の配属先。当時は@ajiyoshiがリード、1ヶ月前に入社していた@brtriverがグリーンバンドをしていたのが印象的だった。

管理系はPHPで書かれており、まともに触るのは初。最初はWindows上でなんとかしようとしたが、すぐに諦めてUbuntu on VMWareにした。本番サーバはCentだったけど。「共通の開発環境」みたいなのを用意してくれていて、アプリケーションはそれぞれ独立していたがDBは共用していて(これもそのうち解消したはず)、隣の人のデータを壊したりしていた。まーそれでも、聞けば答えてくれる人たちが周りにいたので、とりあえず仕事をすることが出来た気がする。立ち上がりはかなりゆっくりで、初回のコミットは4週間後だった記憶がある。

@masahide
masahide / config
Created February 25, 2014 04:44
go で yaml 等を「map[interface{}]interface{}」型で読み込んだ際の動的型の参照方法 ref: http://qiita.com/yamasaki-masahide/items/d6e406c4c11d5870a1c6
mail_from: hoge@fuga.com
to: [hoge@fuga.com]
var:
c: 2
d: [3, 4]