Skip to content

Instantly share code, notes, and snippets.

@kpy3
kpy3 / .kerlrc
Last active May 20, 2019 16:46
Make kerl happy on macOS with clang
# More info: https://github.com/neovim/neovim/issues/9050#issuecomment-429674155
export SDKROOT=`xcrun --show-sdk-path`
export CC=clang CXX=clang CFLAGS="-g -O3"
KERL_USE_AUTOCONF=no
KERL_CONFIGURE_OPTIONS="--with-ssl=`brew --prefix openssl` --enable-vm-probes --enable-dirty-schedulers --enable-kernel-poll --enable-esock --with-dynamic-trace=dtrace --without-javac --disable-hipe --disable-native-libs --without-odbc --enable-threads --disable-sctp --enable-smp-support"
KERL_BUILD_DOCS=no
KERL_INSTALL_MANPAGES=yes
KERL_INSTALL_HTMLDOCS=no
KERL_ENABLE_PROMPT=yes
KERL_PROMPT_FORMAT="%F{red}[erl:%BUILDNAME%]%f "
@kpy3
kpy3 / service-checklist.md
Created April 6, 2019 17:25 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@kpy3
kpy3 / # llvm - 2018-10-05_22-26-11.txt
Created October 6, 2018 09:24
llvm on macOS 10.14 - Homebrew build logs
Homebrew build logs for llvm on macOS 10.14
Build date: 2018-10-05 22:26:11

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

@kpy3
kpy3 / setupdb.md
Created March 30, 2018 22:16 — forked from danisfermi/setupdb.md
Setup gdb on Mac OS Sierra/High Sierra

Here are the steps to installing and setting up GDB on Mac OS Sierra/High Sierra. Run brew install gdb. On starting gdb, you will get the following error:

Unable to find Mach task port for process-id 2133: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))

To fix this error, follow the following steps:

@kpy3
kpy3 / sysctl.conf
Created March 25, 2018 20:02 — forked from kfox/sysctl.conf
Linux kernel tuning settings for large number of concurrent clients
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0
@kpy3
kpy3 / timetop.erl
Created January 18, 2018 16:37 — forked from stolen/timetop.erl
top processes by scheduled time
-module(timetop).
-export([top/2]).
top(Duration, Count) ->
OldPrio = erlang:process_flag(priority, high),
Result = scheduled_time_top(Duration),
erlang:process_flag(priority, OldPrio),
lists:sublist(Result, Count).
@kpy3
kpy3 / gist:5aeeec0dc461be1294b1cfcb4a080c52
Created December 4, 2017 11:17 — forked from debasishg/gist:8172796
A collection of links for streaming algorithms and data structures
  1. General Background and Overview
extern crate hyper;
use std::io;
use hyper::Client;
use hyper::header::Connection;
#[test]
fn it_works() {
let client = Client::new();
1) see re: increasing shmmax http://stackoverflow.com/a/10629164/1283020
2) add to postgresql.conf:
shared_preload_libraries = 'pg_stat_statements' # (change requires restart)
136 pg_stat_statements.max = 1000
137 pg_stat_statements.track = all
3) restart postgres
4) check it out in psql