Skip to content

Instantly share code, notes, and snippets.

Mateusz Łapsa-Malawski munhitsu

Block or report user

Report or block munhitsu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

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 A1FD 1761 CF00 5402 C93C 5C1F 91FF 6CF6 C537 D591

To claim this, I am signing this object:

@munhitsu
munhitsu / tickets.py
Created Jan 24, 2018
Zendesk tickets.xml to csv (opinionated)
View tickets.py
import csv
import xml.etree.ElementTree as ET
# was: for $x in ./tickets/ticket return string-join((data($x/created-at), data($x/current-tags), data($x/subject), data($x/description), data($x/status-id)),", ")
SERVICE_ID = '31281329'
tree = ET.parse('tickets.xml')
root = tree.getroot()
View zendesk users.xml to decent csv
xqilla -i users.xml <(echo 'for $x in ./users/user return string-join((data($x/email), data($x/roles), data($x/last-login)),", ")') > users.csv
View gist:0d4b3d0dc6177620b8be
#nice docker stats
docker stats $(docker ps --format '{{.Names}}')
#old way
docker stats $(docker ps | awk '{if(NR>1) print $NF}')
@munhitsu
munhitsu / gist:c0d0bff53ad5219818cd
Created Mar 4, 2016
wait for postgresql (i.e. within docker container)
View gist:c0d0bff53ad5219818cd
until nc -z ${POSTGRES_PORT_5432_TCP_ADDR} ${POSTGRES_PORT_5432_TCP_PORT}; do
echo "$(date) - waiting for postgres..."
sleep 1
done
View install M2Crypto on El Capitan
brew install swig
env LDFLAGS="-L$(brew --prefix openssl)/lib" \
CFLAGS="-I$(brew --prefix openssl)/include" \
SWIG_FEATURES="-cpperraswarn -includeall -I$(brew --prefix openssl)/include" \
pip install m2crypto
@munhitsu
munhitsu / gist:a5fb0fa2b49897884987
Last active Jan 22, 2016
where to go in Poland
View gist:a5fb0fa2b49897884987
Kraków - university city - ex-capital - where I lived for 13 years
a trip to Auschwitz - difficult but worth
a trip to Wieliczka - picturesque salt mine with loads of salt sculptures, and underground salt church
restaurant - Jarema - for properly made traditional food
Wrocław - smaller, just charming - plenty of German architecture influences
beautiful walks over riverbanks
Gdańsk - the oldest, and the most important port city - go to the old town - german/danish, influence
View Elastic Search debugging
#check logs
curl http://localhost:9200/_cluster/health?pretty
curl http://localhost:9200/_cat/indices?v
curl http://localhost:9200/_cat/nodes?v
curl http://localhost:9200/_cat/shards?v
curl localhost:9200/_nodes/process?pretty
@munhitsu
munhitsu / gist:c74b3f627066392a1fb4
Last active Oct 29, 2015
NTP debugging/config aws context
View gist:c74b3f627066392a1fb4
# recommended ntp pool (/etc/ntp.conf)
server 0.amazon.pool.ntp.org iburst
server 1.amazon.pool.ntp.org iburst
server 2.amazon.pool.ntp.org iburst
server 3.amazon.pool.ntp.org iburst
ntpq
> peers
check for connection prefixed with *
> as
@munhitsu
munhitsu / .envrc
Created Oct 19, 2015
pyvenv/venv + direnv
View .envrc
if ! [ -d venv ]; then
pyvenv venv
fi
source venv/bin/activate
You can’t perform that action at this time.