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
@avsej
avsej / .tclshrc
Created July 5, 2012 09:24
My .tclshrc
# vim:ft=tcl:
# GistID: 3052537
#
# apt-get install tcl-signal
if {$tcl_interactive} {
package require Signal
signal add SIGINT {}
if [info exists env(DISPLAY)] {
set env(TERM) xterm-color
@mikhailov
mikhailov / 0. nginx_setup.sh
Last active April 2, 2024 14:57
NGINX+SPDY with Unicorn. True Zero-Downtime unless migrations. Best practices.
# Nginx+Unicorn best-practices congifuration guide. Heartbleed fixed.
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies.
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module
#
# Deployment structure
#
# SERVER:
# /etc/init.d/nginx (1. nginx)
# /home/app/public_html/app_production/current (Capistrano directory)
#
#define pp_ev_allow_revent(l, e, revt_) \
if ( ( (e)->events & revt_) != revt_ ) { \
ev_io_stop(l, (e)); \
ev_io_set( (e), (e)->fd, (e)->events | revt_); \
ev_io_start(l, (e)); \
}
#define pp_ev_ignore_revent(l, e, revt_) \
if ((e)->events & revt_) { \
ev_io_stop(l, (e)); \
@avsej
avsej / git-fetch-patches.tcl
Created August 8, 2012 09:55
This script helps to avoid switching to browser to fetch fresh patchsets from gerrit
#!/usr/bin/env tclsh
# GistID: 3293907
#
# USAGE:
#
# 1. put somewhere in the PATH
# 2. ensure that repository has remote with name 'gerrit'
# 3. execute 'git fetch-patches'
package require json
@mnunberg
mnunberg / 6bit.c
Created August 13, 2012 08:21
couchbase flags proposals
/**
*
*/
/**
* Couchbase Datatype Flags
*
* These flags help to disambiguate the format and compression of values.
*
@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
@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"];
@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 / 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
*
@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