Skip to content

Instantly share code, notes, and snippets.

Avatar

hitsumabushi hitsumabushi

  • Tokyo, Japan
View GitHub Profile
@hitsumabushi
hitsumabushi / default
Last active September 21, 2020 09:12
Preseed Files : working with Wheezy & Ubuntu 14.04
View default
# D-I config version 2.0
default debian/7.4/amd64/boot-screens/vesamenu.c32
prompt 1
timeout 300
menu title - Boop Menu -
label Debian-7.4
menu label ^0 Debian 7.4
#include debian/7.4/amd64/boot-screens/menu.cfg
kernel debian/7.4/amd64/linux
@hitsumabushi
hitsumabushi / default
Last active September 8, 2020 13:32
PXE install
View default
# pxelinux.cfg/default file
default debian/7.4/amd64/boot-screens/vesamenu.c32
prompt 1
timeout 300
menu title - Boop Options Menu -
label Debian-7.4
menu label ^0 Debian 7.4
#include debian/7.4/amd64/boot-screens/menu.cfg
kernel debian/7.4/amd64/linux
@hitsumabushi
hitsumabushi / log
Last active August 18, 2020 03:01
terraform aws_ecs_service tagging issue
View log
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)
@hitsumabushi
hitsumabushi / README.md
Created June 8, 2018 09:52
One example: PostgreSQL doesn't use index with search condition on not balanced column
View README.md

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 / main.go
Created February 5, 2018 11:53
Google Pub/Sub Subscriber sample in Golang
View main.go
package main
import (
"context"
"fmt"
"io/ioutil"
"log"
"golang.org/x/oauth2/google"
@hitsumabushi
hitsumabushi / main.go
Created February 5, 2018 11:50
Google Pub/Sub Publisher sample in Golang
View main.go
package main
import (
"context"
"fmt"
"io/ioutil"
"log"
"google.golang.org/api/option"
@hitsumabushi
hitsumabushi / sacloud_inventory.py
Created December 5, 2017 13:18
sacloud inventory (for AWX container)
View sacloud_inventory.py
#!/usr/bin/env python
import sys
import argparse
import json
import os
import subprocess
# for exclude hosts, check tags
@hitsumabushi
hitsumabushi / peco-usacloud-ssh.sh
Last active July 10, 2017 07:59
peco + usacloud for ssh
View peco-usacloud-ssh.sh
##
# 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 / petstore_simple_2.0.yml
Last active May 20, 2017 08:49
Open API Specification 2.0 and 3.0.0-rc1
View petstore_simple_2.0.yml
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: foo@example.com
url: http://swagger.io