Skip to content

Instantly share code, notes, and snippets.

View avsej's full-sized avatar
🛋️
On the couch

Sergey Avseyev avsej

🛋️
On the couch
View GitHub Profile
@studzien
studzien / beam.md
Created September 9, 2015 11:38
An example analysis of a BEAM process core dump

This post shows an example of a BEAM process' core dump analysis to backtrack what was the root cause of its crash.

Start gdb by pointing out the BEAM executable that generated the core dump and the core dump file. Optionally, you can provide a directory with the VM's source code:

gdb erts-6.3/bin/beam.smp -core core.14747 -d /home/azureuser/otp_src_17.4/erts/emulator

gdb should tell you what caused the crash and where in code this happened:

Properties systemProperties = System.getProperties();
systemProperties.put("net.spy.log.LoggerImpl", "net.spy.memcached.compat.log.SunLogger");
System.setProperties(systemProperties);
Logger logger = Logger.getLogger("com.couchbase.client");
logger.setLevel(Level.FINEST);
for(Handler h : logger.getParent().getHandlers()) {
if(h instanceof ConsoleHandler){
h.setLevel(Level.FINEST);
}
@avsej
avsej / 2.7.5-dbg
Created September 2, 2013 11:49
Install python 2.7.5 with debug symbols
require_gcc
export CFLAGS='-Wall -Wextra -O0 -ggdb3'
export CPPFLAGS=$CFLAGS
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
export CONFIGURE_OPTS='--with-pydebug'
install_package "Python-2.7.5" "http://www.python.org/ftp/python/2.7.5/Python-2.7.5.tgz#b4f01a1d0ba0b46b05c73b2ac909b1df" standard verify_py27
unset CONFIGURE_OPTS
install_package "setuptools-1.1" "https://pypi.python.org/packages/source/s/setuptools/setuptools-1.1.tar.gz#84062633c3818c912af76d54a40d11a7" python
install_package "pip-1.4.1" "https://pypi.python.org/packages/source/p/pip/pip-1.4.1.tar.gz#6afbb46aeb48abac658d4df742bff714" python
@somebody32
somebody32 / gist:5232120
Last active October 4, 2022 08:19
Список литературы для ознакомления с concurrent programming и реализацией этих принципов и подходов на ruby. Огромное спасибо @brainopia за составление.

Введение

Начать стоит отсюда. Не пугайтесь то, что это книга по незнакомой OS, эти термины практически везде одинаковые и здесь они изложены в понятной для начинающих форме.

http://www.qnx.com/developers/docs/6.4.1/neutrino/getting_started/s1_procs.html

Прочесть нужно треть главы до подраздела "Starting a process", если С не пугает, читайте полностью. После прочтения вы будете понимать, что такое process, thread, mutex, priorites, semaphores, scheduler, contex-switch, kernel states.

Ruby

@avsej
avsej / package-release.rb
Created March 4, 2013 06:59
Ruby helper to bundle release artifacts
#!/usr/bin/env ruby
require 'fileutils'
include FileUtils
version = "2.0.4"
distributions = [
{:type => :deb, :ver => "10.04", :arch => ["i386", "amd64"], :channel => "lucid"},
{:type => :deb, :ver => "11.10", :arch => ["i386", "amd64"], :channel => "oneiric"},
{:type => :deb, :ver => "12.04", :arch => ["i386", "amd64"], :channel => "precise"},
@ingenthr
ingenthr / raiseTimeouts.sh
Created February 26, 2013 07:56
raising timeouts on ns_server in couchbase
set -xe
server=192.168.1.200
curl --data "ns_config:set({node, node(),{timeout, ns_memcached_outer}},300000)." -u Administrator:password http://$server:8091/diag/eval
curl --data "ns_config:set({node, node(),{timeout, memcached_recv}},300000)." -u Administrator:password http://$server:8091/diag/eval
curl --data "ns_config:set({node, node(),{timeout, memcached_stats_recv}},300000)." -u Administrator:password http://$server:8091/diag/eval
curl --data "ns_config:set({node, node(),{timeout, ns_memcached_outer_heavy}},300000)." -u Administrator:password http://$server:8091/diag/eval
curl --data "ns_config:set({node, node(),{timeout, ns_memcached_outer_very_heavy}},600000)." -u Administrator:password http://$server:8091/diag/eval
curl --data "ns_config:set({node, node(),{timeout, ebucketmigrator_connect}},1200000)." -u Administrator:password http://$server:8091/diag/eval
@avsej
avsej / test.c
Created January 24, 2013 12:38
Super minimal couchbase client in C
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/* GistID: 4621066
*/
/*
* Copyright 2013 Couchbase, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@avsej
avsej / gist:4044766
Created November 9, 2012 09:29
Interesting Timezones
LOCALTIME=$(date +%Y-%m-%dT%H:%M)
AMERICA=$(TZ=America/Los_Angeles date +%H:%M%Z)
CET=$(TZ=Europe/Oslo date +%H:%M%Z)
ART=$(TZ=America/Buenos_Aires date +%H:%M%Z)
xsetroot -name "$WIFI $LOCALTIME $AMERICA $CET $ART"
@avsej
avsej / packages.dot
Created November 1, 2012 20:42
dot -Tpng packages.dot > packages.png
digraph libcouchbase {
"libcouchbase2-all" -> "libcouchbase-bin" [label = "provided by"];
"libcouchbase2" -> "libcouchbase2-core" [label = "depends on"];
"libcouchbase2" -> "libcouchbase2-backend" [label = "depends on"];
"libcouchbase2-backend" -> "libcouchbase2-libevent" [label = "provided by"];
"libcouchbase2-backend" -> "libcouchbase2-libev" [label = "provided by"];
"libcouchbase-bin" -> "libcouchbase2" [label = "depends on"];
"libcouchbase-dbg" -> "libcouchbase2-core" [label = "depends on"];
"libcouchbase-dev" -> "libcouchbase2-core" [label = "depends on"];
"libcouchbase-libev-dev" -> "libcouchbase2-libev" [label = "depends on"];
@0x000000
0x000000 / gist:3852426
Created October 8, 2012 13:07
Список ссылок для RubyGardens
=== Часть 1. Обзорная информация
== Обязательно посмотрите
http://en.wikipedia.org/wiki/Internet_media_type
http://en.wikipedia.org/wiki/List_of_HTTP_status_codes или http://www.flickr.com/photos/girliemac/sets/72157628409467125
http://api.rubyonrails.org/classes/ActionDispatch/Response.html
http://api.rubyonrails.org/classes/ActionDispatch/Request.html
== Документация по AJAX в jQuery