Skip to content

Instantly share code, notes, and snippets.

@nikushi
nikushi / spreadsheet-memo.md
Created June 4, 2014 06:32
spreadsheet-memo

Google spreadsheet memo

vlookup

列を番号で指定するところがキモく、多用しないほうがいい

filter

ある範囲を、こういう条件で検索して、リストを出す。条件は複数かけるSUM(FILTER(..))でやったりする。

@nikushi
nikushi / gas-memo.md
Last active January 5, 2016 07:57
Google Apps Script For Beginnerを読んでいる。途中のメモ書き

chapter 1

簡単なデバッグ

*Logger.log('message') コンソールログ

  • throw('message') flash alert的なポップアップ
  • SpreadsheetApp.getActiveSpreadsheet().toast('message') Spreadsheet等の右側にポップアップメッセージ
  • Browser.msgBox('hello world'); 中央にポップアップメニュー + button。Browerクラスでは文字列入力などのポップアップも出せる

スプレッドシートの自動整形

sqlite3

sqlite> .schema nodes
CREATE TABLE "nodes" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, 
"type" varchar(255), 
"path" varchar(768) NOT NULL, 
"description" varchar(255), 
"visible" boolean DEFAULT 't' NOT NULL, 
Count: 1  Time=0.25s (0s)  Lock=0.00s (0s)  Rows=0.0 (0), yohoushi[yohoushi]@localhost
  SELECT  `nodes`.* FROM `nodes`  WHERE `nodes`.`type` IN ('S') AND `nodes`.`path` = 'S' LIMIT N

Count: 1922  Time=0.23s (450s)  Lock=0.00s (0s)  Rows=0.0 (0), yohoushi[yohoushi]@localhost
  SELECT  `nodes`.* FROM `nodes`  WHERE `nodes`.`type` IN ('S') AND `nodes`.`path` = 'S'  ORDER BY `nodes`.`id` ASC LIMIT N

Count: 8017  Time=0.09s (749s)  Lock=0.00s (0s)  Rows=0.9 (7563), yohoushi[yohoushi]@localhost
  SELECT  id FROM `nodes`  WHERE `nodes`.`type` IN ('S') AND `nodes`.`path` = 'S'  ORDER BY `nodes`.`id` ASC LIMIT N
@nikushi
nikushi / test
Created April 28, 2014 01:53
test
test

embeded mode

se = ServerEngine.create(nil, MyWorker, {
  :daemonize => true,
  :log => 'myserver.log',
  :pid_path => 'myserver.pid',
})
se.run

USR1 works?

config/serverengine.god watch memory usage
|
v
triggered!
|
v
God send USR1 to serverengine

bin/yohoushiからunicorn, serverengineを起動する直前まで

bin/yohoushi
 |
 v
lib/yohoushi/cli.rb

   options[:config]    = File.expand_path('config/yohoushi.god', ENV['RAILS_ROOT']) # yohoushi custom
   require File.expand_path('vendor/extensions/god/cli/run', ENV['RAILS_ROOT']) # yohoushi custom
@nikushi
nikushi / launch-fluentd-on-httpconf.md
Last active August 29, 2015 13:58
FluentdをHTTP経由でコンフィグロードして起動させるワンライナーhack

FluentdをHTTP経由でコンフィグロードして起動させるワンライナーhack

fluentd -i "include http://localhost:3000/fluentd.conf" -c /dev/null 

or

curl -s -S http://localhost:3000/fluentd.conf | fluentd -i - -c /dev/null 
@nikushi
nikushi / Sense-Get-Started-memo.md
Last active December 23, 2015 10:18
20140113 ヒカリエハッカソンでSensu触ったメモ

Sensu

Sensuやりたかった理由

Nagios - APIない、コンフィグ生成して配るとかになりがち
Zabbix - エンタープライズ、zabbix proxyで中央集権+エージェント的な構成とれるが、中央集約するzabbix重くなる

Sensuいいところ