Skip to content

Instantly share code, notes, and snippets.

View keylase's full-sized avatar
💭
hmmm, status

Keylase keylase

💭
hmmm, status
  • Tashkent
View GitHub Profile
@keylase
keylase / GitHub-Project-Guidelines.md
Created November 26, 2018 09:22 — forked from rsp/GitHub-Project-Guidelines.md
Strict Flow and GitHub Project Guidelines - setup rules and git flow for commercial and open-source projects by @rsp

Strict Flow and GitHub Project Guidelines

Or how to turn this:

into this:

@keylase
keylase / dump.sh
Created January 18, 2017 10:31 — forked from alanning/dump.sh
Backup script that dumps a mongo database and compresses the result. Can be run on-demand or via nightly cron job.
#!/bin/bash
# Performs a dump of target database and compresses result.
# Outputs to: $DUMPDIR/$DUMPNAME.tar.xz
# Note: Absolute paths are required for use in cron jobs
DBNAME=meteor
ROOTDIR=/Users/alanning/foo
DUMPDIR=$ROOTDIR/dumps
@keylase
keylase / openresty-ubuntu-install.sh
Created January 13, 2017 07:48 — forked from alex-roman/openresty-ubuntu-install.sh
Easy install openresty (used and tested on Ubuntu 14.04, 15.10 and 16.04)
#!/bin/bash
apt-get -y update
apt-get -y install nginx-extras build-essential libpcre3-dev libssl-dev libgeoip-dev libpq-dev libxslt1-dev libgd2-xpm-dev
wget -c https://openresty.org/download/openresty-1.9.15.1.tar.gz
tar zxvf openresty-1.9.15.1.tar.gz
cd openresty-1.9.15.1
./configure \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
@keylase
keylase / gist:f0028f21bc189a5479c9a8637cd3c706
Created September 8, 2016 11:08 — forked from clyang/gist:3231e507d90a161010a2
Multipath TCP kernel on DigitalOcean droplet (Ubuntu 14.04)
(all instruction need root permission)
0. Create a droplet with Ubuntu 14.04 image
1. wget -q -O - http://multipath-tcp.org/mptcp.gpg.key | sudo apt-key add -
2. vim /etc/apt/sources.list.d/mptcp.list , add line:
deb http://multipath-tcp.org/repos/apt/debian trusty main
3. apt-get update && apt-get install linux-mptcp
@keylase
keylase / MONGO-PROFILING.md
Last active August 26, 2016 05:14 — 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...

@keylase
keylase / treesize.sh
Created August 5, 2016 08:58 — forked from jesse1981/treesize.sh
Bash Script for viewing folder sizes. Just put this code into a file /bin/treesize and make it executable. Then any system user can get a list of directory sizes within a directory by just running treesize from any directory.
#/bin/sh
du -k --max-depth=1 | sort -nr | awk '
BEGIN {
split("KB,MB,GB,TB", Units, ",");
}
{
u = 1;
while ($1 >= 1024) {
$1 = $1 / 1024;
u += 1