Skip to content

Instantly share code, notes, and snippets.

View mopemope's full-sized avatar
🏠
Working from home

Yutaka Matsubara mopemope

🏠
Working from home
View GitHub Profile
@mopemope
mopemope / kitty-server.lfe
Created April 14, 2015 03:28
simple kitty-server
(defmodule kitty-server
(export all))
(defrecord cat
name
(color 'green)
description)
;; Client API
(defun start-link ()
@mopemope
mopemope / gist:9d8c1729c393e58e8ac6
Created December 4, 2014 01:54
Roket Demo Debug Log
💀 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.
@mopemope
mopemope / Main.hs
Created September 2, 2014 04:33
HENTAI
{-# 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
@mopemope
mopemope / Main.hs
Created August 29, 2014 04:28
Test
module Main where
import Control.Monad
import Data.Monoid
import Data.UnixTime
import Data.Convertible.Base
import Database.HDBC
import Database.HDBC.Sqlite3
@mopemope
mopemope / example_pongo2.go
Created July 16, 2014 06:45
Gin meets Pongo2 !
package main
import (
"github.com/flosch/pongo2"
"github.com/gin-gonic/gin"
"net/http"
)
type pongoRender struct {
cache map[string]*pongo2.Template
@mopemope
mopemope / project.clj
Last active August 29, 2015 14:03
Megami Watcher
(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"]
@mopemope
mopemope / logentries.sh
Created May 23, 2014 06:18
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 / nspawn-container
Last active October 29, 2016 16:53
nspawn-container
#!/bin/bash
TOOLBOX_DOCKER_IMAGE=$1
TOOLBOX_USER=root
machinename=$(echo "${USER}-${TOOLBOX_DOCKER_IMAGE}" | sed -r 's/[^a-zA-Z0-9_.-]/_/g')
machinepath="/var/lib/toolbox/${machinename}"
if [ ! -d ${machinepath} ] || systemctl is-failed ${machinename} ; then
sudo mkdir -p "${machinepath}"
@mopemope
mopemope / coreos1
Last active August 29, 2015 14:01
fleet submit log
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 ~ $
@mopemope
mopemope / log
Created May 13, 2014 08:34
run systemd-nspawn docker container
core@coreos-local ~ $ ./nspawn-container jmatis/tomcat7 "/opt/start-watch-tomcat.sh"
Pulling repository jmatis/tomcat7
b3dfa5e5f738: Download complete
511136ea3c5a: Download complete
5e66087f3ffe: Download complete
4d26dd3ebc1c: Download complete
d4010efcfd86: Download complete
99ec81b80c55: Download complete
c17d434dd941: Download complete
180579a76826: Download complete