Skip to content

Instantly share code, notes, and snippets.

View systra's full-sized avatar

Andrzej Trawiński systra

  • jTendo
  • Warsaw, Poland
View GitHub Profile
@systra
systra / snow.rb
Created December 18, 2013 08:09
OSX: "Let it snow" in the terminal
ruby -e 'C=`stty size`.scan(/\d+/)[1].to_i;S=["2743".to_i(16)].pack("U*");a={};puts "\033[2J";loop{a[rand(C)]=0;a.each{|x,o|;a[x]+=1;print "\033[#{o};#{x}H \033[#{a[x]};#{x}H#{S} \033[0;0H"};$stdout.flush;sleep 0.1}'
@systra
systra / dbcleanup.sh
Created December 8, 2013 21:35
CouchDB cleanup - remove old documents (shell method)
#!/bin/bash
# source: http://bravenewmethod.com/2012/05/31/couchdb-cleanup-script-for-purging-old-docs/
# but modified to get rid of node.js dependency
# if database needs auth:
# DBHOST=user:pass@hostname
DBHOST=localhost
PORT=5984
#!/bin/bash
# How to install Graphite as a user on CentOS 5.5 (with neither internet access and root account)
# --------------------------------------------------------------------------------
# Tomasz Kalkosiński - refaktor.blogspot.com
#
# Graphite is a Scalable Realtime Graphing (http://graphite.wikidot.com/)
# This script is based on two excellent tutorials:
# http://community.webfaction.com/questions/10038/how-to-install-pycairo-in-python27-thanks
@systra
systra / graphite.md
Created September 20, 2013 11:58 — forked from caged/graphite.md

This is a general overview (from memory) of the steps I used to install graphite (http://graphite.wikidot.com) on OS X Lion. I think the steps are in order but YMMV. Please fork and fix if you find an error.

Install Python 2.7.2

brew install python

Check your env

$ python --version
@systra
systra / build.conf
Created June 11, 2013 05:45
Seagull build configuration file for OS X (Darwin). Tested on 10.8.4. Disabled support for TCAP, SCTP, CRYPTO, TLS
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
@systra
systra / opts_utils.erl
Created November 24, 2011 10:22
Options merge
-module(opts_utils).
-export([merge_opts/2]).
%% Sample use:
%% Defaults = [{host,"localhost"},
%% {password, []},
%% {port,5432},
%% {password,[]},
%% {username,"test"},