Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Yutaka Matsubara mopemope

🏠
Working from home
View GitHub Profile
@mopemope
mopemope / cloud-config.yml
Last active Aug 29, 2015
coreos cloud-config.yml
View cloud-config.yml
#cloud-config
hostname: coreos3
coreos:
etcd:
discovery: http://192.168.2.28:4001/v2/keys/cluster
addr: 192.168.2.52:4001
peer-addr: 192.168.2.52:7001
bind-addr: 0.0.0.0
@mopemope
mopemope / update-engine.log
Created Apr 11, 2014
coreos update-engine log
View update-engine.log
-- Logs begin at Tue 2014-04-01 02:28:51 UTC, end at Fri 2014-04-11 00:59:21 UTC. --
Apr 10 13:19:44 coreos1 update_engine[22503]: [0410/131944:INFO:omaha_request_action.cc(354)] Posting an Omaha request to http://public.roller.core-os.net/v1/update/
Apr 10 13:19:44 coreos1 update_engine[22503]: [0410/131944:INFO:omaha_request_action.cc(355)] Request: <?xml version="1.0" encoding="UTF-8"?>
Apr 10 13:19:44 coreos1 update_engine[22503]: <request protocol="3.0" version="CoreOSUpdateEngine-0.1.0.0" updaterversion="CoreOSUpdateEngine-0.1.0.0" installsource="scheduler" ismachine="1">
Apr 10 13:19:44 coreos1 update_engine[22503]: <os version="Chateau" platform="CoreOS" sp="273.0.0_x86_64"></os>
Apr 10 13:19:44 coreos1 update_engine[22503]: <app appid="{e96281a6-d1af-4bde-9a0a-97b76e56dc57}" version="273.0.0" track="alpha" from_track="alpha" bootid="{e8770eb0-1892-48fe-85d5-27702b1a5da2}" oem="" machineid="872761f03ba851fc93d357ec66bf1934" lang="en-US" board="amd64-usr" hardware_class="" delta_okay="false" >
Apr 10 1
@mopemope
mopemope / node.service
Created May 2, 2014
unit file example
View node.service
[Unit]
Description=Node Develop
[Service]
Type=simple
TimeoutStartSec=5m
# Create data container
@mopemope
mopemope / coreos1
Last active Aug 29, 2015
fleet submit log
View coreos1
core@coreos1 ~ $ etcdctl ls --recursive /_coreos.com/fleet/job
core@coreos1 ~ $ fleetctl list-units
UNIT LOAD ACTIVE SUB DESC MACHINE
core@coreos1 ~ $ fleetctl list-units
UNIT LOAD ACTIVE SUB DESC MACHINE
hello.service loaded active running Hello World 0b0d4b79.../192.168.2.50
core@coreos1 ~ $
View logentries.sh
#!/usr/bin/env bash
TOKEN=$1
journalctl -o short -f | awk -v token=$TOKEN '{ print token, $0; fflush(); }' | ncat data.logentries.com 10000
@mopemope
mopemope / project.clj
Last active Aug 29, 2015
Megami Watcher
View project.clj
(defproject megami.clj "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [
[org.clojure/clojure "1.6.0"]
[clojure-soup "0.0.1"]
[org.clojure/core.async "0.1.303.0-886421-alpha"]
[com.taoensso/timbre "3.2.1"]
View example_pongo2.go
package main
import (
"github.com/flosch/pongo2"
"github.com/gin-gonic/gin"
"net/http"
)
type pongoRender struct {
cache map[string]*pongo2.Template
View Main.hs
module Main where
import Control.Monad
import Data.Monoid
import Data.UnixTime
import Data.Convertible.Base
import Database.HDBC
import Database.HDBC.Sqlite3
View Main.hs
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
import Control.Monad
import Data.Aeson (FromJSON, ToJSON, decode)
import Data.Text (concat, unpack)
import Data.Text.Internal (Text)
-- import Data.Text.IO (putStrLn)
-- import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as BC
View gist:9d8c1729c393e58e8ac6
💀 arch-xps λ sudo ./bin/rkt --debug run https://github.com/coreos/etcd/releases/download/v0.5.0-alpha.4/etcd-v0.5.0-alpha.4-linux-amd64.aci (git)-[master][~/go/.../coreos/rocket]
2014/12/04 10:52:27 Unpacking stage1 rootfs
2014/12/04 10:52:28 Writing stage1 init
2014/12/04 10:52:28 Wrote filesystem to /var/lib/rkt/containers/2cf348cd-42a8-4961-8094-effa76e002f9
2014/12/04 10:52:28 Loading image sha256-f9215c18b86f406c7cec4c7b45fd8752b5bfd1a492507d647821c2ce593fbf31
2014/12/04 10:52:28 Writing container manifest
2014/12/04 10:52:28 Pivoting to filesystem /var/lib/rkt/containers/2cf348cd-42a8-4961-8094-effa76e002f9
2014/12/04 10:52:28 Execing stage1/init
Spawning container stage1 on /var/lib/rkt/containers/2cf348cd-42a8-4961-8094-effa76e002f9/stage1.
Press ^] three times within 1s to kill container.
You can’t perform that action at this time.