Skip to content

Instantly share code, notes, and snippets.

View vaind's full-sized avatar

Ivan Dlugos vaind

  • Bratislava, Slovakia
  • 15:46 (UTC +02:00)
  • LinkedIn in/dlugos
View GitHub Profile
@vaind
vaind / Dockerfile
Last active February 13, 2020 07:53
Using perf in a docker image
FROM ubuntu
RUN apt-get update \
&& apt-get install -y --no-install-recommends linux-tools-common linux-tools-generic \
&& apt-get clean \
&& rm /usr/bin/perf \
&& ln -s /usr/lib/linux-tools/*-generic/perf /usr/bin/perf
@vaind
vaind / Dockerfile
Last active March 19, 2020 02:52
Go - minimal docker image build
FROM golang:1.13.0-stretch AS builder
ENV GO111MODULE=on \
CGO_ENABLED=1
WORKDIR /build
# Let's cache modules retrieval - those don't change so often
COPY go.mod .
COPY go.sum .
@vaind
vaind / convert.py
Created July 14, 2019 08:54
Convert e-books from epub to mobi - recursive & parallelized python script
#!/usr/bin/python3
import os, time, glob, subprocess
files = glob.iglob('./**/*.epub', recursive=True)
workers = []
while files or workers:
files = list(files)
while len(workers) < 4 and files:
f = files[0]