Skip to content

Instantly share code, notes, and snippets.

View ephemeralsnow's full-sized avatar

Yuzuki Masaru ephemeralsnow

View GitHub Profile
@ephemeralsnow
ephemeralsnow / gist:61ba255063aa5892cef250ee665ce650
Created July 20, 2016 04:19
Vagrant 1.8.5とboot2dockerでShared Folderのマウントに失敗する
https://github.com/mitchellh/vagrant/blob/7e88266999e0eaf86299421e99a4fb038b4f2b1c/plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb#L14
ここの
mount_commands = ["set -e"]
mount_commands = []
へ修正して回避できた。
boot2docker の /bin/sh が busybox だから?
@ephemeralsnow
ephemeralsnow / stream.go
Created April 8, 2016 12:54
github.com/gengo/grpc-gateway/runtime/stream.go(仮)
package runtime
import (
"io"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/metadata"
)
@ephemeralsnow
ephemeralsnow / ~_.sbt_repositories
Last active August 5, 2016 06:46
GoogleのMaven Central mirrorをsbtで使う
# http://takari.io/2015/10/28/google-maven-central.html
[repositories]
local
activator-launcher-local: file://${activator.local.repository-${activator.home-/doesnotexist}/repository}, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
activator-local: file://${activator.local.repository-/usr/local/Cellar/typesafe-activator/1.3.2/libexec/repository}, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
google-maven-central: https://maven-central.storage.googleapis.com
maven-central
typesafe-releases: http://repo.typesafe.com/typesafe/releases
typesafe-ivy-releasez: http://repo.typesafe.com/typesafe/ivy-releases, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
@ephemeralsnow
ephemeralsnow / gist:225b89869a9ece984daf
Last active August 29, 2015 14:24
aws ec2 describe-instances から jq で /etc/hosts 作成
aws ec2 describe-instances --region ap-northeast-1 | jq -r '.Reservations[].Instances[] | select(.State.Name == "running") | .PrivateIpAddress as $private_ip | select($private_ip != null) | select(.Tags != null) | .Tags[] | select(.Key == "hostname") | select(. != null) | .Value as $host | select($host != null) | "\($private_ip)\t\t\($host)"' | sort -k2 | expand -t 8
sed '/^# ADDED BY THE PROGRAM$/,$d' | sed -e :a -e '/^\n*$/{$d;N;};/\n$/ba'
@ephemeralsnow
ephemeralsnow / gist:f1cf60d83a5dbc5ca29f
Last active August 29, 2015 14:24
Vagrant 1.7.3でvagrant upするとdocker pullしにいっちゃう
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/plugins/providers/docker/action.rb
https://github.com/mitchellh/vagrant/blob/dbf0af2e3fea2dcf7c76956ac0e58127dd1df846/plugins/providers/docker/action.rb#L261
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/plugins/providers/docker/action/pull.rb
https://github.com/mitchellh/vagrant/blob/dbf0af2e3fea2dcf7c76956ac0e58127dd1df846/plugins/providers/docker/action/pull.rb#L16
libraryDependencies ++= Seq(
"org.slf4j" % "slf4j-api" % "1.7.12",
"ch.qos.logback" % "logback-core" % "1.1.3",
"ch.qos.logback" % "logback-classic" % "1.1.3",
"ch.qos.logback.contrib" % "logback-json-core" % "0.1.2",
"ch.qos.logback.contrib" % "logback-json-classic" % "0.1.2",
"ch.qos.logback.contrib" % "logback-jackson" % "0.1.2",
"com.fasterxml.jackson.core" % "jackson-core" % "2.5.2",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.5.2",
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.5.2"
@ephemeralsnow
ephemeralsnow / polymer-3pane.html
Last active August 29, 2015 14:15
Polymer-3pane
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@ephemeralsnow
ephemeralsnow / index_template
Created December 12, 2014 06:09
Elasticsearch Advent Calendar 2014 16日目
{
"template": "message_index",
"settings": {
"index": {
"number_of_shards": 10,
"number_of_replicas": 0,
"analysis": {
"analyzer": {
"message_analyzer": {
"type": "custom",
@ephemeralsnow
ephemeralsnow / gist:7ce618d85e526b6dcf19
Created October 23, 2014 06:02
Java8 Date and Time API の java.time.Instant に対応させる play.api.libs.json.{Reads, Writes, Format}
package helpers.play.api.libs.json
import play.api.data.validation.ValidationError
import play.api.libs.json._
/**
* @see play.api.libs.json.Reads
*/
object InstantReads {
@ephemeralsnow
ephemeralsnow / gist:8e3a653e7e4bafa5f44c
Created August 7, 2014 08:33
logstash-template.json
curl -XPUT 'http://127.0.0.1:9200/_template/logstash' -v -d '{
"template": "logstash-*",
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"mappings": {
"_default_": {
"_source": { "compress": true },
"_all": { "enabled": false },