Skip to content

Instantly share code, notes, and snippets.

View s1061123's full-sized avatar

Tomofumi Hayashi s1061123

  • Red Hat
  • Tokyo, Japan
View GitHub Profile
@s1061123
s1061123 / chord.hs
Created January 24, 2012 03:06
chord.hs: Showing Diatonic Chords Tool
{-
chord: Showing Diatonic Chords Tool
Description
Chord is very simple haskell program which shows diatonic chords
from given key.
Requirements:
The following program/library are required.
- Haskell (hugs are tested but ghc also works)
@s1061123
s1061123 / file10.txt
Last active September 11, 2015 02:59
Lagopusをqemu/kvm with virtio-netで動かす (dpdk 1.7.1/lagopus 0.1.2) ref: http://qiita.com/s1061123/items/ffa3974e4635c06faa26
pip install ryu
pip install six --upgrade
@s1061123
s1061123 / ovs-helper
Created November 29, 2016 04:29
ovs-helper // ovs helper command for OPNFV Apex
#!/usr/bin/env bash
CONFIG=${CONFIG:-'/var/opt/opnfv'}
RESOURCES=${RESOURCES:-"$CONFIG/images"}
LIB=${LIB:-"$CONFIG/lib"}
#VALID_CMDS="undercloud overcloud opendaylight debug-stack mock-detached -h --help"
VALID_CMDS="getdpid getflow -h --help"
source $LIB/utility-functions.sh
#!/bin/bash
export KUBECONFIG=$(readlink -f auth/kubeconfig)
master=$(oc get -o json node | jq '.items| map(select( .metadata.labels["node-role.kubernetes.io/master"] == "" )) | .[0].status.addresses | map(select( .["type"] == "InternalDNS")) | .[0]."address"' -r)
master_extdns=$(oc get -o json node $master | jq ' .status.addresses | map(select( .["type"] == "ExternalDNS")) | .[0]."address"' -r)
scp -q -i ~/.ssh/libra.pem -o ProxyCommand="ssh -q -A -i ~/.ssh/libra.pem -W %h:%p core@${master_extdns}" -r core@${master}:~/data .
@s1061123
s1061123 / multus-daemonset.yaml
Created January 30, 2019 06:38
multus-daemonset.yaml for clusterNetwork
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: network-attachment-definitions.k8s.cni.cncf.io
spec:
group: k8s.cni.cncf.io
version: v1
scope: Namespaced
names:
@s1061123
s1061123 / test.yml
Last active April 24, 2019 08:39
cni-route-overwrite examples
#only available with crio/podman (not docker runtime)
---
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: flannel-cluster
namespace: kube-system
spec:
config: '
{
@s1061123
s1061123 / gist:a0b94ff6ee77c48c711158e27fe9ace7
Last active July 31, 2019 08:15
cni-route-override examples
# Initial Config (without cni-route-override)
[tohayash@tohayash-lab ~]$ cat /etc/cni/net.d/87-podman-bridge.conflist
{
"cniVersion": "0.3.1",
"name": "podman",
"plugins": [
{
"type": "bridge",
"bridge": "cni0",
"isGateway": true,
#!/usr/bin/env bash
# Copyright 2014 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
diff --git a/pkg/controller/endpoint/endpoints_controller.go b/pkg/controller/endpoint/endpoints_controller.go
index 6df6565..357dc1c 100644
--- a/pkg/controller/endpoint/endpoints_controller.go
+++ b/pkg/controller/endpoint/endpoints_controller.go
@@ -17,6 +17,7 @@ limitations under the License.
package endpoint
import (
+ "encoding/json"
"fmt"
[root@tomo-centos ~]# iptables-save
# Generated by iptables-save v1.4.21 on Tue Dec 10 07:44:03 2019
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:MULTUS-EXTERNAL-SERVICES - [0:0]
:MULTUS-FIREWALL - [0:0]
:MULTUS-FORWARD - [0:0]
:MULTUS-SERVICES - [0:0]