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
@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.
*
@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
#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)); \
@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)
#
@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
@davidjrice
davidjrice / README.md
Created June 14, 2012 21:53
New Relic Instrumentation for Couchbase Ruby
  • Install & Setup New Relic
  • cd my_rails_project/config/initializers
  • wget http://raw.github.com/gist/2933202/5adcf11839c0ef2064a5f0c6e0fe795d9ed2c60a/couchbase_new_relic_instrumentation.rb
  • git add and deploy as usual!

Couchbase New Relic Instrumentation

@davidjrice
davidjrice / README.md
Created June 6, 2012 17:00
Vagrantfile for an Ubuntu lucid 32 or 64 bit VM with couchbase 2.0.0.dp4.1

Install Virtualbox

wget http://download.virtualbox.org/virtualbox/4.1.16/VirtualBox-4.1.16-78094-OSX.dmg
open VirtualBox-4.1.16-78094-OSX.dmg
# double click .pkg to install

Install vagrant

gem install vagrant --no-ri --no-rdoc
@avsej
avsej / .xinitrc
Created May 10, 2012 10:42
.xinitrc
#!/bin/sh
xset -b # disable bell
eval `/usr/bin/ssh-agent`
urxvtd &
wmname LG3D
GSDPID=`pidof gnome-settings-daemon`
if [ "x$GSDPID" == "x" ]; then
gnome-settings-daemon &
@avsej
avsej / .tmux.conf
Created May 10, 2012 06:26
My .tmux.conf
unbind C-b
set -g prefix C-t
### KEY BINDINGS
# first unbind, then bind: this allows on-the-fly config reloading (with C-r)
# quick tip: the '-r' flag means they can be pressed repeatedly
# note: I only added the shortcuts I use, please "man tmux" to go beyond
# find a window by name
unbind f
@avsej
avsej / gist:2345830
Created April 9, 2012 19:20
nginx config for thin
upstream thin_cluster {
server unix:/var/run/thin.0.sock;
server unix:/var/run/thin.1.sock;
server unix:/var/run/thin.2.sock;
}
server {
server_name squish.demo.couchbase.com;
root /home/couchbase/couchbase-squish/public;