Skip to content

Instantly share code, notes, and snippets.

View tcnksm's full-sized avatar
☺️
Yo

Taichi Nakashima tcnksm

☺️
Yo
View GitHub Profile
@tcnksm
tcnksm / Dockerfile
Created May 11, 2014 10:05
Dockerfile for apache container
FROM ubuntu:12.04
RUN apt-get update
RUN apt-get install -y apache2
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
RUN echo 'Hello, docker' > /var/www/index.html
@tcnksm
tcnksm / README.md
Last active August 25, 2016 06:50
consul memo

n1

Web UI

consul agent -server -bootstrap -data-dir /tmp/consul -ui-dir /var/consul-ui -node=agent-one -client=172.20.20.10 -bind=172.20.20.10

n2

@tcnksm
tcnksm / README.md
Last active August 29, 2015 14:04
Commit go project

That's okay. Let's have an original repo at for example github.com/alice/bar. Fork it, on github, to your (say you're user bob at github), ie. to github.com/bob/bar. Then:

$ cd $GOPATH/src/github.com/alice 
$ git clone https://github.com/bob/bar.git 
$ cd bar 

no

$ docker run --restart=no busybox /bin/sh -c 'date; exit 1'
Wed Sep 17 08:13:15 UTC 2014
$ docker ps -a
CONTAINER ID        IMAGE               COMMAND                CREATED             STATUS                     PORTS               NAMES
@tcnksm
tcnksm / Dockerfile
Last active August 29, 2015 14:08
Dockerfile for nghttp2
FROM buildpack-deps
RUN git clone https://github.com/tatsuhiro-t/nghttp2 \
&& cd nghttp2 \
&& autoreconf -i \
&& automake \
&& autoconf \
&& ./configure \
&& make
@tcnksm
tcnksm / include1.go
Last active August 29, 2015 14:16
gore text-fixutures
package include1
import (
"fmt"
"runtime"
)
func hello() string {
return fmt.Sprintf("Hello from %s", runtime.GOOS)
}
type StringFlag []string
func (s *StringFlag) String() string {
return strings.Join(*s, ",")
}
func (s *StringFlag) Set(value string) error {
*s = append(*s, value)
return nil
}
@tcnksm
tcnksm / flag_slice.go
Created June 21, 2015 04:08
Flag slice
import "strings"
type StringFlag []string
func (s *StringFlag) String() string {
return strings.Join(*s, ",")
}
func (s *StringFlag) Set(value string) error {
package main
import (
"fmt"
"io/ioutil"
"os"
"testing"
)
func Test_chdir(t *testing.T) {
@tcnksm
tcnksm / main.go
Last active March 3, 2022 06:57
Export all Grafana dashboards via HTTP API in Golang
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"os"
)