Skip to content

Instantly share code, notes, and snippets.

View hitsumabushi's full-sized avatar

hitsumabushi hitsumabushi

  • Tokyo, Japan
View GitHub Profile
@hitsumabushi
hitsumabushi / eclipse-java-google-style.xml
Last active March 15, 2024 08:20
Java coding style (basesd on Google Style Guides)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="13">
<profile kind="CodeFormatterProfile" name="GoogleStyle" version="13">
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
@hitsumabushi
hitsumabushi / default
Last active September 21, 2020 09:12
Preseed Files : working with Wheezy & Ubuntu 14.04
# 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
# 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
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

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
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
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)
#!/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
##
# 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;}')