Skip to content

Instantly share code, notes, and snippets.

View sgykfjsm's full-sized avatar

shigeyuki fujishima sgykfjsm

View GitHub Profile
@sgykfjsm
sgykfjsm / MyFirstScalatraServlet.scala
Created February 25, 2013 15:59
Scalatraで簡単にGETとPOSTを試す。
package com.sgykfjsm.app
import org.scalatra._
import scalate.ScalateSupport
class MyFirstScalatraServlet extends ScalatraTestStack {
get("/") {
contentType="text/html"
<html>

Saddleとは

SaddleはハイパフォーマンスなScala向けデータ操作ライブラリ。

Saddleでは以下の様なデータ形式や性質をもたらす。

  • array-backed
  • Indexed
  • 1次元または2次元データ構造
  • ベクトル計算
@sgykfjsm
sgykfjsm / setup_td_agent.sh
Last active December 28, 2015 02:39
td-agentの初期セットアップ
# before install
# http://docs.fluentd.org/articles/before-install
sudo cp -p /etc/security/limits.conf /etc/security/limits.conf.$(date +%Y%m%d%H%M%S)
sudo cp -p /etc/sysctl.conf /etc/sysctl.conf.$(date +%Y%m%d%H%M%S)
sudo cat <<CONTENTS | sudo tee -a /etc/security/limits.conf > /dev/null
# for td-agent
root soft nofile 65536
root hard nofile 65536
* soft nofile 65536
@sgykfjsm
sgykfjsm / setup.sh
Created January 8, 2014 22:23
mesosを試すときにつかったubuntu on vagratのsetupスクリプト
#!/bin/bash
# ssh setting
su - vagrant -c '
mkdir -p ${HOME}/.ssh
## for more secure
## after VMs start, distribute each id_push.pub to other VMs
# ssh-keygen -t rsa -q -P "" -f ~/.ssh/id_dsa
## sandbox setting
@sgykfjsm
sgykfjsm / distribute_mesos_setting_and_install_zookeeper.sh
Last active January 2, 2016 15:49
Zookeeperのインストールと、mesosおよびZookeeperの設定ファイルの配布をいっぺんに行うスクリプト
#!/bin/bash
# mesos setting
user=`whoami`
slaves=(slave1 slave2)
mesos_config_dir=/etc/default
mesos_config_files=(${mesos_config_dir}/mesos \
${mesos_config_dir}/mesos-master \
${mesos_config_dir}/mesos-slave \
/usr/local/var/mesos/deploy/slave.lst \
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://master1:8020/</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>dfs.name.dir</name>
<value>/var/lib/hadoop-hdfs/cache/hdfs/dfs/name</value>
</property>
<property>
<name>dfs.permissions.superusergroup</name>
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>master1:8021</value>
</property>
<property>
<name>mapred.local.dir</name>
#!/bin/bash
sudo -u mapred -g hadoop \
env JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64 \
HADOOP_HOME=`pwd`/hadoop-2.0.0-mr1-cdh4.2.1 \
HADOOP_CONF_DIR=/etc/hadoop/conf \
JAVA_LIBRARY_PATH=/usr/local/lib/ \
`pwd`/hadoop-2.0.0-mr1-cdh4.2.1/bin/hadoop jobtracker
@sgykfjsm
sgykfjsm / Vagrant
Last active January 3, 2016 02:19
vagrantでubuntuを入れて、jenkins,apapcheをセットアップ。
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise"
config.vm.box_url = "/Users/sgyk/local/vagrant/box/precise-server-cloudimg-amd64-vagrant-disk1.box"
config.cache.auto_detect = true