start new:
tmux
start new with session name:
tmux new -s myname
#!/bin/bash | |
# | |
# /etc/rc.d/init.d/mms-agent | |
# | |
# 10Gen Mongod montiroing service | |
# must edit the settings.py first and edit this file with the location of agent.py | |
# | |
# description: 10Gen monitoring service - need ot fix pid so we can shut it down | |
# chkconfig: - 90 10 |
// derived from http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Parallel_algorithm | |
function map() { | |
emit(1, // Or put a GROUP BY key here | |
{sum: this.value, // the field you want stats for | |
min: this.value, | |
max: this.value, | |
count:1, | |
diff: 0, // M2,n: sum((val-mean)^2) | |
}); |
public class Analytics | |
{ | |
// Tracker version. | |
private const string Version = "4.4sa"; | |
private const string CookieName = "__utmmobile"; | |
// The path the cookie will be available to, edit this to use a different | |
// cookie path. | |
private const string CookiePath = "/"; |
#!/usr/bin/env python | |
# Written with pymongo-3.3 | |
author__ = 'mongolab' \ | |
import pymongo | |
import sys, datetime, time | |
import random |
#GDG Android in Berlin brainstorming session
On November 27, 2013 I was asking the brilliant Android developers at GDG Android in Berlin for their favorite libraries that make their lives easier and should be included in every newly developed app.
This is the list of libraries we collected during this 10 minute session.
# Based on http://techspot.zzzeek.org/2011/01/14/the-enum-recipe/ | |
import six | |
from sqlalchemy.dialects import postgresql | |
from sqlalchemy.types import SchemaType, TypeDecorator, Enum | |
from sqlalchemy import __version__, text, cast | |
import re | |
if __version__ < '0.6.5': | |
raise NotImplementedError("Version 0.6.5 or higher of SQLAlchemy is required.") |
I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).
Use ssh keys and define host aliases in ssh config file (each alias for an account).
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Use mycli (http://mycli.net/) through ssh | |
Usage: | |
$ mycli-ssh yourhost [extra args passed to mycli] | |
""" |