Skip to content

Instantly share code, notes, and snippets.

View linyows's full-sized avatar

Tomohisa Oda linyows

View GitHub Profile
@linyows
linyows / index.ts
Last active June 1, 2020 02:47
Detect public pages on notion.
import fetch from "node-fetch"
const sleep = msec => new Promise(resolve => setTimeout(resolve, msec))
type Page = {
id: string
title: string
isPublic: boolean
}
@linyows
linyows / 0.vault-workshop.md
Last active September 1, 2020 02:46
やわらかVault

やわらかVault

Vaultを正しく理解して、実務で導入/運用をできるようにするワークショップです。 なお、WEB+DB PRESS Vol.104をあらかじめ買って「Hashicorp Vaultで秘密情報管理」の記事を読んでおくとバッチリでしょう。

目次

  1. はじめに
@linyows
linyows / postgresql.md
Created June 19, 2018 06:06
インフラエンジニアがいざという時に抑えておきたい postgresql コマンド

一旦テーブルの中身を把握したい時に使える一括CSV形式での出力

psql DATABASE_URL -c "select id,title from articles" -A -F,  | pbcopy 
  • -A 位置揃えなし
  • -F, カンマ区切り
  • DATABASE_URLpostgres://user:password@host:port/database
@linyows
linyows / infra-secret-management-overview.md
Created June 7, 2018 08:16 — forked from maxvt/infra-secret-management-overview.md
Infrastructure Secret Management Software Overview

Currently, there is an explosion of tools that aim to manage secrets for automated, cloud native infrastructure management. Daniel Somerfield did some work classifying the various approaches, but (as far as I know) no one has made a recent effort to summarize the various tools.

This is an attempt to give a quick overview of what can be found out there. The list is alphabetical. There will be tools that are missing, and some of the facts might be wrong--I welcome your corrections. For the purpose, I can be reached via @maxvt on Twitter, or just leave me a comment here.

There is a companion feature matrix of various tools. Comments are welcome in the same manner.

Keybase proof

I hereby claim:

  • I am linyows on github.
  • I am linyows (https://keybase.io/linyows) on keybase.
  • I have a public key whose fingerprint is FE16 4F06 E3E0 DA44 A3C1 257B 09C6 A623 7B0A CCB2

To claim this, I am signing this object:

@linyows
linyows / lunch-train.gs
Last active April 30, 2018 06:00
Notify slack channel for lunch members from slack usergroup random selects
moved: https://github.com/linyows/lunch-train.gs
#!/bin/bash
pr_id=$(git log | grep 'Merge pull request' | head -n 1 | sed -e 's/[^0-9]//g')
repo=$(git remote get-url origin | sed -e 's/ssh:\/\/git@.*\/\(.*\)\/\(.*\).git/\1\/\2/')
title=$(curl -s -H "Authorization: token ${GITHUB_TOKEN}" \
${GITHUB_API}repos/${repo}/pulls/${pr_id} | grep title | sed -e 's/.*".*": "\(.*\)",/\1/g')
echo $title
#include <stdio.h>
#include <stdlib.h>
#include <regex.h>
#include <string.h>
// Unatched: 0
// Matched: 1
int octopass_match(char *str, char *pattern, char **matched)
{
int res;
@linyows
linyows / notify_opend_pull-requests_to_slack.rb
Created February 20, 2017 09:51
Notify opend Pull-Requests to Slack
require 'octokit'
require 'netrc'
require 'json'
# Config
channel = '#development'
mention = '@dev'
slack_token = 'xoxb-xxxxxx-xxxxxxxxxxxxxxxxxxxx'
repos = %w(
our-org/our-project1
@linyows
linyows / .rubocop.yml
Created December 20, 2015 06:53 — forked from onk/.rubocop.yml
僕の使っている .rubocop.yml
# target_version:
# rubocop v0.34.2
# 自動生成されるものはチェック対象から除外する
AllCops:
Exclude:
- "vendor/**/*" # rubocop config/default.yml
- "db/schema.rb"
DisplayCopNames: true