Skip to content

Instantly share code, notes, and snippets.

View dekobon's full-sized avatar

Elijah Zupancic dekobon

View GitHub Profile
@isaacdavis
isaacdavis / instructions.md
Last active March 28, 2019 00:05
Muskie log-fetching instructions

Retrieving muskie logs

These instructions are adapted from the comprehensive Manta Debugging Guide, with added clarification. See the debugging guide for more information on everything related to log-based debugging.

Log locations

Each zone maintains a log file for the current hour (a real-time log) at /var/log/muskie.log. At the top of every hour, the past hour's log file (now a historical log) is uploaded to the datacenter's manta at /poseidon/stor/logs/COMPONENT/YYYY/MM/DD/HH/SHORTZONE.log, where:

  • COMPONENT varies based on the component you’re looking for
  • YYYY, MM, DD, and HH represent the year, month, day, and hour for the entries in the log file
  • SHORTZONE is the first 8 characters of the zone’s uuid.
@alex-leonhardt
alex-leonhardt / main.go
Last active March 9, 2024 04:23
golang text/template with a map[string]interface{} populated from mixed json data
package main
import (
"encoding/json"
"os"
"reflect"
"text/template"
)
@cinsk
cinsk / java-flamegraph.sh
Created January 25, 2018 00:52
Generate flame graphs of JVM, JAVA
#!/bin/bash
# SJK tool need to run as the same user of the target process.
USER=
PID=
INTERVAL=10ms
PROGRAM_NAME=$(basename $0)
error() {

Thread Pools

Thread pools on the JVM should usually be divided into the following three categories:

  1. CPU-bound
  2. Blocking IO
  3. Non-blocking IO polling

Each of these categories has a different optimal configuration and usage pattern.

@sirsquidness
sirsquidness / proxy.conf
Created September 22, 2016 12:42
How to have nginx proxy_pass follow upstream 302 redirects (eg, when you're running a steam cache and you're behind Cox's layer 7 interception stuff)
# This config came around after a friend had problems with a Steam cache on his
# Cox internet connection. Cox would intercept any requests to Steam content
# servers and return a 302 to Cox's servers. The cache would return the 302
# to the Steam client, and the Steam client would go directly to Cox, bypassing
# the cache.
# This config makes nginx follow the 302 itself, and caches the result of the
# redirect as if it was the response to the original request. So subsequent
# requests to the URL that returned a 302 will get the file instead of a 302.
#!/bin/bash
set -eu
_UID=$(id -u)
GID=$(id -g)
# give lxd permission to map your user/group id through
grep root:$_UID:1 /etc/subuid -qs || sudo usermod --add-subuids ${_UID}-${_UID} --add-subgids ${GID}-${GID} root
# set up a separate key to make sure we can log in automatically via ssh
# with $HOME mounted
@dekobon
dekobon / mdb.md
Last active August 29, 2015 14:20 — forked from tjfontaine/mdb.md

MDB is unlike most debuggers you've experienced.

It is not a source level debugger like gdb or lldb or even Node's builtin debugger

Generally used for postmortem analysis.

Postmortem is for Production and Development

We operate mostly on core files, though you can attach to running processes as well.

@denji
denji / nginx-tuning.md
Last active May 3, 2024 03:57
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@dhrp
dhrp / docker
Created June 8, 2013 02:15
this is the docker ascii logo
Docker logo
## .
## ## ## ==
## ## ## ## ===
/""""""""""""""""\___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~
\______ o __/
\ \ __/