Skip to content

Instantly share code, notes, and snippets.

View kekru's full-sized avatar

Kevin Krummenauer kekru

View GitHub Profile
@kekru
kekru / Start Docker in VM with a simple command.md
Created November 3, 2016 11:47
Start Docker in VM with a simple command

Start a VM with Docker with a simple command

This is how to easily setup a VM with Docker and Docker Remote API enabled.
We use VirtualBox, Vagrant and Docker for that.

First install VirtualBox https://www.virtualbox.org/wiki/Downloads
and Vagrant https://www.vagrantup.com/downloads.html

Run vagrant version to check that vagrant is correctly installed.

Save the Vagrantfile from this gist to a local directory.

Docker useful commands

Stop and remove all running containers:
docker stop $(docker ps -aq) && docker rm $(docker ps -aq)

Remove all stopped containers:
docker rm $(docker ps -aq)

Remove untagged/dangling/<none> images
docker rmi $(docker images -q -f dangling=true)

# LICENSE CDDL 1.0 + GPL 2.0
#
# Copyright (c) 1982-2016 Oracle and/or its affiliates. All rights reserved.
#
# ORACLE DOCKERFILES PROJECT
# --------------------------
# This is the Dockerfile for Oracle Database 11g Release 2 Express Edition
#
# REQUIRED FILES TO BUILD THIS IMAGE
# ----------------------------------
@kekru
kekru / Windows utilities.md
Last active April 12, 2017 14:12
Windows CMD Utilities

Windows CMD Utilities

Search for string in files:

FINDSTR /spin "the string" *
Searches for "the string" in the files of the current and all subdirectories.

Simple FTP based backup of a zip file

This script creates a zipfile and uploads it to an FTP server. You can define how many backups should be stored on the server. Older files will be deleted.

@kekru
kekru / 1.Docker Postgres pitrery.md
Last active August 15, 2017 17:28
Dockerized PostgreSQL with Pitrery

Postgres DB with point in time recovery with pitrery

Not yet tested

Usage

This image is based on docker's official postgres image. See here for usage information.
Remove or replace the timezone settings in this Dockerfile with your timezone. Currently "Europe/Berlin" is set.
The pitrery backup directory is /backup.

@kekru
kekru / map-keyboard-key.md
Last active October 28, 2018 13:36
Ubuntu map keybooard special key

My low cost keyboard does not have a less/greater/pipe key....
So I mapped a special key, to the less/greater/pipe key

# find out the keycode of the special key, for me it was 148
xev
# set Strg_r to Mode_switch -> Strg_r + special key will print pipe
sudo xmodmap -e "keycode 0x69 = Mode_switch Mode_switch Mode_switch Mode_switch" 
# set key binding for special key. Replace the keycode with your keycode  
sudo xmodmap -e "keycode 148 = less greater bar"
@kekru
kekru / gist:3fe759fc98c432b1cbf6507b5bc107d0
Created January 31, 2019 14:19 — forked from ivanov-alex/gist:e0cc14d3dc6fc1520283
Extending Enum for UT using Mockito
/////////// changes for pom.xml
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>1.6.2</version>
@kekru
kekru / 01-container-structure-test.md
Last active May 30, 2019 18:54
Dockerfile for container-structure-test

Dockerfile for container-structure-test

Use the following docker-compose file. It will build directly from this gist.
To be more stable, copy the Dockerfile and build on your own.

version: "3.3"

services:
 structure-test: