Skip to content

Instantly share code, notes, and snippets.

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

Minoru Osuka mosuka

🏠
Working from home
View GitHub Profile
@mosuka
mosuka / blevesearch_example.go
Last active June 23, 2022 00:16
Bleve with Japanese
package main
import (
"os"
"fmt"
"github.com/blevesearch/bleve"
_ "github.com/blevesearch/bleve/analysis/language/ja"
)
func main() {
@mosuka
mosuka / extract_ip_from_ifconfig.sh
Created February 26, 2016 05:31
Extract IP address from ifconfig command.
ifconfig -a | grep -e "inet[^6]" |\
sed -e "s/.*inet[^6][^0-9]*\([0-9.]*\)[^0-9]*.*/\1/" |\
grep -v "^127\."
@mosuka
mosuka / extract_ip_from_ip.sh
Created February 26, 2016 05:40
Extract IP address from ifconfig command.
ip addr show | grep -e "inet[^6]" |\
sed -e "s/.*inet[^6][^0-9]*\([0-9.]*\)[^0-9]*.*/\1/" |\
grep -v "^127\."
@mosuka
mosuka / ip_cmd.sh
Created February 26, 2016 07:57
Command to check the IP address
if type ip > /dev/null 2>&1; then
IP_CMD="ip addr show"
else
IP_CMD="ifconfig -a"
fi
$IP_CMD
@mosuka
mosuka / zkEnsemble.sh
Last active February 29, 2016 05:25
Script that provide a way to build the ensemble with ease.
#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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
apiVersion: v1
kind: ReplicationController
metadata:
name: kube-ui-v1
namespace: kube-system
labels:
k8s-app: kube-ui
version: v1
kubernetes.io/cluster-service: "true"
spec:
apiVersion: v1
kind: Service
metadata:
name: kube-ui
namespace: kube-system
labels:
k8s-app: kube-ui
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "KubeUI"
spec:
apiVersion: v1
kind: Pod
metadata:
name: busybox
namespace: default
spec:
containers:
- image: busybox
command:
- sleep
apiVersion: v1
kind: Service
metadata:
name: kube-ui
namespace: kube-system
labels:
k8s-app: kube-ui
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "KubeUI"
spec:
package main
import (
"encoding/json"
"fmt"
"github.com/blevesearch/bleve"
_ "github.com/blevesearch/bleve/analysis/analyzers/keyword_analyzer"
_ "github.com/blevesearch/blevex/lang/ja"
"os"
)