Skip to content

Instantly share code, notes, and snippets.

@zaenk
zaenk / java_oom.md
Last active April 14, 2017 13:11
Docker on Ubuntu

Determine whether cgroups limit the available memory

  • Create Dockerfile for test
FROM ubuntu:16.04

RUN apt-get update && \
    apt-get install -y openjdk-8-jdk && \
    rm -rf /var/lib/apt/list/*
@zaenk
zaenk / dev_env_db_and_stubs_with_docker.md
Last active April 26, 2017 07:10
Set up dev environment with docker-compose

Set up dev environment with docker-compose

Python container

It is mostly (like a 100%) stolen from here

FROM ubuntu:16.04

RUN apt-get update -y
@zaenk
zaenk / docker_volumes_win.md
Last active April 26, 2017 07:11
Docker volumes on Windows

Docker volumes on Windows

Docker for Windows needs a shared drive in order to use it as a root for shared volumes for containers. I don't feel like sharing my whole C: drive, or a creating a new partition on one of my existing disk solely for this purpose.

subst

First I tried to fix this with subst DOS command, it saved me once while I wanted to delete a really deep node_modules directory, but I wanted a solution where I can move around this mounted drive on the host.

Mount a VHD

@zaenk
zaenk / session_execution_policy.ps1
Created June 30, 2017 12:41
Sets the execution policy for the current session
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Unrestricted
@zaenk
zaenk / Dockerfile
Created August 22, 2017 15:16
Ubuntu 14.04 container with sshd configured
FROM ubuntu:14.04
RUN apt-get update && apt-get install -y openssh-server
RUN mkdir /var/run/sshd
RUN echo 'root:password' | chpasswd
# xenial
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# trusty
RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config
@zaenk
zaenk / test
Last active August 24, 2017 11:10
Example Ansible play to create database for applicaiton
# inventory
[app]
apphost1
[app:vars]
app_schema=testappdb
app_user=testappuser
app_password=testapppassword
@zaenk
zaenk / README.md
Created January 5, 2018 14:36
iOS universal link checklist
@zaenk
zaenk / TestDbConfig.java
Created April 1, 2017 17:47
Minimal configuration file for integration tests with Spring and MariaDb4j
import ch.vorburger.mariadb4j.springframework.MariaDB4jSpringService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;
import org.springframework.context.annotation.Lazy;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
@zaenk
zaenk / spring_boot_servlet_container.md
Created February 27, 2018 09:38
Spring Boot on Servlet container

Many Spring Boot Starters are dependent on spring-boot-starter-tomcat, which causes deployments error on Wildfly. To which dependencies causing errors run the following command and exclude spring-boot-starter-tomcat module from them:

./gradlew dependencyInsight --dependency spring-boot-starter-tomcat --configuration compile