Skip to content

Instantly share code, notes, and snippets.

@minhchuduc
minhchuduc / hello_mesos.py
Created April 13, 2016 01:59 — forked from porterjamesj/hello_mesos.py
the tiniest mesos scheduler
import logging
import uuid
import time
from mesos.interface import Scheduler
from mesos.native import MesosSchedulerDriver
from mesos.interface import mesos_pb2
logging.basicConfig(level=logging.INFO)
@minhchuduc
minhchuduc / tmux-cheatsheet.markdown
Created March 22, 2016 08:39 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@minhchuduc
minhchuduc / screen.md
Created March 18, 2016 09:17
Running Screen on CoreOS

Set up screen

  1. docker run --detach --interactive --tty --privileged --net=host fedora /bin/bash
  2. docker attach $CONTAINER_ID
  3. yum install screen

Create screen session

  1. docker attach $CONTAINER_ID
  2. screen -S test
  3. Detach from screen
@minhchuduc
minhchuduc / kubecon_proposal.md
Created March 15, 2016 10:04 — forked from jimmycuadra/kubecon_proposal.md
KubeCon proposal: Deploying Kubernetes Clusters with Terraform and CoreOS

Deploying Kubernetes Clusters with Terraform and CoreOS

Kubernetes is complex software and setting up a new cluster can be difficult. While there are easy approaches like Google Container Engine, you may want to customize your cluster in various ways, or simply understand how it all works. A great way to do this is to define your cluster as code using Terraform. In this talk, you'll learn how to use Terraform to deploy Kubernetes on CoreOS and EC2.

Takeaway

Terraform and CoreOS are a great combination for deploying Kubernetes clusters.

Abstract

@minhchuduc
minhchuduc / README.md
Created March 7, 2016 09:44 — forked from rantav/README.md
Find slow queries in mongo DB

A few show tricks to find slow queries in mongodb

Enable profiling

First, you have to enable profiling

> db.setProfilingLevel(1)

Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...

@minhchuduc
minhchuduc / setup.md
Created January 23, 2016 15:26 — forked from xrstf/setup.md
Nutch 2.3 + ElasticSearch 1.4 + HBase 0.94 Setup

Info

This guide sets up a non-clustered Nutch crawler, which stores its data via HBase. We will not learn how to setup Hadoop et al., but just the bare minimum to crawl and index websites on a single machine.

Terms

  • Nutch - the crawler (fetches and parses websites)
  • HBase - filesystem storage for Nutch (Hadoop component, basically)
@minhchuduc
minhchuduc / getpass.sh
Last active December 22, 2015 15:29 — forked from vishvananda/getpass.sh
#!/usr/bin/env bash
if [ $# -eq 0 ]; then
DEFAULT_USER=clouduser
else
DEFAULT_USER=$1
fi
echo $DEFAULT_USER
if [ -f /bin/tempfile ]; then # is Ubuntu/Debian
SSH_KEYFILE=`tempfile`