Skip to content

Instantly share code, notes, and snippets.

View int128's full-sized avatar

Hidetake Iwata int128

View GitHub Profile
sudo vim /etc/ipsec.conf
sudo /etc/init.d/ipsec start
Checking your system to see if IPsec got installed and started correctly:
Version check and ipsec on-path [OK]
Linux Openswan U2.6.27/K2.6.34.7-56.40.amzn1.x86_64 (netkey)
Checking for IPsec support in kernel [OK]
NETKEY detected, testing for disabled ICMP send_redirects [FAILED]
Please disable /proc/sys/net/ipv4/conf/*/send_redirects

携帯メールでは受信日時が分かりにくいので日時を付加。

title

{DATE} {TIME} ({TRIGGER.STATUS}) {TRIGGER.NAME}

message

Fix Java plugin version of Google Chrome

Launch regedit.exe and open following key:

HKEY_LOCAL_MACHINE\SOFTWARE\MozillaPlugins\@java.com/DTPlugin,version=xxxx

Fix or create item there:

Path=C:\Program Files\Java\jdk1.7.0_07\jre\bin\plugin2\npjp2.dll

Configurations on Cygwin

Todos after installation of Cygwin.

Fix mintty configuration

As you like.

export EDITOR=vim
PS1='\e[32m\u@\h \e[34m\w \e[33m[\t \d]\e[00m\n$ '
@int128
int128 / Catcher.groovy
Last active August 29, 2015 14:05
named object collection
class Catcher {
final Map<String, Closure> nameAndClosure = [:]
def methodMissing(String name, args) {
assert args.length == 1
assert args[0] instanceof Closure
nameAndClosure.put(name, args[0])
}
}
def remotes(Closure c) {
@int128
int128 / builder.groovy
Created August 19, 2014 15:33
How to use the builder to obtain a collection of objects
class RemoteCollectionBuilder extends BuilderSupport {
@Override
protected Object createNode(Object name, Map attributes, Object value) {
println("createNode $name, $attributes, $value")
name
}
@Override
protected Object createNode(Object name, Map attributes) {
println("createNode $name, $attributes")
name
@int128
int128 / deploy.gradle
Last active August 29, 2015 14:05
Specification of Gradle SSH Plugin and Groovy SSH Library (work in progress)
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.hidetake:gradle-ssh-plugin:0.4.0'
}
}
apply plugin: 'ssh'
@int128
int128 / 2014.08.26.md
Last active August 29, 2015 14:05
log
@int128
int128 / build.gradle
Last active August 29, 2015 14:05
Apache MINA SSHD seems slow down on Java 8 due to secure random
if (System.getProperty('os.name') == 'Linux') {
tasks.withType(JavaForkOptions) {
systemProperty 'java.security.egd', 'file:/dev/./urandom'
}
}