Skip to content

Instantly share code, notes, and snippets.

@cmabastar
cmabastar / gist:509984d47e648c8dbebf
Created June 11, 2014 02:09
AWS NAT instance traffic analyzer.
tcpdump -nr /tmp/dump.log | awk '{print $3"\t"$5}' | grep -v "ICMP" | sort | uniq -c | sort -nr | head -n 10

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@cmabastar
cmabastar / .pgsqlrc
Created October 28, 2015 03:01
cool psql settings
\set COMP_KEYWORD_CASE upper
\x auto
\pset null ¤
#!/bin/bash
# ssh-multi
# D.Kovalov
# Based on http://linuxpixies.blogspot.jp/2011/06/tmux-copy-mode-and-how-to-control.html
# a script to ssh multiple servers over multiple tmux panes
starttmux() {
if [ -z "$HOSTS" ]; then
#!/bin/bash
# ssh-multi
# D.Kovalov
# Based on http://linuxpixies.blogspot.jp/2011/06/tmux-copy-mode-and-how-to-control.html
# a script to ssh multiple servers over multiple tmux panes
starttmux() {
if [ -z "$HOSTS" ]; then
@cmabastar
cmabastar / loader.conf
Created October 15, 2015 16:51
Lenovo X220, freebsd 10.2 settings wireless 6205
iwnfw_load="YES"
if_iwn_load="YES"
iwn6050="YES"
legal.intel_iwn.license_ack=1
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
##semaphore
#sem_load="YES"
#aesni_load="YES"
@cmabastar
cmabastar / t2.micro via local
Last active July 12, 2016 03:53
Redis Benchmark on Freebsd 10.3
redis-benchmark -q -n 100000
PING_INLINE: 34891.84 requests per second
PING_BULK: 35223.67 requests per second
SET: 38124.29 requests per second
GET: 41841.00 requests per second
INCR: 41911.15 requests per second
LPUSH: 42140.75 requests per second
LPOP: 38850.04 requests per second
SADD: 37119.52 requests per second
SPOP: 41271.15 requests per second
@cmabastar
cmabastar / Dockerfile
Created May 31, 2019 19:37
Docker graceful shutdown for honcho and flask
FROM python:latest
RUN mkdir -p /app
WORKDIR /app
RUN python -m venv venv
ENV VIRTUAL_ENV /venv
ENV PATH /venv/bin:$PATH
ADD requirements.txt /app/requirements.txt
@cmabastar
cmabastar / Procfile
Created May 31, 2019 19:38
Running honcho or procfile for db migrate in flask
scheduler: flask db upgrade && flask rq scheduler -v
worker_a: flask rq worker -v
worker_b: flask rq worker -v
worker_c: flask rq worker -v
@cmabastar
cmabastar / haproxy.conf
Created June 17, 2016 06:08
Haproxy for flask-socketio
global
daemon
defaults
mode http
log global
option httplog
option http-server-close
option dontlognull
option redispatch