Skip to content

Instantly share code, notes, and snippets.

View i97506051502's full-sized avatar

Go Sato i97506051502

View GitHub Profile
@kirtfitzpatrick
kirtfitzpatrick / ec2_hostname.rb
Created April 9, 2012 21:27
Knife Ec2 Hostname Script - for Chef
#!/usr/bin/env ruby
# This script is intended to preprocess a knife ec2 server create command and
# generate a user_data script in the /tmp folder that will rename the host
# to match whatever the node name is before the chef bootstrapping process
# begins. It then splits the knife command in front of the --node-name or -N
# options and inserts "--user-data /tmp/server-01.userdata" (in the example
# below) and execs the command.
#
# Usage:
@onyxraven
onyxraven / rds.sh
Last active June 21, 2022 13:42 — forked from douglasjarquin/gist:2208690
Amazon RDS Performance Tuning Settings
#XLarge DBInstanceClassMemory = 15892177440 = 14.8GB
#/32 = 496630545 = 473MB
#/64 = 248315272 = 236MB
#/128 = 124157636 = 118MB
#/256 = 62078818 = 59MB
#/512 = 31039409 = 29MB
#/12582880 = 1263 #default same divisor as max_connections = 4041.6MB = 4237924762
#/25165760 = 623 # half of max_connections = 1993.6MB
#/50331520 = 315 # quarter of max_connections = 1008MB = 1056964608
#*(3/4) #default innodb pool size = 11922309120
@rummelonp
rummelonp / percol_zsh.md
Created December 7, 2012 15:57
percol 入れて zsh と組み合わせたら超便利

percol 入れて zsh と組み合わせたら超便利

だったので紹介

percol とは

percol は入力の1行を1候補として,部分一致かつ AND 検索で絞り込みし,選択した候補を出力するコマンドです.端的に言えば Emacs の anything.el のコマンド版です.
@honjo2
honjo2 / README.md
Created February 24, 2013 11:13
AWSのEC2上でRails+Unicorn+Nginxを実現する

目的

  • AWSのEC2上でRails+Unicorn+Nginxを実現する

前提

  • OSはAmazon Linux AMIを使用する

必要なライブラリをインストール

sudo yum -y install gcc
sudo yum -y install make

sudo yum -y install gcc-c++

@mikeda
mikeda / check_http_multi.rb
Last active December 17, 2015 08:49
Nagiosで複数URLをまとめてHTTP監視するプラグイン
#!/usr/local/bin/ruby
# -*- encoding: utf-8 -*-
require 'net/http'
require 'uri'
require 'pp'
configs = [
{ desc: '正常', url: 'http://mikeda.jp/wiki/', regex: /MikedaWiki/, timeout: 1},
{ desc: '中身がおかしい', url: 'http://mikeda.jp/wiki/', regex: /XXXYYYZZZ/, timeout: 1},
@voluntas
voluntas / shiguredo_tech.rst
Last active April 11, 2024 08:30
時雨堂を支える技術

時雨堂を支える技術

日時

2024-04-11

時雨堂

バージョン

2024.4

URL

https://shiguredo.jp/

時雨堂クラウドサービスを支える技術

@moyashipan
moyashipan / GoogleAppsScript.js
Created August 23, 2013 09:30
Gmailからタイトルと日付で検索した結果を、GoogleSpreadSheetに流し込みます
function searchAndSave() {
var sheet = SpreadsheetApp.getActiveSheet();
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
var offset = 0;
var limit = 500;
while (true) {
var threads = GmailApp.search('(subject:日報 AND [report) after:2013/5/31 before:2013/7/1', offset, limit);
offset += limit;
@inokappa
inokappa / gist:2a220eb50793094e1c0a
Last active November 9, 2015 11:59
涙の自腹課金検証シリーズ第三弾:CloudWatch とは
@sonots
sonots / fluentd_hacking_guide.md
Last active August 30, 2021 05:57
Fluentd ソースコード完全解説 (v0.10向け)

Fluentd ソースコード完全解説

英題:Fluentd Hacking Guide

目次

30分しかないため斜線部分は今回省く

  • Fluentd の起動シーケンスとプラグインの読み込み
  • Fluentd の設定ファイルのパース
  • Input Plugin から Output Plugin にデータが渡る流れ
@sorah
sorah / a.sh
Created October 17, 2014 05:20
Homebrew relink if necessary
#!/bin/bash
for keg in /usr/local/Library/LinkedKegs/*; do
kegname="$(basename $keg)"
dir="$(find $keg/ -maxdepth 1 -type d | grep '\/\(sbin\|bin\|etc\|var\|lib\|include\|libexec\|share\)$' | head -n1)"
[ -z "${dir}" ] && continue
testee="$(find $dir -type f | head -n1 | sed -e "s|${keg}||")"
[ -f /usr/local/$testee ] || (echo $keg && brew unlink $kegname; brew link --force $kegname)
done