Skip to content

Instantly share code, notes, and snippets.

View yteraoka's full-sized avatar

Yoshinori Teraoka yteraoka

View GitHub Profile
@yteraoka
yteraoka / direct.txt
Last active January 24, 2017 02:18
redis 直接と haproxy 経由での redis-benchmark 比較
$ redis-benchmark -a gDDTEGhRnReCKQEn -p 6479 -h 192.168.140.74
====== PING_INLINE ======
100000 requests completed in 2.48 seconds
50 parallel clients
3 bytes payload
keep alive: 1
41.71% <= 1 milliseconds
93.96% <= 2 milliseconds
99.36% <= 3 milliseconds
/var/log/repmgr/repmgr-9.5.log
[2016-09-28 00:43:43] [ERROR] promote command failed. You could check and try it manually.
*** Error in `/usr/pgsql-9.5/bin/repmgrd': double free or corruption (out): 0x00000000008291c0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7cfe1)[0x7fced6cf9fe1]
/usr/pgsql-9.5/lib/libpq.so.5(+0xa7df)[0x7fced70487df]
/usr/pgsql-9.5/bin/repmgrd[0x409db3]
/usr/pgsql-9.5/bin/repmgrd[0x40db68]
/usr/pgsql-9.5/bin/repmgrd[0x40304a]
@yteraoka
yteraoka / mysql-ha.txt
Created June 11, 2017 14:09
MySQL-HA-Cluster-on-CentOS7-using-DRBD
https://www.lisenet.com/2016/activepassive-mysql-high-availability-pacemaker-cluster-with-drbd-on-centos-7/
http://clusterlabs.org/doc/it-IT/Pacemaker/1.1/html/Clusters_from_Scratch/ch07.html
http://elrepo.org/tiki/tiki-index.php
http://qiita.com/sion_cojp/items/a6a329df0415a843fb12
https://blog.3ware.co.jp/drbd-users-guide-8.3/s-configure-split-brain-behavior.html
@yteraoka
yteraoka / kvm-host-dashboard.json
Created August 20, 2017 12:30
Grafana dashboard for KVM Host
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
@yteraoka
yteraoka / tts.go
Created August 19, 2018 07:46
Google Cloud Text-to-Speech example
package main
// http://codegists.com/code/google-cloud-speech-example/
import (
"cloud.google.com/go/texttospeech/apiv1"
"context"
flags "github.com/jessevdk/go-flags"
texttospeechpb "google.golang.org/genproto/googleapis/cloud/texttospeech/v1"
"io/ioutil"
@yteraoka
yteraoka / mdns-client.go
Created August 21, 2018 23:26
mDNS client test
package main
import (
"context"
"flag"
"log"
"time"
"strings"
"github.com/grandcat/zeroconf"
@yteraoka
yteraoka / nannohi.py
Last active November 1, 2019 15:26
Wikipedia から今日が何の日かを抽出
import random
import requests
from bs4 import BeautifulSoup
from datetime import date
today = date.today()
url = 'https://ja.wikipedia.org/wiki/{}月{}日'.format(today.month, today.day)
events = []
@yteraoka
yteraoka / wordpress-with-vitess-error-log.txt
Created February 16, 2020 14:00
WordPress を Vitess で実行して Dashboard を表示した時のエラー
[Sat Feb 15 16:05:59.792882 2020] [php7:warn] [pid 82] [client 172.17.0.1:57975] PHP Warning: mysqli_query(): Error reading result set's header in /var/www/html/wp-includes/wp-db.php on line 2030, referer: http://192.168.64.11:30803/wp-admin/
[Sat Feb 15 16:05:59.794799 2020] [php7:notice] [pid 82] [client 172.17.0.1:57975] WordPress \xe3\x83\x87\xe3\x83\xbc\xe3\x82\xbf\xe3\x83\x99\xe3\x83\xbc\xe3\x82\xb9\xe3\x82\xa8\xe3\x83\xa9\xe3\x83\xbc: Commands out of sync; you can't run this command now for query SELECT option_value FROM wp_options WHERE option_name = '_transient_feed_mod_992efac292246ae35bf235a03417a202' LIMIT 1 made by do_action('wp_ajax_dashboard-widgets'), WP_Hook->do_action, WP_Hook->apply_filters, wp_ajax_dashboard_widgets, wp_dashboard_primary, wp_dashboard_cached_rss_widget, wp_dashboard_primary_output, wp_widget_rss_output, fetch_feed, SimplePie->init, WP_Feed_Cache_Transient->save, set_transient, get_option, referer: http://192.168.64.11:30803/wp-admin/
[Sat Feb 15 16:05:59.795120 2020] [php
@yteraoka
yteraoka / ubuntu.md
Last active May 4, 2020 05:17
ubuntu メモ

package のインストール

ip

apt-get install -y iproute2

ping

#!/bin/bash
info(){
echo -e "\033[32m$(date +%Y-%m-%dT%H:%M:%S) $*\033[m"
}
usage(){
if [ $# -ge 1 ] ; then
echo $*
echo