NeoBundle 'scrooloose/syntastic'
...
" syntastic {{{
let g:syntastic_cpp_compiler = 'g++'
let g:syntastic_cpp_compiler_options = ' -std=gnu++11 -DCACHELINE_SIZE=64'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function _prompt_char() { | |
if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then | |
echo "%{%F{blue}%}%{%f%k%b%}" | |
else | |
echo ' ' | |
fi | |
} | |
# This theme works with both the "dark" and "light" variants of the | |
# Solarized color schema. Set the SOLARIZED_THEME variable to one of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DUM 111 ; 0 | |
LDC 0 ; 0 | |
LDC 0 ; 0 | |
LDC 0 ; 0 | |
LDC 0 ; 0 | |
LDC 0 ; 0 | |
LDC 0 ; 0 | |
LDC 0 ; 0 | |
LDC 0 ; 0 | |
LDC 0 ; 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define rnd 123456) | |
(define (flatten xs) | |
(if (null? xs) | |
() | |
(append (car xs) (flatten (cdr xs))))) | |
(define (field-ref field w y x) | |
(vector-ref field (+ (* y w) x))) | |
(define (field-set field w y x value) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ $# -ne 1 ]; then | |
echo "Usage: create-container NAME" 1>&2 | |
exit 1 | |
fi | |
name=$1 | |
ipaddr=$(sed -e 's/#.*$//' /etc/hosts | awk "\$2~/^${name}\$/ { print \$1 }") | |
if [ -z "$ipaddr" ]; then | |
echo "ERROR: IP address of ${name} was not found in /etc/hosts." 1>&2 | |
exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- /usr/share/lxc/templates/lxc-ubuntu 2014-04-15 00:49:58.000000000 +0900 | |
+++ /usr/share/lxc/templates/lxc-ubuntu-nojima 2014-06-22 18:03:15.209620112 +0900 | |
@@ -53,21 +53,41 @@ | |
release=$3 | |
user=$4 | |
password=$5 | |
# configure the network using the dhcp | |
- cat <<EOF > $rootfs/etc/network/interfaces | |
+ ipaddr=$(sed -e 's/#.*$//' /etc/hosts | awk "\$2~/^${hostname}\$/ { print \$1 }") |
socat
が便利だったのでメモ。
socat [options] <address> <address>
一方の address から入ってきたデータを他方の address に流すツール。 address には様々なデータストリームを指定できる。(標準入出力, TCP, UDP, ファイル, コマンドなど)
普通は address は read/write モードでオープンされる。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from argparse import ArgumentParser, REMAINDER | |
import os | |
import select | |
from subprocess import Popen, PIPE | |
import sys | |
def read_and_write(poll, rem, files, label): | |
for fd, _ in poll.poll(): | |
buf = os.read(fd, 1024) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
if [ "$1" = "" ]; then | |
echo "Usage: lxc-ssh NAME [ARGS]" | |
exit 1 | |
fi | |
NAME=$1 | |
ADDR=$(sudo lxc-info -n $NAME | awk -F': *' '/^IP:/ { print $2 }') | |
shift |