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

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:

COMPOSE_PROJECT_NAME=registry_localdomain
@drmalex07
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
pre_tasks:
- command: lsb_release -is
register: lsb_release_distributor_result
@drmalex07
drmalex07 / README-docker-nfs-volume.md
Last active Feb 11, 2020
An example creating a Docker volume on NFS. #docker #nfs #docker-volumes
View README-docker-nfs-volume.md

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
drmalex07 / README-bootable-usb-with-grub2.md
Last active Feb 9, 2020
Create bootable USB with Grub2. #grub #grub2 #boot #usb
View README-bootable-usb-with-grub2.md

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
drmalex07 / AbstractSpreadsheetReader.java
Last active Nov 26, 2019
A basic spreadsheet reader in Java. #xlsx #xls #spreadsheet #excel
View AbstractSpreadsheetReader.java
package gr.auth.physics.magnetized.etl.util;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.commons.collections4.IteratorUtils;
import org.apache.poi.ss.usermodel.Cell;
@drmalex07
drmalex07 / README-openldap-add-memberof-overlay.md
Last active Nov 2, 2019
Add memberof overlay in OpenLDAP server. #ldap #openldap #memberof
View README-openldap-add-memberof-overlay.md

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
drmalex07 / README-systemd-service-executable-jar.md
Created Oct 30, 2019
A very simple systemd service for a Spring-Boot executable JAR. #systemd #spring-boot
View README-systemd-service-executable-jar.md

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

[Unit]

Description=Foo Service
After=network.target 

[Service]
@drmalex07
drmalex07 / YarnHelpers_ExtractLog.java
Created Oct 21, 2019
Extract logs from YARN containers. #hadoop #yarn #tfile #logs #yarn-logs
View YarnHelpers_ExtractLog.java
import java.io.DataInputStream;
import java.io.EOFException;
import java.io.IOException;
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.input.BoundedInputStream;
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
drmalex07 / SubmitSparkApplication.java
Created Oct 18, 2019
An example of a programmatic submit of a Spark application. #spark #spark-submit #sparklauncher
View SubmitSparkApplication.java
import java.io.File;
import java.io.IOException;
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
drmalex07 / README-submit-to-livy.md
Last active Oct 18, 2019
An example submit to Apache Livy. #livy #spark
View README-submit-to-livy.md

README - Submit to Livy using REST API

See https://livy.apache.org/docs/latest/rest-api.html

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.