Skip to content

Instantly share code, notes, and snippets.

@wataru420
wataru420 / ProcessBuilderSample.java
Created January 30, 2012 06:10
ProcessBuilderでワイルドカードを使いたいとき
public void cp(String source, String dist) throws Exception {
String command = "cp " + source + " " + dist;
String[] cmd = new String[] { "/bin/sh", "-c", command };
this.exec(cmd);
ProcessBuilder pb = new ProcessBuilder(cmd);
Process p = pb.start();
int val = p.waitFor();
if (val != 0) {
<html>
<head>
<meta charset="utf-8">
<title>x-webkit-speech test</title>
<script>
function speechInput() {
alert("changed!");
}
</script>
</head>
@wataru420
wataru420 / command
Created February 4, 2012 12:15
HerokuでPlay2.0日本語対応用のコマンド
$ heroku config:add SBT_OPTS="-Xmx384m -Xss512k -XX:+UseCompressedOops -Dfile.encoding=UTF8"
$ heroku config:add BUILDPACK_URL="https://github.com/wataru420/heroku-buildpack-scala.git"
$ echo "web: target/start \${SBT_OPTS}" > Procfile
$ git commit -am 'Procfile using SBT_OPTS
$ git push heroku master
@wataru420
wataru420 / addUser
Created February 7, 2012 03:54
Jenkins init script for centos
/usr/sbin/groupadd -g 30119 jenkins
/usr/sbin/useradd -u 30119 -g jenkins jenkins
mkdir /home/jenkins
chown -R jenkins. /home/jenkins
@wataru420
wataru420 / build.properties
Created February 7, 2012 12:44
sbt-assembly
sbt.version=0.11.2
\documentclass{jarticle}
\usepackage{scala}
\begin{document}
こんにちわ
\end{document}
<style>.gist{color:#000;}.gist div{padding:0;margin:0;}.gist .gist-file{border:1px solid #dedede;font-family:Monaco,'Courier New','DejaVu Sans Mono','Bitstream Vera Sans Mono',monospace;margin-bottom:1em;}.gist .gist-file .gist-meta{overflow:hidden;font-size:85%;padding:.5em;color:#666;background-color:#eaeaea;}.gist .gist-file .gist-meta a{color:#369;}.gist .gist-file .gist-meta a:visited{color:#737;}.gist .gist-file .gist-data{overflow:auto;word-wrap:normal;background-color:#f8f8ff;border-bottom:1px solid #ddd;font-size:100%;}.gist .gist-file .gist-data pre{font-family:'Bitstream Vera Sans Mono','Courier',monospace;background:transparent !important;margin:0 !important;border:none !important;padding:.25em .5em .5em .5em !important;}.gist .gist-file .gist-data .gist-highlight{background:transparent !important;}.gist .gist-file .gist-data .gist-line-numbers{background-color:#ececec;color:#aaa;border-right:1px solid #ddd;text-align:right;}.gist .gist-file .gist-data .gist-line-numbers span{clear:right;display:b
@wataru420
wataru420 / HASH.sql
Created March 16, 2012 03:08
redisTest
drop table if exists ranking;
create table ranking(
id VARCHAR(12) NOT NULL PRIMARY KEY,
point BIGINT NOT NULL,
INDEX USING HASH (point)
) ENGINE=MEMORY;
@wataru420
wataru420 / build.sh
Created March 18, 2012 04:37
jenkinsでCron
rsync -av --exclude="*.svn" $WORKSPACE/scripts/ targethost:/path/to/scripts
ssh targethost sh /path/to/scripts/mkdir.sh
#!/bin/sh
# -*- sh -*-
: << =cut
=head1 NAME
java_log_errorcount - Plugin to count errors in java log
=head1 CONFIGURATION