Estimating user lifetimes with PyMC - Corrected code

I was trying to follow this post, but github gists miss few variables, correct code shall be:

import pymc as mc
import numpy as np

N=20

#create some artificial data, like the data in the figure above.
lifetime = mc.rweibull( 2, 5, size = N )
birth = mc.runiform(0, 10 ...
more ...

Change of database: Percona Mysql to Postrgres for django

Colleague of mine came with strange bug:

  1. I am opening python shell, and sending request User.objects.all()

It returns valid information

* then i'm adding user via web site

* then i send request User.objects.all() again and new user is missing. If i will reopen shell then everything ...

more ...

Monitoring rabbitmq server 2.5.1. with monit

Simple task like setting up monitoring with monit for rabbit mq include two parts:

  1. As discussed here Modify /etc/init.d/rabbitmq-server
The following are added to the start
function:
    pid=`/usr/sbin/rabbitmqctl status | perl -n -e'/{pid,(\d+)/ && print $1'`
    echo $pid > /var/run/rabbitmq.pid
    Right before ...
more ...

Django optimisation in production

Few days ago I realised that my django installation in production started producing too many memory errors - thanks to monit memory alerts were filling my mailbox without any serious service interruption. But hundreds email messages daily annoyed me enough to look deeper into trouble.

1) I switched on django debug ...

more ...

Secure Riak installation using n2n VPN

Recently, I decided to have a closer look at Riak non-sql database, but found out that unlike CouchDB riak doesn't have a HTTP basic auth implemented, or any other way of defining secure access to database.

I have three servers to build a cluster, but I feel very uneasy ...

more ...


Useful JavaScript one-liner for couchdb

I found myself using more and more of this one-liner for working with couchdb database:

var getNewDatabusUUID = JSON.parse($.ajax({ type: "GET", url: "/_uuids/",                async: false }).responseText);  $.log("New uuid generated " + getNewDatabusUUID.uuids);

this example retrieves new uuids from couchdb, but I was using it to retrieve _rev of the ...

more ...

Checkbox and select elements in couch db

If you wanted to make a select or checkbox element using mustache in couch db and trying to find example, here it is:

I am using couchdb so in shows, album-edit.js, I want a dropdown menu for group variable in couchdb.

var Mustache = require("vendor/couchapp/lib/mustache");  var ...

more ...

Technical questions which are not valid in the absence of context

Recently I was asked the number of technical questions which I nearly failed to answer, not because I don't now the answer, but because I believe such questions require more information about the context. There is a common assumption about the default mind frame with MS windows and C ...

more ...

Chef cookbook for xtreemfs deployment

I just pushed xtreemfs cookbook to my git repo

This cookbook automates xtreemfs quick start for ubuntu 10.04.

I am using it with vagrant:

config.vm.define : xtreemfs do |xtreemfs_config|     xtreemfs_config.vm.box="base"    xtreemfs_config.vm.provisioner=:chef_solo    xtreemfs_config.vm.forward_port("ssh", 22, 2227,:auto => true)       xtreemfs_config.vm.forward_port ...

more ...

Good way to ad apt repository using chef - from hadoop cookbook

I found an interesting way of adding apt repository in hadoop cookbook:

execute "apt-get update" do  action :nothingendtemplate "/etc/apt/sources.list.d/cloudera.list" do  owner "root"  mode "0644"  source "cloudera.list.erb"  notifies :run, resources("execute[apt-get update]"), :immediatelyendexecute "curl -s http://archive.cloudera.com/debian/archive.key ...

more ...


Compliting redis 2.0.3 on mac os leopard with ppc

Just notes to myself:

redis.c line 10897

#if defined(__FreeBSD__)    return (void*) uc->uc_mcontext.mc_eip;#elif defined(__dietlibc__)    return (void*) uc->uc_mcontext.eip;#elif defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_6)  #if __x86_64__    return (void*) uc->uc_mcontext->__ss.__rip; #elif defined (__i386__)      return (void*) uc->uc_mcontext->__ss.__eip;  #else    return (void*) uc- ...

more ...

Wordpress deployment on the live server using chef (and vagrant)

When I decided to move from movable type to wordpress, I wasn't quite happy with default wordpress cookbook. I also had an offer to have a cheap dedicated server instead of VPS, so I decided to test two things simultaneously:

* Preparation of new live server using fabric

* Deployment of ...

more ...

Upgrading to Movable Type 5 using chef and vagrant

As a long time perl developer, I have admired Movable Type (mt). So recently I decided to upgrade to MT5. In the end I decided to move from movable type to wordpress, but this is my notes:

First I took chef's cookbook from wordpress and modified it so it ...

more ...


Cloud computing security, common questions and my answers

I have a several friends, who have a great product ideas, based on complex scientific algorithms. Each time when I suggest using cloud computing for developing product we go through a round of questions. I will put them down here, so I can reference it.

If you want to make ...

more ...