Skip to content

Instantly share code, notes, and snippets.

View passer-b's full-sized avatar

Shota Kondo passer-b

View GitHub Profile
@blacktm
blacktm / install_ruby_rpi.sh
Last active November 28, 2024 20:35
A Bash script to install Ruby on the Raspberry Pi
#!/bin/bash
# --------------------------------------------------------------------------------------------
# Installs Ruby using rbenv/ruby-build on the Raspberry Pi (Raspbian)
#
# Run from the web:
# bash <(curl -s https://gist.githubusercontent.com/blacktm/8302741/raw/install_ruby_rpi.sh)
# --------------------------------------------------------------------------------------------
# Set the Ruby version you want to install
@sonots
sonots / fluentd_hacking_guide.md
Last active October 4, 2024 00:01
Fluentd ソースコード完全解説 (v0.10向け)

Fluentd ソースコード完全解説

英題:Fluentd Hacking Guide

目次

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

  • Fluentd の起動シーケンスとプラグインの読み込み
  • Fluentd の設定ファイルのパース
  • Input Plugin から Output Plugin にデータが渡る流れ
@descico
descico / presto-code-split.md
Last active August 13, 2017 01:50
Presto の話。ただし最近ほとんど触っていなかったので情報は古いので注意せよ。

Split を worker Node に割り当てる処理について

  • やっているのは NodeScheduler のcomputeAssignments のようだ。
  • locationAwareScheduling と isRemotelyAccessible() によって処理は分岐する、と考えておいて良い
  • ここでしばしば紹介される minCandidates パラメータが登場する。コードを読む限り、これ、「Split を処理する Node の候補をいくつ選ぶか」というだけであるっぽい。
  • 少なくとも minCandidates の数だけ Node を選び、その中から現在持っているタスクが少ない Node を選んでいるのである。
  • だから、 minCandidates は別に並列度とは関係ないわけで、結果的にパフォーマンスに寄与するかどうかは微妙な感じもある。
  • "max number of workers to run a stage in parallel (default: 10) " という説明は誤りなのではないか、という話。
  • この minCandidates が node-scheduler.min-candidates であることも確認済みである。
  • 指摘もあったが誰も反応していない https://groups.google.com/forum/#!msg/presto-users/Ft71bkwElkQ/v85ROXC82hIJ
@tobert
tobert / 0000README.md
Last active January 31, 2022 15:22
G1GC / CMS

G1GC v.s. CMS for Cassandra 2.0

Many people have asked me about using the G1 garbage collector with Cassandra. Since most of my customers are running 2.0 in production the test is with 2.0 for now. Once I script it up I'll re-run the numbers with 2.1.

I also need to re-test with Java 7 and the Oracle JDKs.

TL;DR

@ChuckJHardy
ChuckJHardy / example_activejob.rb
Last active March 12, 2025 21:24
Example ActiveJob with RSpec Tests
class MyJob < ActiveJob::Base
queue_as :urgent
rescue_from(NoResultsError) do
retry_job wait: 5.minutes, queue: :default
end
def perform(*args)
MyService.call(*args)
end
@cherti
cherti / alert.sh
Created December 9, 2016 13:47
send a dummy alert to prometheus-alertmanager
#!/bin/bash
name=$RANDOM
url='http://localhost:9093/api/v1/alerts'
echo "firing up alert $name"
# change url o
curl -XPOST $url -d "[{
\"status\": \"firing\",