Skip to content

Instantly share code, notes, and snippets.

View MrSoftwareEngineer's full-sized avatar

MrSoftwareEngineer MrSoftwareEngineer

  • Saint-Petersburg, Russia
View GitHub Profile

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@MrSoftwareEngineer
MrSoftwareEngineer / WalkFileTreeSample.java
Last active September 4, 2015 07:33
This sample makes filetree
/*Простой пример обхода всех директорий
* Пути файлов и директорий будут добавлены в лист и в конце выведены на консоль
* Для более тонкой настройки имеет смысл посмотреть другие методы класса
* SimpleFileVisitor и переопределить их.
* Метод Files.walkFileTree имеет перегруженый аналог*/
import java.io.IOException;
import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
@MrSoftwareEngineer
MrSoftwareEngineer / CustomizedComparatorTest.java
Last active August 29, 2015 14:25
Create custom Comparator for sort items in the List by all fields
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
/*
*/
public class CustomizedComparatorTest {
public static void main(String[] args) {