Skip to content

Instantly share code, notes, and snippets.

<link rel="alternate" type="application/rss+xml" href="http://candybox2.net/blog/rss.xml" title="candybox2 blog RSS" />
@krasnoukhov
krasnoukhov / config
Created November 4, 2013 20:54
Proper ssh config
# Make it so ssh-ing from one server to another passes keys around automagically
Host *
ForwardAgent yes
# Get rid of SSH connection delays
GSSAPIAuthentication no
# Stop timing out connections
ServerAliveInterval 300
ServerAliveCountMax 20
upstream balancer {
server app01.yoursite.com:3500 weight=1 max_fails=3;
server app02.yoursite.com:3500 weight=1 max_fails=3;
server app03.yoursite.com:3500 weight=1 max_fails=3;
}
server {
listen 80 default_server;
# Location of our static files
@krasnoukhov
krasnoukhov / heap.json
Last active January 21, 2016 15:17
ObjectSpace.dump_all output
{"address":"0x7f8b8df20628", "type":"STRING", "class":"0x7f8b8a029668", "frozen":true, "embedded":true, "fstring":true, "bytesize":3, "value":"=5F", "encoding":"UTF-8", "flags":{"wb_protected":true, "old":true, "marked":true}}
{"address":"0x7f8b8df20650", "type":"STRING", "class":"0x7f8b8a029668", "frozen":true, "embedded":true, "fstring":true, "bytesize":3, "value":"=3F", "encoding":"UTF-8", "flags":{"wb_protected":true, "old":true, "marked":true}}
{"address":"0x7f8b8df20678", "type":"STRING", "class":"0x7f8b8a029668", "frozen":true, "embedded":true, "fstring":true, "bytesize":3, "value":"=29", "encoding":"UTF-8", "flags":{"wb_protected":true, "old":true, "marked":true}}
{"address":"0x7f8b8df206a0", "type":"STRING", "class":"0x7f8b8a029668", "frozen":true, "embedded":true, "fstring":true, "bytesize":3, "value":"=28", "encoding":"UTF-8", "flags":{"wb_protected":true, "old":true, "marked":true}}
{"address":"0x7f8b8df206c8", "type":"STRING", "class":"0x7f8b8a029668", "frozen":true, "embedded":true, "fstring":tr
@krasnoukhov
krasnoukhov / Gemfile
Last active August 29, 2015 13:57
NPR playlist downloader
source "https://rubygems.org"
gem "ox"
gem "mp3info"
@krasnoukhov
krasnoukhov / Gemfile
Created April 10, 2014 12:53
sidekiq-middleware and jruby
source "https://rubygems.org"
gem "sidekiq", "~> 2.17.0"
gem "sidekiq-middleware"
@krasnoukhov
krasnoukhov / nginx.log
Created July 23, 2014 14:39
Just posted link on Twitter
46.236.26.102 - - [23/Jul/2014:07:34:16 -0700] "join.hired.com" "GET /x/3WavgA HTTP/1.1" 200 9286 "-" "-" "-" 0.116 0.116 "-"
54.246.137.243 - - [23/Jul/2014:07:34:16 -0700] "join.hired.com" "HEAD /x/3WavgA HTTP/1.1" 200 0 "-" "python-requests/1.2.3 CPython/2.7.2+ Linux/3.0.0-16-virtual" "-" 0.147 0.147 "-"
216.46.190.188 - - [23/Jul/2014:07:34:17 -0700] "join.hired.com" "HEAD /x/3WavgA HTTP/1.1" 200 0 "-" "Google-HTTP-Java-Client/1.17.0-rc (gzip)" "-" 0.127 0.127 "-"
74.112.131.243 - - [23/Jul/2014:07:35:17 -0700] "join.hired.com" "GET /x/3WavgA HTTP/1.1" 200 9284 "-" "Mozilla/5.0 ()" "-" 0.117 0.117 "-"
74.112.131.243 - - [23/Jul/2014:07:36:21 -0700] "join.hired.com" "GET /x/3WavgA HTTP/1.1" 200 9283 "-" "Mozilla/5.0 ()" "-" 0.196 0.196 "-"
185.20.4.220 - - [23/Jul/2014:07:34:16 -0700] "join.hired.com" "GET /x/3WavgA HTTP/1.1" 200 27017 "-" "Mozilla/5.0 (compatible; TweetmemeBot/3.0; +http://tweetmeme.com/)" "-" 0.086 0.086 "-"
199.59.148.209 - - [23/Jul/2014:07:34:16 -0700] "join.hired.com" "GET /x/3WavgA
@krasnoukhov
krasnoukhov / intra
Created July 30, 2014 13:04
memcached
$ time telnet memcached.theoldreader.intra 11211 | echo quit
quit
real 0m5.026s
user 0m0.015s
sys 0m0.007s

Baruco 2014 talks

mruby: AltRuby

by YUKIHIRO MATSUMOTO (Twitter)

Standard Library, Uncommon Uses

by PIOTR SZOTKOWSKI (Twitter)

Slides

@krasnoukhov
krasnoukhov / coffee.md
Created October 2, 2014 11:20
Brewing filtered coffee (essay)

Brewing filtered coffee

It's no secret there are a lot of ways of brewing a cup of delicious coffee. Basically, coffee can be prepared through the boiling, steeping, filtration or by using the pressure. I find filter-based brewing the most convenient in terms of operational simplicity and resulting flavour, so let's see how exactly it can be prepared.

The common idea between different filter brewing methods is that water is poured into the pot through the grained beans, and filter helps to restrain beans from getting into it. However, there are things that may vary, such as water temperature, beans grind level and the design of coffee pot itself.