Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View munhitsu's full-sized avatar

Mateusz Łapsa-Malawski munhitsu

  • cr3.io
  • London, UK
View GitHub Profile
@munhitsu
munhitsu / db.tf
Created August 27, 2015 11:05
aws_db_instance final_snapshot_identifier
resource "aws_db_instance" "api" {
identifier = "api-${var.stack}"
allocated_storage = 100
engine = "postgres"
engine_version = "9.3.6"
instance_class = "db.m3.medium"
storage_encrypted = true
apply_immediately = false
name = "${var.db_name}"
username = "${var.db_master_username}"
@munhitsu
munhitsu / pprinttable.py
Created April 19, 2014 22:05
pretty prints list of dictionaries as a table
from __future__ import print_function
def pprinttable(data, headers=None, print=print):
"""
prints data as a table assuming that data is a list of dictionaries (single level)
if headers are provided then they specify sequence of columns
example of data:
[{'slug': u'ams1', 'name': u'Amsterdam 1', 'region_id': 2},
{'slug': u'sfo1', 'name': u'San Francisco 1', 'region_id': 3},
@munhitsu
munhitsu / gist:2b499311c9381cac127a
Created June 20, 2014 14:20
ascii secret in python
import os
"".join((chr(ord(os.urandom(1))/2) for x in range(64)))
@munhitsu
munhitsu / gist:22609bf1e51ad0be9fa2
Created July 7, 2014 13:00
get elastic search cluster configuration (i.e. to check logstash protocol version)
curl -XGET localhost:9200/_nodes/_all/process?pretty
@munhitsu
munhitsu / gist:f79735df67fb6c9fddd2
Created August 8, 2014 17:22
reverse dns from dig
dig +noall +answer -x 8.8.8.8
dig -x 8.8.8.8
@munhitsu
munhitsu / gist:adc23d52849e41c0dc06
Created August 12, 2014 14:00
pretty print json on command line
python -m json.tool
@munhitsu
munhitsu / gist:cac267db0380f6c40aca
Created October 29, 2014 13:01
boot2docker .bash_profile
boot2docker.sh() {
$(boot2docker shellinit)
}
@munhitsu
munhitsu / gist:87b2bc7e578ac6882765
Created November 7, 2014 12:57
see logstash threads cpu usage ('top' filter for threads)
top -Hp $(pgrep java -u logstash)
@munhitsu
munhitsu / gist:156db4314264ca2959fb
Created December 26, 2014 01:14
install go on OSX
brew install go
brew install git
brew install mercurial
#go code analysis
go get golang.org/x/tools/cmd/vet
#to have offline docs using: godoc -http=:6060
go get golang.org/x/tools/cmd/godoc
@munhitsu
munhitsu / keybase.md
Created January 22, 2015 18:22
keybase

Keybase proof

I hereby claim:

  • I am munhitsu on github.
  • I am munhitsu (https://keybase.io/munhitsu) on keybase.
  • I have a public key whose fingerprint is 8E51 F4D3 1C2A 8D8C 07F2 7039 B8D1 BB64 D360 DABA

To claim this, I am signing this object: