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 / 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:

@munhitsu
munhitsu / gist:7656b49417f7d5926652
Created February 12, 2015 11:25
OSX 10.10: pip install lxml
#fatal error: 'libxml/xmlversion.h' file not found
#test 1 (failed)
brew install libxml2
brew install libxslt
brew link libxml2 --force
brew link libxslt --force
#test 2 (passed)
STATIC_DEPS=true pip install lxml
@munhitsu
munhitsu / gist:1a95fb27fef8e6fd1beb
Last active August 29, 2015 14:15
salt hack to automatch/autogenerate role in top.sls (pillar or grain)
base:
{% for role in grains.get('roles') %}
'roles:{{ role }}':
- match: grain
- {{ role }}
{% endfor %}
{% for role in grains.get('roles') %}
'roles:{{ role }}':
- match: grain
@munhitsu
munhitsu / gist:8b80c8a74f01f382088f
Last active August 29, 2015 14:16
linux hdd info/benchmarking
hdparm -I /dev/sda
lshw
ioping -R /dev/sda1
# i.e. get aws ephemeral data
curl http://169.254.169.254/latest/meta-data/block-device-mapping/ephemeral0
@munhitsu
munhitsu / gist:ab256f8c6a0640c82a10
Created February 25, 2015 14:05
bloated package but good insight into memory usage
apt-get install smem
@munhitsu
munhitsu / gist:f66fa0b4300669874664
Created March 26, 2015 10:55
salt module function to save dictionary as a json file
import json
import logging
log = logging.getLogger(__name__)
def save_dictionary(filename, # whe to output dictionary
**kwargs # the dictionary itself
):