Skip to content

Instantly share code, notes, and snippets.

View yteraoka's full-sized avatar

Yoshinori Teraoka yteraoka

View GitHub Profile
@yteraoka
yteraoka / .aliases
Created February 29, 2024 15:40
dotfiles
alias cp="cp -i"
alias rm="rm -i"
alias mv="mv -i"
alias k="kubectl"
alias kd="kubectl describe"
alias g="git"
alias t="terraform"
alias tf="terraform"
alias tfdoc="terraform-docs"
alias awsid="aws sts get-caller-identity"
@yteraoka
yteraoka / main.go
Created November 1, 2022 09:14
golang.org/x/crypto/acme を使って証明書を発行する例
package main
import (
"bufio"
"context"
"crypto"
"crypto/ecdsa"
"crypto/rand"
"crypto/rsa"
"crypto/x509"
#!/bin/bash
termination_policy="OldestLaunchTemplate OldestInstance"
info(){
echo -e "\033[32m$(date +%Y-%m-%dT%H:%M:%S) $*\033[m"
}
usage(){
if [ $# -ge 1 ] ; then
#!/bin/bash
info(){
echo -e "\033[32m$(date +%Y-%m-%dT%H:%M:%S) $*\033[m"
}
usage(){
if [ $# -ge 1 ] ; then
echo $*
echo
@yteraoka
yteraoka / ubuntu.md
Last active May 4, 2020 05:17
ubuntu メモ

package のインストール

ip

apt-get install -y iproute2

ping

@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 / 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 / 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 / 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 / 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"
}