Skip to content

Instantly share code, notes, and snippets.

MichailAlexakis drmalex07

Block or report user

Report or block drmalex07

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
drmalex07 /
Last active Feb 23, 2020
Setup docker registry. #docker #docker-registry

README - Setup Docker registry

Let's assume that the FQDN name of the server will be registry.localdomain, and the service will be exposed as https://registry.localdomain:8443/.

1. Prerequisites

Create an environment file .env for the docker-compose project. An example content:

drmalex07 / setup-docker-on-ubuntu.yml
Created Feb 21, 2020
An ansible playbook for setting-up Docker under Ubuntu. #docker #ansible
View setup-docker-on-ubuntu.yml
# Run with: ansible-playbook -b
- hosts: all
- command: lsb_release -is
register: lsb_release_distributor_result
drmalex07 /
Last active Feb 11, 2020
An example creating a Docker volume on NFS. #docker #nfs #docker-volumes

Readme - Create a Docker volume on NFS

In this example, we directly instruct Docker to maintain a volume backed by NFS storage. Another way, of course, is to mount the NFS folder at the system level (afterwards, any container can bind-mount it).

By adding a Docker volume backed by NFS, Docker engine will take care of mounting/unmounting based on how containers are using this volume.

See also this comment:

drmalex07 /
Last active Feb 9, 2020
Create bootable USB with Grub2. #grub #grub2 #boot #usb

README - Create bootable USB with GRUB2

Let /dev/sdb be the USB device. Create 1 VFAT partition at /dev/sdb1 and mount at /mnt/usb0.

Install GRUB on the device:

grub-install --boot-directory=/mnt/usb0/boot /dev/sdb

Now, all files needed by GRUB (e.g modules for filesystems) are under /mnt/usb0/boot/grub.

drmalex07 /
Last active Nov 26, 2019
A basic spreadsheet reader in Java. #xlsx #xls #spreadsheet #excel
package gr.auth.physics.magnetized.etl.util;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.commons.collections4.IteratorUtils;
drmalex07 /
Last active Nov 2, 2019
Add memberof overlay in OpenLDAP server. #ldap #openldap #memberof

README - Add membeof overlay in OpenLDAP

Update configuration using ldapmodify and using the following LDIF:

dn: cn=module,cn=config
cn: module
objectClass: olcModuleList
olcModuleLoad: memberof
olcModulePath: /usr/lib/ldap
drmalex07 /
Created Oct 30, 2019
A very simple systemd service for a Spring-Boot executable JAR. #systemd #spring-boot

An example service definition under /etc/systemd/system/foo.service:


Description=Foo Service 

drmalex07 /
Created Oct 21, 2019
Extract logs from YARN containers. #hadoop #yarn #tfile #logs #yarn-logs
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.ContentSummary;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FSDataOutputStream;
drmalex07 /
Created Oct 18, 2019
An example of a programmatic submit of a Spark application. #spark #spark-submit #sparklauncher
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.spark.launcher.SparkAppHandle;
import org.apache.spark.launcher.SparkLauncher;
* An example of submitting a Spark application in a programmatic manner
drmalex07 /
Last active Oct 18, 2019
An example submit to Apache Livy. #livy #spark

README - Submit to Livy using REST API


Let app.json be the JSON payload that represents the application:

    "file": "hdfs:///user/user/apps/hello-spark-0.0.1.jar",
    "className": "acme.hello_spark.Grep",
    "args": ["input/1.txt", "[Mm]agic"],
You can’t perform that action at this time.