Skip to content

Instantly share code, notes, and snippets.

View hitsumabushi's full-sized avatar

hitsumabushi hitsumabushi

  • Tokyo, Japan
View GitHub Profile
@hitsumabushi
hitsumabushi / install.sh
Last active April 12, 2016 13:38
install processmaker
# Install https://github.com/colosa/processmaker
# This script must be run as root user.
# If you want to run as non-root user, add sudo.
apt install -y \
libxml2-dev libcurl4-openssl-dev libfreetype6-dev libjpeg-dev libpng12-dev libbz2-dev libmcrypt-dev libmm-dev libxslt1-dev \
php5 php5-common php5-cli php5-mysql php5-gd php5-fpm php-pear php5-dev php5-mcrypt php5-curl libapache2-mod-php5

草のところのsvg を github というファイルに保存して、 github.csv というファイルにする。 GHE側でも同様に、ghe.csv を作る

$ grep "data-date" github | cut -d ' ' -f 18,19 | cut -d'>' -f1 | sed -e 's/data-count="\([^"]*\)" data-date="\([^"]*\)"/\2,\1/' > github.csv
{
"openapi": "3.0.0-RC1",
"servers": [
{
"url": "https://api.sakura.io/"
}
],
"info": {
"version": "1.0.3",
"title": "sakura.io API",
@hitsumabushi
hitsumabushi / petstore_simple_2.0.yml
Last active May 20, 2017 08:49
Open API Specification 2.0 and 3.0.0-rc1
swagger: '2.0'
info:
version: '1.0.0'
title: Swagger Petstore (Simple)
description: A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification
termsOfService: http://helloreverb.com/terms/
contact:
name: Swagger API team
email: [email protected]
url: http://swagger.io
@hitsumabushi
hitsumabushi / peco-usacloud-ssh.sh
Last active July 10, 2017 07:59
peco + usacloud for ssh
##
# select ssh host from usacloud server list
#
function peco-select-usacloud-ssh-host(){
local res
# IPでアクセス
res=$(echo $row | cut -d'|' -f 6 | sed -e 's/ *\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\)\/.*/\1/')
# hostname が名前解決できる場合
# row=$(usacloud server list | grep -v "^\+--" | peco)
res=$(echo $row | awk '{print $4;}')
@hitsumabushi
hitsumabushi / sacloud_inventory.py
Created December 5, 2017 13:18
sacloud inventory (for AWX container)
#!/usr/bin/env python
import sys
import argparse
import json
import os
import subprocess
# for exclude hosts, check tags
@hitsumabushi
hitsumabushi / main.go
Created February 5, 2018 11:50
Google Pub/Sub Publisher sample in Golang
package main
import (
"context"
"fmt"
"io/ioutil"
"log"
"google.golang.org/api/option"
@hitsumabushi
hitsumabushi / main.go
Created February 5, 2018 11:53
Google Pub/Sub Subscriber sample in Golang
package main
import (
"context"
"fmt"
"io/ioutil"
"log"
"golang.org/x/oauth2/google"
@hitsumabushi
hitsumabushi / README.md
Created June 8, 2018 09:52
One example: PostgreSQL doesn't use index with search condition on not balanced column

How to solve this problem

  • change random_page_cost

How to run

Setup

  1. run postgres
docker run --rm -p 5432:5432 --name postgres -e POSTGRES_PASSWORD=pass -d postgres:latest
@hitsumabushi
hitsumabushi / log
Last active August 18, 2020 03:01
terraform aws_ecs_service tagging issue
2020/08/18 11:50:51 [INFO] Terraform version: 0.12.29
2020/08/18 11:50:51 [INFO] Go runtime version: go1.12.13
2020/08/18 11:50:51 [INFO] CLI args: []string{"/home/hitsu/local/bin/terraform", "apply"}
2020/08/18 11:50:51 [DEBUG] Attempting to open CLI config file: /home/hitsu/.terraformrc
2020/08/18 11:50:51 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/08/18 11:50:51 [INFO] CLI command args: []string{"apply"}
2020/08/18 11:50:51 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config
2020/08/18 11:50:51 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
2020/08/18 11:50:51 [DEBUG] New state was assigned lineage "c3be82e5-67bb-dc72-3b6c-4c8a76ba30a6"
2020/08/18 11:50:51 [TRACE] Meta.Backend: using default local state only (no backend configuration, and no existing initialized backend)