Skip to content

Instantly share code, notes, and snippets.

View sakama's full-sized avatar
🎯
🍺

Satoshi Akama sakama

🎯
🍺
  • Treasure Data
  • Tokyo, Japan
View GitHub Profile
@sakama
sakama / gcs_input.yml
Created March 18, 2015 02:14
embulk-input-gcsを使うためのymlのexample
in:
type: gcs
bucket: my-bucket
path_prefix: sample
service_account_email: ABCXYZ123ABCXYZ123.gserviceaccount.com
application_name: MyAppName
p12_keyfile_fullpath: /path/to/gcskey.p12
decoders:
- {type: gzip}
parser:
@sakama
sakama / embulk_run3.log
Created February 26, 2015 21:13
EmbulkでConfigDefault("null")を指定して実行した時のエラー その3
org/embulk/config/ModelManager.java:77:in `readObjectWithConfigSerDe': org.embulk.config.ConfigException: com.fasterxml.jackson.databind.JsonMappingException: Setting null to a @Config field is not allowed. Configuration object must be Optional<T> (com.google.common.base.Optional)
from org/embulk/config/DataSourceImpl.java:198:in `loadConfig'
from org/embulk/input/gcs/GcsFileInputPlugin.java:98:in `transaction'
from org/embulk/spi/FileInputRunner.java:60:in `transaction'
from org/embulk/exec/LocalExecutor.java:431:in `doRun'
from org/embulk/exec/LocalExecutor.java:40:in `access$000'
from org/embulk/exec/LocalExecutor.java:359:in `run'
from org/embulk/exec/LocalExecutor.java:355:in `run'
from org/embulk/spi/Exec.java:21:in `doWith'
from org/embulk/exec/LocalExecutor.java:355:in `run'
@sakama
sakama / embulk_run2.log
Created February 26, 2015 20:41
EmbulkでConfigDefault("null")を指定して実行した時のエラー その2
rm classpath/guava-jdk5-13.0.jar 後にrunを実行
$ embulk run ~/Desktop/gcs.yml
2015-02-27 05:37:45,892 +0900: Embulk v0.4.9
org/embulk/config/ModelManager.java:77:in `readObjectWithConfigSerDe': org.embulk.config.ConfigException: com.fasterxml.jackson.databind.JsonMappingException: Field 'last_path' is required but not set
at [Source: N/A; line: -1, column: -1]
from org/embulk/config/DataSourceImpl.java:198:in `loadConfig'
from org/embulk/input/gcs/GcsFileInputPlugin.java:98:in `transaction'
from org/embulk/spi/FileInputRunner.java:60:in `transaction'
from org/embulk/exec/LocalExecutor.java:431:in `doRun'
from org/embulk/exec/LocalExecutor.java:40:in `access$000'
@sakama
sakama / embulk_run.log
Created February 26, 2015 20:30
EmbulkでConfigDefault("null")を指定して実行した時のエラー
$ embulk run ~/Desktop/gcs.yml
2015-02-27 05:20:16,641 +0900: Embulk v0.4.9
org/embulk/config/ModelManager.java:77:in `readObjectWithConfigSerDe': org.embulk.config.ConfigException: com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of com.google.common.base.Optional, problem: abstract types either need to be mapped to concrete types, have custom deserializer, or be instantiated with additional type information
at [Source: 1; line: 1, column: 1]
from org/embulk/config/DataSourceImpl.java:198:in `loadConfig'
from org/embulk/input/gcs/GcsFileInputPlugin.java:100:in `transaction'
from org/embulk/spi/FileInputRunner.java:60:in `transaction'
from org/embulk/exec/LocalExecutor.java:431:in `doRun'
from org/embulk/exec/LocalExecutor.java:40:in `access$000'
from org/embulk/exec/LocalExecutor.java:359:in `run'
// ==UserScript==
// @name My Fancy New Userscript
// @namespace http://your.homepage/
// @version 0.1
// @description enter something useful
// @author You
// @match http://www.yahoo.co.jp/*
// @grant none
// ==/UserScript==
@sakama
sakama / unixbench.md
Created October 1, 2014 04:49
ニフクラeシリーズ ベンチマーク結果

ニフクラe-*シリーズサーバベンチ

いずれもeast-14

e-small

# cat /proc/cpuinfo
processor	: 0
@sakama
sakama / MySQL5.6のFulltextIndexのベンチマーク結果.md
Created July 22, 2014 10:59
MySQL5.6のFulltextIndexのベンチマーク結果

MySQL5.5

text型

mysql> explain select * from restaurants where name like "あ%";
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
| id | select_type | table       | type | possible_keys | key  | key_len | ref  | rows   | Extra       |
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
@sakama
sakama / create_sshkey_for_microsoft_azure.sh
Created May 26, 2014 13:00
既存のOpenSSL型式のSSH秘密鍵からMicrosoft Azure用の鍵を作成する
ssh-keygen -t rsa
openssl req -x509 -key ~/.ssh/id_rsa -nodes -days 365 -newkey rsa:2048 -out myCert.pem
#myCert.pemをコントロールパネルから登録する
ssh -i ~/.ssh/id_rsa azureuser@hostname
@sakama
sakama / docker_install_centos64.log
Last active August 29, 2015 13:58
DockerをCentOS6.4にインストールする
# CentOS6.5より前のバージョンでは動作しない
yum -y update
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
yum -y install docker-io
chkconfig docker on
service docker start
# docker run centos /bin/echo "Hello World"
Hello World
@sakama
sakama / wikipedia_import_ddl.sql
Created March 12, 2014 16:50
Wikipediaのデータをimportする
DROP TABLE IF EXISTS `page`;
CREATE TABLE `page` (
`page_id` int(10) unsigned NOT NULL auto_increment,
`page_namespace` int(11) NOT NULL,
`page_title` varchar(255) character set utf8 collate utf8_bin NOT NULL,
`page_restrictions` tinyblob NOT NULL,
`page_counter` bigint(20) unsigned NOT NULL default '0',
`page_is_redirect` tinyint(3) unsigned NOT NULL default '0',
`page_is_new` tinyint(3) unsigned NOT NULL default '0',
`page_random` double unsigned NOT NULL,