Blog

  • c

    SCRU128: Sortable, Clock and Random number-based Unique identifier

    GitHub tag License

    SCRU128 ID is yet another attempt to supersede UUID for the users who need decentralized, globally unique time-ordered identifiers. SCRU128 is inspired by ULID and KSUID and has the following features:

    • 128-bit unsigned integer type
    • Sortable by generation time (as integer and as text)
    • 25-digit case-insensitive textual representation (Base36)
    • 48-bit millisecond Unix timestamp that ensures useful life until year 10889
    • Up to 281 trillion time-ordered but unpredictable unique IDs per millisecond
    • 80-bit three-layer randomness for global uniqueness
    #include "scru128.h"
    
    #include <stdio.h>
    
    int main() {
      Scru128Generator g;
      scru128_generator_init(&g);
    
      // generate a new identifier
      uint8_t x[16];
      scru128_generate(&g, x);
      char text[SCRU128_STR_LEN]; // 26 bytes
      scru128_to_str(x, text);
      puts(text); // e.g., "036z951mhjikzik2gsl81gr7l"
    
      // generate a textual representation directly
      scru128_generate_string(&g, text);
      puts(text); // e.g., "036z951mhzx67t63mq9xe6q0j"
    
      return 0;
    }

    See SCRU128 Specification for details.

    Platform integration

    scru128.h does not provide a concrete implementation of scru128_generate(), so users have to implement it to enable high-level generator APIs (if necessary) by integrating the low-level generator primitives provided by the library with the real-time clock and random number generator available in the system. Here is a quick example for the BSD-like systems:

    #include "scru128.h"
    
    #include <stdlib.h> // or <bsd/stdlib.h> on Linux with libbsd
    #include <time.h>
    
    int scru128_generate(Scru128Generator *g, uint8_t *id_out) {
      struct timespec tp;
      int err = clock_gettime(CLOCK_REALTIME, &tp);
      if (err) {
        return SCRU128_GENERATOR_STATUS_ERROR;
      }
      uint64_t timestamp = (uint64_t)tp.tv_sec * 1000 + tp.tv_nsec / 1000000;
      return scru128_generate_or_reset_core(g, id_out, timestamp, &arc4random,
                                            10000);
    }

    Find more examples in the platform directory.

    License

    Licensed under the Apache License, Version 2.0.

    See also

    Visit original content creator repository https://github.com/scru128/c
  • ConfigurableMakefile

    Configurable Makefile

    Download License

    Configurable Makefile for compiling executable and library projects, natively and for AVR.

    Table of Contents

    Prerequisites

    • GCC
    • Make

    Installing

    GCC and Make

    Windows:

    • Download MinGW or CygWin.
    • Install it and add the path of the .../bin/ folder to the environment variable “Path”.

    When using MinGW, “make” is named “mingw32-make”.


    Configurable Makefile

    New executable native project:

    • Download the repository
    • Copy the ‘Makefile’ from the root of the repository to a new folder.
    • Run make init to initialize the folder structure.
    • Place your source files inside .../<project_name>/src/.
    • Run make.

    “Native project” example:

    • Download the repository.
    • Run make init inside .../ConfigurableMakefile/examples/Native project to initialize the folder structure.
    • Do the same inside .../ConfigurableMakefile/examples/Native project/deps/Ext1 and .../ConfigurableMakefile/examples/Native project/deps/Ext2, these are separate library projects and dependencies of “Native project” example.
    • Run make deps inside .../ConfigurableMakefile/examples/Native project to “make” the dependencies.
    • And finally run make to “make” the example project.

    “AVR project” example:

    • Download the repository.
    • In .../ConfigurableMakefile/examples/AVR project/Makefile edit the variables: MCU, F_CPU, UPLOADER, PROGRAMMER, PORT
    • Run make init inside .../ConfigurableMakefile/examples/AVR project to initialize the folder structure.
    • Run make to “make” the example project
    • And finally run make program to upload it to an AVR target.

    Configuring the Makefile

    See the instructions inside Makefile.

    Commands

    Run make help.

    License

    The MIT License (MIT)

    Copyright (c) 2019 Vasil Kalchev

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    Visit original content creator repository https://github.com/VasilKalchev/ConfigurableMakefile
  • ConfigurableMakefile

    Configurable Makefile

    Download License

    Configurable Makefile for compiling executable and library projects, natively and for AVR.

    Table of Contents

    Prerequisites

    • GCC
    • Make

    Installing

    GCC and Make

    Windows:

    • Download MinGW or CygWin.
    • Install it and add the path of the .../bin/ folder to the environment variable “Path”.

    When using MinGW, “make” is named “mingw32-make”.


    Configurable Makefile

    New executable native project:

    • Download the repository
    • Copy the ‘Makefile’ from the root of the repository to a new folder.
    • Run make init to initialize the folder structure.
    • Place your source files inside .../<project_name>/src/.
    • Run make.

    “Native project” example:

    • Download the repository.
    • Run make init inside .../ConfigurableMakefile/examples/Native project to initialize the folder structure.
    • Do the same inside .../ConfigurableMakefile/examples/Native project/deps/Ext1 and .../ConfigurableMakefile/examples/Native project/deps/Ext2, these are separate library projects and dependencies of “Native project” example.
    • Run make deps inside .../ConfigurableMakefile/examples/Native project to “make” the dependencies.
    • And finally run make to “make” the example project.

    “AVR project” example:

    • Download the repository.
    • In .../ConfigurableMakefile/examples/AVR project/Makefile edit the variables: MCU, F_CPU, UPLOADER, PROGRAMMER, PORT
    • Run make init inside .../ConfigurableMakefile/examples/AVR project to initialize the folder structure.
    • Run make to “make” the example project
    • And finally run make program to upload it to an AVR target.

    Configuring the Makefile

    See the instructions inside Makefile.

    Commands

    Run make help.

    License

    The MIT License (MIT)

    Copyright (c) 2019 Vasil Kalchev

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    Visit original content creator repository https://github.com/VasilKalchev/ConfigurableMakefile
  • Social-Networking-API

    Social Networking API 💬

    Badge image

    Description


    RESTful API for a social network web application where users can share their thoughts, react to friends’ thoughts, and create a friend list. This project was built using Express, MongoDB, and Mongoose. Also tested using Mocha and seeded using Postman. The API is designed to be scalable and flexible, allowing for easy integration with other applications.

    Table of Contents


    Installation


    To install Social-Networking-API, follow these guidelines.

    1. Clone the repository into your local machine using git.
    git clone https://github.com/Ccooper9893/Social-Networking-API.git
    
    1. Install the required dependencies by navigating to the project directory and running the following command:
    npm install
    

    Features


    All endpoints adhere to the principles of RESTful architecture and use standard HTTP methods (POST, GET, PUT, DELETE) to perform the respective actions. The API returns responses in JSON format, making it easy to parse and integrate into different applications.

    User Management

    • Create, update, and delete new or exisiting users.

    Friend Management

    • Add or remove friends from an exisiting user’s friend’s list.

    Thought Management

    • Create, update, and delete thoughts for individual users.

    Reaction Management

    • Create and delete reactions to individual user thoughts.

    Usage


    To use this RESTful API, you must have MongoDB and Node.js installed on your local machine. You will also need an API testing tool such as Insomnia or Postman. Be sure to follow the installation guidelines before proceeding. Once installation is complete, follow these steps to access the features.

    1. Create a .env file to store your local MongoDB database credentials. Make sure your URL looks like the following:
    DB_URL = 'mongodb://127.0.0.1:27017/socialnetworkDB'
    
    1. Start the server by running the following command:
    npm start
    
    1. For testing using Mocha, run the following command in your terminal.
    npm run test
    

    Example of API response

    Postman collection of HTTP requestsScreenshot of passing tests.

    Software


    This project was built using the following software:

    • Node.js – a JavaScript runtime built on Chrome’s V8 JavaScript engine
    • Visual Studio Code – a lightweight code editor with robust features for web development
    • Postman – a popular API development tool that allows you to test, document, and share your APIs
    • Express.js – a fast, minimalist web framework for Node.js
    • Mocha – a feature-rich JavaScript test framework running on Node.js
    • dotenv – a zero-dependency module that loads environment variables from a .env file
    • moment.js – a JavaScript library that helps you parse, validate, manipulate, and display dates and times
    • validator – a library of string validators and sanitizers for Node.js
    • MongoDB – a popular NoSQL database program that stores data in JSON-like documents

    License


    This application is covered under the MIT license.

    For more information about this license please visit https://opensource.org/licenses/MIT

    Questions


    For comments/concerns please contact me at https://github.com/Ccooper9893

    Github Repo: https://github.com/Ccooper9893/Social-Networking-API

    Visit original content creator repository https://github.com/Ccooper9893/Social-Networking-API
  • nuki_integration

    Nuki OTP Integration for Home Assistant

    This custom integration for Home Assistant allows users to generate and manage One-Time Passwords (OTPs) for Nuki Smart Locks directly from Home Assistant.

    Features

    • Generate OTP codes with a specified lifetime.
    • Automatically delete expired or used OTPs.
    • Display current active OTP codes and their expiry times.
    • Integrate with Nuki Smart Lock API to manage access.

    Installation

    HACS Installation

    If you have HACS installed, you can easily add this repository as a custom integration:

    1. Open HACS in the Home Assistant frontend.
    2. Navigate to “Integrations” section.
    3. Click on the “…” button in the top right corner and select “Custom repositories”.
    4. Add the URL of this repository.
    5. Choose “Integration” as the category and click “Add”.
    6. You should now be able to search for and install the Nuki OTP integration directly through HACS.

    Manual Installation

    To manually install this integration, follow these steps:

    1. Ensure you have a Home Assistant instance running.
    2. Download this repository and copy the custom_components/nuki_otp folder to the custom_components directory of your Home Assistant installation.
    3. Restart Home Assistant to detect the new integration.

    Configuration

    After installation, add the integration through the Home Assistant frontend:

    1. Navigate to Configuration -> Integrations.
    2. Click on the + Add Integration button.
    3. Search for Nuki OTP and select it.
    4. Enter the required configuration details:
      • API Token
      • API URL
      • OTP Username
      • Nuki Name
      • OTP Lifetime Hours

    Usage

    Once configured, the integration will provide a sensor and a switch within Home Assistant:

    • Sensor: Displays the currently active OTP and its expiry time.
    • Switch: Allows generating a new OTP or deleting the current one.

    Troubleshooting

    If you encounter any issues, check the Home Assistant logs for errors and ensure your configuration details are correct. If problems persist, please report them on the GitHub repository.

    Contributing

    Contributions to this project are welcome! Feel free to fork the repository and submit pull requests.

    License

    This integration is released under the MIT License.

    Disclaimer

    This integration is not officially affiliated with Nuki and is provided “as is” without warranty of any kind.

    Visit original content creator repository https://github.com/pickeld/nuki_integration
  • UTC-Time-and-date-widget

    UTC Time Display Widget

    A super lightweight Python script to display the current UTC date and time in a transparent, draggable window on your Windows desktop. Designed for simplicity and portability, this tool is perfect for anyone who needs a quick, unobtrusive UTC clock.


    Features

    • Real-time UTC updates: Accurate to the second.
    • Transparent background: Blends seamlessly into your desktop.
    • Draggable and resizable: Fully customizable positioning and size.
    • Lightweight and simple: No unnecessary clutter—just the time.

    Python
    License
    Version


    Screenshot

    UTC Time Display Widget

    Prerequisites

    1. Python 3.x: Ensure Python is installed on your system. Download Python
    2. tkinter: Pre-installed with most Python distributions. Verify by running:
      python -m tkinter
      If not installed, use:
      pip install tk

    Usage

    1. Clone the repository:
      git clone https://github.com/TemplarPirate/UTC-Time-and-date-widget.git
    2. Navigate to the directory:
      cd UTC-Time-and-date-widget
    3. Run the script:
      python utc_display_widget.pyw

    Customization

    • Font size and style: Adjust the font parameter in the label setup:
      font=("Helvetica", 20)
    • Transparency: Modify the -alpha value (0.0 to 1.0) for desired opacity.
    • Window positioning: Change x_position and y_position for different alignments.

    Compatibility

    This script is designed for Windows environments. While it may work on other operating systems (e.g., Linux or macOS), the transparent background and some UI behaviors are specific to Windows and might not function as expected elsewhere.


    Quick Start

    1. Clone the repository:
      git clone https://github.com/TemplarPirate/UTC-Time-and-date-widget.git
    2. Run the script directly:
      python utc_display_widget.pyw

    Future Development

    • 🌍 Expand compatibility for Linux/macOS.
    • 🎨 Add themes for personalizing the look and feel.
    • 🕐 Include additional time zones for the global nomads.
    • 🚀 Build a one-click installer for effortless setup.

    Contribution

    Contributions are welcome and strongly encouraged (I’d love upgrade contributions)! If you have suggestions, find issues, or would like to collaborate, feel free to:

    • Submit a pull request.
    • Open an issue.

    License

    This project is licensed under the MIT License. You are free to use, modify, and distribute this software as long as proper attribution is given.


    ⭐ Please Star

    If you like this project, please ⭐ star it to show your support and help others discover it!


    Support Me

    If this little thing-a-ma-bob brought joy or utility to your digital life, consider supporting my work!
    Your encouragement helps keep the caffeine flowing and ideas growing.

    ☕ Buy me a coffee

    Visit original content creator repository https://github.com/TemplarPirate/UTC-Time-and-date-widget
  • Enigma

    Enigma Machine Python

    This Python script simulates the operation of an Enigma machine, a type of encryption device used by the Germans during World War II. The script allows the user to input the settings for the rotors, reflector, and plugboard (appairages), and then it simulates the operation of the machine based on these settings.

    Usage

    Run the script. You will be prompted to enter the settings for the rotors, reflector, and plugboard.

    1. Input the rotors as ‘Y-X’ where Y is the rotor number and X is the value. You need to input three rotors. For example: 1-1 3-2 5-6.

    2. Input the plugboard settings (appairages) as ‘A-C’. You can input up to 10 pairs. For example: A-B C-D E-F G-H I-J K-L M-N O-P Q-R S-T.

    3. Input the reflector as a single letter: A, B, or C.

    4. If the input is valid, the script will continue to the main function. If the input is invalid, the script will print “Invalid Input” and exit.

    Example

    Input rotors comme ça 'Y-X' Avec Y le rotor et X la valeure (*3) et les appairages comme ça 'A-C' (*10) et le reflecteur : A ou B ou C
    Espace = clear et Entrée = quitter
    Rotors: 1-1 3-2 5-6
    [1, 1, 3, 2, 5, 6]
    appairage: A-B C-D E-F G-H I-J K-L M-N O-P Q-R S-T
    ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T']
    Reflecteur: B
    B
    

    Note

    This script is a simulation and does not provide real encryption. It is intended for educational purposes only.

    Visit original content creator repository
    https://github.com/Kikaayy/Enigma

  • spring-springboot-angular-microservices-mysql-java-persistence-hibernate-aws

    Attempt to study Java related topics!

    alt text

    • For these courses one should configure GIT for handle projects.
      • git config --global http.postBuffer 524288000.
      • git config --global core.longpaths true.

    Spring Boot beginners

    All course material from Spring Boot 3, Spring 6 & Hibernate for Beginners by Chad Darby ©.

    Contains my own notes with some course material to enforce learning experience.

    This repository is made with Eclipse, therefore it will include configuration files which are related to this IDE this approach will be favored for now. ⚙️

    The course at Udemy.

    Content maker.

    Git repo.

    If the content sparked 🔥 your interest, please consider buying the course and start learning 📖.

    Insert certificate here when completed

    Note: The material provided in this repository is only for helping those who may get stuck at any point of time in the course. It is very advised that no one should just copy the solutions(violation of Honor Code) presented here.

    Progress/Curriculum.

    • Section 01 – Section 1: NEW – Spring Boot 3 Quick Start.
    • Section 02 – Section 2: NEW – Spring Core.
    • Section 03 – Section 3: NEW – Hibernate/JPA CRUD.
    • Section 04 – Section 4: NEW – REST CRUD APIs.
    • Section 05 – Section 5: NEW – REST API Security.
    • Section 06 – Section 6: NEW – Spring MVC.
    • Section 07 – Section 7: NEW – Spring MVC CRUD.
    • Section 08 – Section 8: NEW – Spring MVC Security.
    • Section 09 – Section 9: NEW – JPA / Hibernate Advanced Mappings.
    • Section 10 – Section 10: NEW – AOP: Aspect-Oriented Programming.
    • Section 11 – Section 11: Summary.
    • Section 12 – Section 12: Appendix.
    • Section 13 – Section 13: Bonus.

    Additional stuff.

    • Read/skim thought Spring documentation when finished this course.
    • Make Unix clock in Thymeleaf or in Angular.
    • Make crypt program in Angular.
    • Refactor paths and projects inside eclipse.
    • Check typos.
    • Make folder 00 based.
    • Section 05 – Spring Boot REST Security with JPA/Hibernate Tutorial.
    • Make Chapters/headings when reviewing.
    • Remove numbers from packages.

    Old(legacy) course Curriculum, old course still accessible, if useful do.

    Progress/Curriculum.

    • Section 01 – Course Introduction.
    • Section 02 – Spring Overview.
    • Section 03 – Setting Up Your Development Environment.
    • Section 04 – Spring Inversion of Control – XML Configuration.
    • Section 05 – Spring Dependency Injection – XML Configuration.

    Master the Basics of Spring Integration and it's Components

    All course material from Master the Basics of Spring Integration and it’s Components by Rajshree Umarekar ©.

    Contains my own notes with some course material to enforce learning experience.

    This repository is made with IntelliJ IDEA with Eclipse hotkeys, therefore it will include configuration files which are related to this IDE this approach will be favored for now. ⚙️

    The course at Udemy.

    Content maker.

    If the content sparked 🔥 your interest, please consider buying the course and start learning 📖.

    Master the Basics of Spring Integration and it's Components cert

    Note: The material provided in this repository is only for helping those who may get stuck at any point of time in the course. It is very advised that no one should just copy the solutions(violation of Honor Code) presented here.

    Progress/Curriculum.

    • add here.

    Additional stuff.

    • Add here additional.

    Master Microservices

    All course material from Master Microservices with Spring Boot and Spring Cloud by in28Minutes ©.

    Contains my own notes with some course material to enforce learning experience.

    This repository is made with Eclipse, therefore it will include configuration files which are related to this IDE this approach will be favored for now. ⚙️

    The course at Udemy.

    Content maker.

    Latest GIT.

    If the content sparked 🔥 your interest, please consider buying the course and start learning 📖.

    Insert certificate here when completed

    Note: The material provided in this repository is only for helping those who may get stuck at any point of time in the course. It is very advised that no one should just copy the solutions(violation of Honor Code) presented here.

    • Currently transferring handwritten notes to digital form.

    Progress/Curriculum new.

    • Section 01 – Introduction ✅.
    • Section 02 – Introduction To Web Services ✅.
    • Section 03 – Restful Web Services with Spring Boot – V2.
    • Section 04 – Quick Introduction to Microservices ✅.
    • Section 05 – Microservices with Spring Cloud – V1. Master Microservices – V1 is now deprecated!.
    • Section 06 – Microservices with Spring Cloud – V2 ✅.
    • Section 07 – Docker with Microservices using Spring Boot and Spring Cloud – V2.
    • Section 08 – Kubernetes with Microservices using Docker, Spring Boot and Spring Cloud – V2.
    • Section 09 – Thanks.
    • Section 10 – Appendix – Introduction to Spring Boot in 12 Steps.
    • Section 11 – Appendix – Introduction to JUnit.
    • Section 12 – Appendix – Introduction To Mockito.
    • Section 13 – Appendix – Introduction to Functional Programming in 30 Minutes.
    • Section 14 – Appendix – Introduction To Gradle.
    • Section 15 – Appendix – Introduction to JPA in 10 Steps – V2 ✅.
    • Section 16 – Appendix – Introduction to Functional Programming in 30 Minutes.

    Additional stuff.

    • Read Pro GIT book.
    • Move Spring V1 into appendix folder, since it depreciated.
      • Also numbering got changed.
    • Remove numbers from packages and from lecture notes .md if there is.

    Jpa Course here

    All course material from Java Persistence: Hibernate and JPA Fundamentals by Deshraj Singh Kiran ©.

    The Course at Udemy.

    Homepage of Course.

    If the content sparked 🔥 your interest, please consider buying the course and start learning 📖.

    Java Persistence Hibernate and JPA Fundamentals

    Note: The material provided in this repository is only for helping those who may get stuck at any point of time in the course. It is very advised that no one should just copy the solutions(violation of Honor Code) presented here.

    • Currently transferring handwritten notes to digital form.

    Progress/Curriculum.

    Additional stuff.

    • Read again the mismatches.
    • Redo 18. Lab Exercise – Manipulating Objects.
    • Check again, “Entity cannot reference Entity”, but there is connections?.
    • Do including POM file <classpathentry kind="lib" path="C:/Users/ScoopiDoo/Desktop/git projektit/spring-springboot-angular-microservices-mysql-java-persistence-hibernate-aws/Java Persistence Hibernate and JPA Fundamentals/Files for course/connector/mysql-connector-j-9.2.0/mysql-connector-j-9.2.0.jar"/>
      • In .classpath.
    • Remove numbers from packages .md if there is.
    • When course finished, remove the projects from the IDE!

    Advanced hibernate here

    All course material from Hibernate: Advanced Development Techniques by Harinath Kuntamukkala and Chad Darby ©.

    The Course at Udemy.

    If the content sparked 🔥 your interest, please consider buying the course and start learning 📖.

    cert here.

    Note: The material provided in this repository is only for helping those who may get stuck at any point of time in the course. It is very advised that no one should just copy the solutions(violation of Honor Code) presented here.

    Progress/Curriculum.

    • Section 01 – Introduction. ✅
    • Section 02 – Mapping Collections – Sets and Lists. ✅
    • Section 03 – Mapping Collections – Maps, Sorted Maps and Sorted Sets. ✅
    • Section 04 – Mapping Components – Embeddable. ✅
    • Section 05 – Mapping Enums. ✅
    • Section 06 – Inheritance Mapping – Single Table Strategy.
    • Section 07 – Inheritance Mapping – Table per Class Strategy.
    • Section 08 – Inheritance Mapping – Joined Table Strategy.
    • Section 09 – Inheritance Mapping – Mapped Superclass.
    • Section 10 – Inheritance Mapping – Recap and Comparison.
    • Section 11 – Course Summary – Thank You.
    • Section 12 – Bonus.

    Additional stuff.

    • The repository for the code is here.

    • Paste every exercise code after examples.

    • Do the last piece of OrderBy from the chapter Sorted Maps - Write Some Code. Just another way to OrderBy.

    The Ultimate MySQL Bootcamp: Go from SQL Beginner to Expert course

    All course material from The Ultimate MySQL Bootcamp: Go from SQL Beginner to Expert by Colt Steele ©.

    Contains my own notes with some course material to enforce learning experience.

    The course at Udemy.

    Home page of maker.

    If the content sparked 🔥 your interest, please consider buying the course and start learning 📖.

    UltimateMySqlBootcampCertificate

    Note: The material provided in this repository is only for helping those who may get stuck at any point of time in the course. It is very advised that no one should just copy the solutions(violation of Honor Code) presented here.

    Progress/Curriculum.

    Additional stuff.

    • Course got updated, transfer your answers here with updated content!
    • Do little game as refresher. Fun game.

    Cloud Native course series.

    • This course series will have the following courses.
    cloud series
    1. About Docker. Course.
    2. About Kubernetes. Course.
    3. About Helm.
    4. About Service Mesh.

    Docker Masterclass For Java Spring Boot Developers

    All course material from Docker Masterclass For Java Spring Boot Developers by Vinoth Selvaraj ©.

    Contains my own notes with some course material to enforce learning experience.

    The course at Udemy.

    Content maker.

    If the content sparked 🔥 your interest, please consider buying the course and start learning 📖.

    Insert certificate here when completed

    Note: The material provided in this repository is only for helping those who may get stuck at any point of time in the course. It is very advised that no one should just copy the solutions(violation of Honor Code) presented here.

    Progress/Curriculum.

    Additional stuff.

    • Do the last chapter exercise from Section 05.
    • Remove numbers from packages and from lecture notes .md if there is.

    Kubernetes Masterclass For Beginners

    All course material from Kubernetes Masterclass For Beginners [Hands-On] by Vinoth Selvaraj ©.

    Contains my own notes with some course material to enforce learning experience.

    The course at Udemy.

    Content maker.

    Latest GIT repo from owner.

    If the content sparked 🔥 your interest, please consider buying the course and start learning 📖.

    Insert certificate here when completed

    Note: The material provided in this repository is only for helping those who may get stuck at any point of time in the course. It is very advised that no one should just copy the solutions(violation of Honor Code) presented here.

    Progress/Curriculum.

    Additional stuff.

    • Some.

    Apache Maven: Beginner to Guru

    All course material from Apache Maven: Beginner to Guru John Thompson and Spring Ahead Code Academy ©. With my own notes need this to manage our corporate POM 🔥 $${\color{red}HELL}$$ 🔥.

    This repository is made with IntelliJ IDEA with Eclipse hotkeys. This is why it will include configuration files which are related to this IDE this approach, and it will be favored for now, also the compiled classed for explanatory experiments. ⚙️

    The course at Udemy.

    Spring Ahead Code Academy.

    Spring Framework Guru.

    If the content sparked 🔥 your interest, please consider buying the course and start learning 📖.

    Insert certificate here when completed

    Note: The material provided in this repository is only for helping those who may get stuck at any point of time in the course. It is very advised that no one should just copy the solutions(violation of Honor Code) presented here.

    Progress/Curriculum.

    Additional stuff.

    • For now do till basic level.

    Cryptography and Hashing Fundamentals in Python and Java

    All course material from Cryptography and Hashing Fundamentals in Python and Java Holczer Balazs ©.

    Contains my own notes with some course material to enforce learning experience.

    This repository is made with Eclipse, therefore it will include configuration files which are related to this IDE this approach will be favored for now. ⚙️

    The course at Udemy.

    If the content sparked 🔥 your interest, please consider buying the course and start learning 📖

    Insert certificate here when completed

    Note: The material provided in this repository is only for helping those who may get stuck at any point of time in the course. It is very advised that no one should just copy the solutions(violation of Honor Code) presented here.

    Progress/Curriculum.

    Additional stuff.

    • Stuff.
    Visit original content creator repository https://github.com/developersCradle/spring-springboot-angular-microservices-mysql-java-persistence-hibernate-aws
  • spring-springboot-angular-microservices-mysql-java-persistence-hibernate-aws

    Attempt to study Java related topics!

    alt text

    • For these courses one should configure GIT for handle projects.
      • git config --global http.postBuffer 524288000.
      • git config --global core.longpaths true.

    Spring Boot beginners

    All course material from Spring Boot 3, Spring 6 & Hibernate for Beginners by Chad Darby ©.

    Contains my own notes with some course material to enforce learning experience.

    This repository is made with Eclipse, therefore it will include configuration files which are related to this IDE this approach will be favored for now. ⚙️

    The course at Udemy.

    Content maker.

    Git repo.

    If the content sparked 🔥 your interest, please consider buying the course and start learning 📖.

    Insert certificate here when completed

    Note: The material provided in this repository is only for helping those who may get stuck at any point of time in the course. It is very advised that no one should just copy the solutions(violation of Honor Code) presented here.

    Progress/Curriculum.

    • Section 01 – Section 1: NEW – Spring Boot 3 Quick Start.
    • Section 02 – Section 2: NEW – Spring Core.
    • Section 03 – Section 3: NEW – Hibernate/JPA CRUD.
    • Section 04 – Section 4: NEW – REST CRUD APIs.
    • Section 05 – Section 5: NEW – REST API Security.
    • Section 06 – Section 6: NEW – Spring MVC.
    • Section 07 – Section 7: NEW – Spring MVC CRUD.
    • Section 08 – Section 8: NEW – Spring MVC Security.
    • Section 09 – Section 9: NEW – JPA / Hibernate Advanced Mappings.
    • Section 10 – Section 10: NEW – AOP: Aspect-Oriented Programming.
    • Section 11 – Section 11: Summary.
    • Section 12 – Section 12: Appendix.
    • Section 13 – Section 13: Bonus.

    Additional stuff.

    • Read/skim thought Spring documentation when finished this course.
    • Make Unix clock in Thymeleaf or in Angular.
    • Make crypt program in Angular.
    • Refactor paths and projects inside eclipse.
    • Check typos.
    • Make folder 00 based.
    • Section 05 – Spring Boot REST Security with JPA/Hibernate Tutorial.
    • Make Chapters/headings when reviewing.
    • Remove numbers from packages.

    Old(legacy) course Curriculum, old course still accessible, if useful do.

    Progress/Curriculum.

    • Section 01 – Course Introduction.
    • Section 02 – Spring Overview.
    • Section 03 – Setting Up Your Development Environment.
    • Section 04 – Spring Inversion of Control – XML Configuration.
    • Section 05 – Spring Dependency Injection – XML Configuration.

    Master the Basics of Spring Integration and it's Components

    All course material from Master the Basics of Spring Integration and it’s Components by Rajshree Umarekar ©.

    Contains my own notes with some course material to enforce learning experience.

    This repository is made with IntelliJ IDEA with Eclipse hotkeys, therefore it will include configuration files which are related to this IDE this approach will be favored for now. ⚙️

    The course at Udemy.

    Content maker.

    If the content sparked 🔥 your interest, please consider buying the course and start learning 📖.

    Master the Basics of Spring Integration and it's Components cert

    Note: The material provided in this repository is only for helping those who may get stuck at any point of time in the course. It is very advised that no one should just copy the solutions(violation of Honor Code) presented here.

    Progress/Curriculum.

    • add here.

    Additional stuff.

    • Add here additional.

    Master Microservices

    All course material from Master Microservices with Spring Boot and Spring Cloud by in28Minutes ©.

    Contains my own notes with some course material to enforce learning experience.

    This repository is made with Eclipse, therefore it will include configuration files which are related to this IDE this approach will be favored for now. ⚙️

    The course at Udemy.

    Content maker.

    Latest GIT.

    If the content sparked 🔥 your interest, please consider buying the course and start learning 📖.

    Insert certificate here when completed

    Note: The material provided in this repository is only for helping those who may get stuck at any point of time in the course. It is very advised that no one should just copy the solutions(violation of Honor Code) presented here.

    • Currently transferring handwritten notes to digital form.

    Progress/Curriculum new.

    • Section 01 – Introduction ✅.
    • Section 02 – Introduction To Web Services ✅.
    • Section 03 – Restful Web Services with Spring Boot – V2.
    • Section 04 – Quick Introduction to Microservices ✅.
    • Section 05 – Microservices with Spring Cloud – V1. Master Microservices – V1 is now deprecated!.
    • Section 06 – Microservices with Spring Cloud – V2 ✅.
    • Section 07 – Docker with Microservices using Spring Boot and Spring Cloud – V2.
    • Section 08 – Kubernetes with Microservices using Docker, Spring Boot and Spring Cloud – V2.
    • Section 09 – Thanks.
    • Section 10 – Appendix – Introduction to Spring Boot in 12 Steps.
    • Section 11 – Appendix – Introduction to JUnit.
    • Section 12 – Appendix – Introduction To Mockito.
    • Section 13 – Appendix – Introduction to Functional Programming in 30 Minutes.
    • Section 14 – Appendix – Introduction To Gradle.
    • Section 15 – Appendix – Introduction to JPA in 10 Steps – V2 ✅.
    • Section 16 – Appendix – Introduction to Functional Programming in 30 Minutes.

    Additional stuff.

    • Read Pro GIT book.
    • Move Spring V1 into appendix folder, since it depreciated.
      • Also numbering got changed.
    • Remove numbers from packages and from lecture notes .md if there is.

    Jpa Course here

    All course material from Java Persistence: Hibernate and JPA Fundamentals by Deshraj Singh Kiran ©.

    The Course at Udemy.

    Homepage of Course.

    If the content sparked 🔥 your interest, please consider buying the course and start learning 📖.

    Java Persistence Hibernate and JPA Fundamentals

    Note: The material provided in this repository is only for helping those who may get stuck at any point of time in the course. It is very advised that no one should just copy the solutions(violation of Honor Code) presented here.

    • Currently transferring handwritten notes to digital form.

    Progress/Curriculum.

    Additional stuff.

    • Read again the mismatches.
    • Redo 18. Lab Exercise – Manipulating Objects.
    • Check again, “Entity cannot reference Entity”, but there is connections?.
    • Do including POM file <classpathentry kind="lib" path="C:/Users/ScoopiDoo/Desktop/git projektit/spring-springboot-angular-microservices-mysql-java-persistence-hibernate-aws/Java Persistence Hibernate and JPA Fundamentals/Files for course/connector/mysql-connector-j-9.2.0/mysql-connector-j-9.2.0.jar"/>
      • In .classpath.
    • Remove numbers from packages .md if there is.
    • When course finished, remove the projects from the IDE!

    Advanced hibernate here

    All course material from Hibernate: Advanced Development Techniques by Harinath Kuntamukkala and Chad Darby ©.

    The Course at Udemy.

    If the content sparked 🔥 your interest, please consider buying the course and start learning 📖.

    cert here.

    Note: The material provided in this repository is only for helping those who may get stuck at any point of time in the course. It is very advised that no one should just copy the solutions(violation of Honor Code) presented here.

    Progress/Curriculum.

    • Section 01 – Introduction. ✅
    • Section 02 – Mapping Collections – Sets and Lists. ✅
    • Section 03 – Mapping Collections – Maps, Sorted Maps and Sorted Sets. ✅
    • Section 04 – Mapping Components – Embeddable. ✅
    • Section 05 – Mapping Enums. ✅
    • Section 06 – Inheritance Mapping – Single Table Strategy.
    • Section 07 – Inheritance Mapping – Table per Class Strategy.
    • Section 08 – Inheritance Mapping – Joined Table Strategy.
    • Section 09 – Inheritance Mapping – Mapped Superclass.
    • Section 10 – Inheritance Mapping – Recap and Comparison.
    • Section 11 – Course Summary – Thank You.
    • Section 12 – Bonus.

    Additional stuff.

    • The repository for the code is here.

    • Paste every exercise code after examples.

    • Do the last piece of OrderBy from the chapter Sorted Maps - Write Some Code. Just another way to OrderBy.

    The Ultimate MySQL Bootcamp: Go from SQL Beginner to Expert course

    All course material from The Ultimate MySQL Bootcamp: Go from SQL Beginner to Expert by Colt Steele ©.

    Contains my own notes with some course material to enforce learning experience.

    The course at Udemy.

    Home page of maker.

    If the content sparked 🔥 your interest, please consider buying the course and start learning 📖.

    UltimateMySqlBootcampCertificate

    Note: The material provided in this repository is only for helping those who may get stuck at any point of time in the course. It is very advised that no one should just copy the solutions(violation of Honor Code) presented here.

    Progress/Curriculum.

    Additional stuff.

    • Course got updated, transfer your answers here with updated content!
    • Do little game as refresher. Fun game.

    Cloud Native course series.

    • This course series will have the following courses.
    cloud series
    1. About Docker. Course.
    2. About Kubernetes. Course.
    3. About Helm.
    4. About Service Mesh.

    Docker Masterclass For Java Spring Boot Developers

    All course material from Docker Masterclass For Java Spring Boot Developers by Vinoth Selvaraj ©.

    Contains my own notes with some course material to enforce learning experience.

    The course at Udemy.

    Content maker.

    If the content sparked 🔥 your interest, please consider buying the course and start learning 📖.

    Insert certificate here when completed

    Note: The material provided in this repository is only for helping those who may get stuck at any point of time in the course. It is very advised that no one should just copy the solutions(violation of Honor Code) presented here.

    Progress/Curriculum.

    Additional stuff.

    • Do the last chapter exercise from Section 05.
    • Remove numbers from packages and from lecture notes .md if there is.

    Kubernetes Masterclass For Beginners

    All course material from Kubernetes Masterclass For Beginners [Hands-On] by Vinoth Selvaraj ©.

    Contains my own notes with some course material to enforce learning experience.

    The course at Udemy.

    Content maker.

    Latest GIT repo from owner.

    If the content sparked 🔥 your interest, please consider buying the course and start learning 📖.

    Insert certificate here when completed

    Note: The material provided in this repository is only for helping those who may get stuck at any point of time in the course. It is very advised that no one should just copy the solutions(violation of Honor Code) presented here.

    Progress/Curriculum.

    Additional stuff.

    • Some.

    Apache Maven: Beginner to Guru

    All course material from Apache Maven: Beginner to Guru John Thompson and Spring Ahead Code Academy ©. With my own notes need this to manage our corporate POM 🔥 $${\color{red}HELL}$$ 🔥.

    This repository is made with IntelliJ IDEA with Eclipse hotkeys. This is why it will include configuration files which are related to this IDE this approach, and it will be favored for now, also the compiled classed for explanatory experiments. ⚙️

    The course at Udemy.

    Spring Ahead Code Academy.

    Spring Framework Guru.

    If the content sparked 🔥 your interest, please consider buying the course and start learning 📖.

    Insert certificate here when completed

    Note: The material provided in this repository is only for helping those who may get stuck at any point of time in the course. It is very advised that no one should just copy the solutions(violation of Honor Code) presented here.

    Progress/Curriculum.

    Additional stuff.

    • For now do till basic level.

    Cryptography and Hashing Fundamentals in Python and Java

    All course material from Cryptography and Hashing Fundamentals in Python and Java Holczer Balazs ©.

    Contains my own notes with some course material to enforce learning experience.

    This repository is made with Eclipse, therefore it will include configuration files which are related to this IDE this approach will be favored for now. ⚙️

    The course at Udemy.

    If the content sparked 🔥 your interest, please consider buying the course and start learning 📖

    Insert certificate here when completed

    Note: The material provided in this repository is only for helping those who may get stuck at any point of time in the course. It is very advised that no one should just copy the solutions(violation of Honor Code) presented here.

    Progress/Curriculum.

    Additional stuff.

    • Stuff.
    Visit original content creator repository https://github.com/developersCradle/spring-springboot-angular-microservices-mysql-java-persistence-hibernate-aws
  • conu

    conu

    PyPI PyPI - License PyPI - Status Codacy Badge Build Status

    conu is a library which makes it easy to write tests for your containers and is handy when playing with containers inside your code. It defines an API to access and manipulate containers, images and provides more, very helpful functions.

    conu is supported on python 3.6+ only.

    example

    Installation

    PyPI

    conu is available on PyPI, so you can easily install it with pip:

    $ pip install --user conu
    

    Fedora

    If you are running Fedora, we have packaged conu in an RPM:

    $ dnf install python3-conu
    

    Please visit our documentation for more info on installation.

    Docker container

    You can try conu also in the container, but you have to:

    • mount docker socket
    • use --cap-add SYS_ADMIN for mounting containers/images
    • set --privileged option or turn off the SELinux to allow access to docker inside the container:
    docker run -it --rm \
    -v /var/run/docker.sock:/var/run/docker.sock:z \
    --cap-add SYS_ADMIN \
    --privileged \
    usercont/conu:0.6.0 python3
    
    >>> from conu import DockerBackend
    >>> backend = DockerBackend()
    11:52:13.022 backend.py        INFO   conu has initiated, welcome to the party!
    >>> image = backend.ImageClass('docker.io/library/nginx')
    11:52:32.562 __init__.py       INFO   docker environment info: ...
    >>> container = image.run_via_binary()
    11:52:51.910 image.py          INFO   run container via binary in background

    If you want to run custom source file, mount it to the container in the following way:

    docker run -it --rm \
    -v /var/run/docker.sock:/var/run/docker.sock:z \
    -v $PWD/my_source.py:/app/my_source.py:z \
    --cap-add SYS_ADMIN \
    --privileged \
    usercont/conu:0.6.0 python3 /app/my_source.py
    

    Features

    Container images

    • load, pull, mount and remove container images
    • obtain low-level image metadata
    • check presence of files and directories inside a container image
    • read files inside an image
    • get selinux context of files in an image
    • extend image using s2i
    • check all packages in image are signed with a key
    • run image inside Kubernetes pod

    Container

    • kill, get logs, exec a command, mount, remove, start, stop, wait, run – via api or via binary
    • get low-level container metadata
    • shortcut methods for getting:
      • IPv4 and IPv6 addresses
      • PID of root process in the container
      • port mappings
      • container status
    • HTTP requests support
    • open a TCP connection with the service inside container
    • perform checks whether
      • the container is running
      • mapped ports are opened

    Utilities

    • easily create and delete a directory and set its options:
      • mode
      • ownership
      • selinux context
      • access control lists (facl)
    • port availability check
    • check SELinux status on host
    • run a command on host
    • easy random string generation
    • support for probes (execute a function in a separate process):
      • repeat until a condition is met
      • repeat N times
      • delay execution
      • delay between iterations

    Kubernetes

    • create/delete new namespace
    • create/delete Pod
    • create/delete Deployment
      • with parameters
      • from template
    • create/delete Service
    • shortcut methods for getting:
      • pod logs
      • pod IP
      • pod phase
      • pod condition
      • service IP
    • perform checks whether
      • pod is ready
      • all pods are ready for specific deployment

    OpenShift

    • create new app using oc new-app command
      • deploy pure image into openshift
      • support building s2i images from remote repository
      • support building s2i images from local path
      • support creating new applications using OpenShift templates
    • push images to internal OpenShift registry
    • request service
    • waiting until service is ready
    • obtain logs from all pods
    • get status of application
    • check readiness of pods
    • cleanup objects of specific application in current namespace

    Docker example

    Let’s look at a practical example:

    $ cat examples/readme_webserver.py
    #!/usr/bin/python3
    
    import logging
    
    from conu import DockerRunBuilder, DockerBackend
    
    # our webserver will be accessible on this port
    port = 8765
    
    # we'll utilize this container image
    image_name = "registry.fedoraproject.org/fedora"
    image_tag = "27"
    
    # we'll run our container using docker engine
    with DockerBackend(logging_level=logging.DEBUG) as backend:
        # the image will be pulled if it's not present
        image = backend.ImageClass(image_name, tag=image_tag)
    
        # the command to run in a container
        command = ["python3", "-m", "http.server", "--bind", "0.0.0.0", "%d" % port]
        # let's run the container (in the background)
        container = image.run_via_binary(command=command)
        try:
            # we need to wait for the webserver to start serving
            container.wait_for_port(port)
            # GET on /
            # this is standard `requests.Response`
            http_response = container.http_request(path="https://github.com/", port=port)
            assert http_response.ok
            assert '<a href="https://github.com/user-cont/etc/">etc/</a>' in http_response.content.decode("utf-8")
            # let's access /etc/passwd
            etc_passwd = container.http_request(path="/etc/passwd", port=port).content.decode("utf-8")
            assert 'root:x:0:0:root:/root:' in etc_passwd
            # we can also access it directly on disk and compare
            with container.mount() as fs:
                assert etc_passwd == fs.read_file("/etc/passwd")
        finally:
            container.kill()
            container.delete()

    Let’s run it and look at the logs:

    $ python3 examples/readme_webserver.py
    13:32:17.668 backend.py        INFO   conu has initiated, welcome to the party!
    13:32:17.668 backend.py        DEBUG  conu version: 0.1.0
    13:32:17.669 filesystem.py     INFO   initializing Directory(path=/tmp/shiny-kbjmsxgett)
    13:32:17.669 filesystem.py     DEBUG  changing permission bits of /tmp/shiny-kbjmsxgett to 0o700
    13:32:17.669 filesystem.py     INFO   initialized
    13:32:17.676 image.py          INFO   run container via binary in background
    13:32:17.676 image.py          DEBUG  docker command: ['docker', 'container', 'run', '-v', '/tmp/shiny-kbjmsxgett:/webroot', '-w', '/webroot', '-d', '--cidfile=/tmp/conu-b3jluxsc/conu-cbtbokqsedrtmiktfawbozgczdgxktmt', '-l', 'conu.test_artifact', 'sha256:9881e4229c9517b592980740ab2dfd8b5176adf7eb3be0f32b10a5dac5a3f12a', 'python3', '-m', 'http.server', '--bind', '0.0.0.0', '8765']
    13:32:17.676 __init__.py       DEBUG  command: ['docker', 'container', 'run', '-v', '/tmp/shiny-kbjmsxgett:/webroot', '-w', '/webroot', '-d', '--cidfile=/tmp/conu-b3jluxsc/conu-cbtbokqsedrtmiktfawbozgczdgxktmt', '-l', 'conu.test_artifact', 'sha256:9881e4229c9517b592980740ab2dfd8b5176adf7eb3be0f32b10a5dac5a3f12a', 'python3', '-m', 'http.server', '--bind', '0.0.0.0', '8765']
    6a0530ab32c17858180c9c3867c17a2aaf3466c6dd17c329ab7a0cf9d991f626
    13:32:18.131 probes.py         DEBUG  starting probe
    13:32:18.137 probes.py         DEBUG  Running "<lambda>" with parameters: "{}": 0/10
    13:32:18.133 probes.py         DEBUG  first process started: pid=5812
    13:32:18.141 probes.py         DEBUG  pausing for 0.1 before next try
    13:32:18.243 probes.py         DEBUG  starting probe
    13:32:18.244 probes.py         DEBUG  first process started: pid=5828
    13:32:18.245 probes.py         DEBUG  pausing for 1 before next try
    13:32:18.246 probes.py         DEBUG  Running "functools.partial(<bound method DockerContainer.is_port_open of DockerContainer(image=registry.fedoraproject.org/fedora:27, id=6a0530ab32c17858180c9c3867c17a2aaf3466c6dd17c329ab7a0cf9d991f626)>, 8765)" with parameters: "{}":      0/10
    13:32:18.251 __init__.py       INFO   trying to open connection to 172.17.0.2:8765
    13:32:18.251 __init__.py       INFO   was connection successful? errno: 0
    13:32:18.251 __init__.py       DEBUG  port is opened: 172.17.0.2:8765
    13:32:19.444 filesystem.py     INFO   brace yourselves, removing '/tmp/shiny-kbjmsxgett'
    

    The test passed! The logs should be easy to read, so you should have pretty good overview of what happened.

    Kubernetes

    Use conu with minikube locally

    If you want to test your images in Kubernetes locally, you will need to run kubernetes cluster on your host. We recommend to use minikube, for installation follow instructions in minikube github repository.

    After that, run minikube like this:

    $ minikube start

    Kubernetes example

    $ cat examples/k8s_deployment.py
    from conu.backend.k8s.backend import K8sBackend
    from conu.backend.k8s.deployment import Deployment
    from conu.utils import get_oc_api_token
    
    # obtain API key from OpenShift cluster. If you are not using OpenShift cluster for kubernetes tests
    # you need to replace `get_oc_api_token()` with your Bearer token. More information here:
    # https://kubernetes.io/docs/reference/access-authn-authz/authentication/
    api_key = get_oc_api_token()
    
    with K8sBackend(api_key=api_key) as k8s_backend:
    
        namespace = k8s_backend.create_namespace()
    
        template = """
        apiVersion: apps/v1
        kind: Deployment
        metadata:
          name: hello-world
          labels:
            app: hello-world
        spec:
          replicas: 3
          selector:
            matchLabels:
              app: hello-world
          template:
            metadata:
              labels:
                app: hello-world
            spec:
              containers:
              - name: hello-openshift
                image: openshift/hello-openshift
        """
    
        test_deployment = Deployment(namespace=namespace, from_template=template,
                                     create_in_cluster=True)
    
        try:
            test_deployment.wait(200)
            assert test_deployment.all_pods_ready()
        finally:
            test_deployment.delete()
            k8s_backend.delete_namespace(namespace)

    Let’s run it and look at the logs:

    $ python3 examples/k8s_deployment.py
    13:23:09.479 backend.py        INFO   conu has initiated, welcome to the party!
    13:23:09.523 backend.py        INFO   Creating namespace: namespace-m4cz
    13:23:14.557 backend.py        INFO   Namespace is ready!
    13:23:19.562 deployment.py     INFO   Creating Deployment hello-world in namespace: namespace-m4cz
    13:23:27.625 deployment.py     INFO   All pods are ready for deployment hello-world in namespace: namespace-m4cz
    13:23:28.620 deployment.py     INFO   Deleting Deployment hello-world in namespace: namespace-m4cz
    13:23:28.654 backend.py        INFO   Deleting namespace: namespace-m4cz
    

    Openshift

    Use conu for testing locally

    If you want to test your images in OpenShift locally, you need to run OpenShift cluster on your host. You can install it by following instructions in OpenShift origin or minishift github repositories.

    After that, you may need to setup cluster, here is example setup:

    oc cluster up
    oc login -u system:admin
    oadm policy add-role-to-user system:registry developer
    oadm policy add-role-to-user admin developer
    oadm policy add-role-to-user system:image-builder developer
    oadm policy add-cluster-role-to-user cluster-reader developer
    oadm policy add-cluster-role-to-user admin developer
    oadm policy add-cluster-role-to-user cluster-admin developer
    oc login -u developer -p developer

    For more information, why do you need to grant all these rights to user see accessing registry

    OpenShift example

    $ cat examples/oepnshift/openshift_s2i_remote.py
    import logging
    
    from conu.backend.origin.backend import OpenshiftBackend
    from conu.backend.docker.backend import DockerBackend
    from conu.utils import get_oc_api_token
    
    api_key = get_oc_api_token()
    with OpenshiftBackend(api_key=api_key, logging_level=logging.DEBUG) as openshift_backend:
        with DockerBackend(logging_level=logging.DEBUG) as backend:
            # builder image
            python_image = backend.ImageClass("centos/python-36-centos7")
    
            # docker login inside OpenShift internal registry
            OpenshiftBackend.login_to_registry('developer')
    
            # create new app from remote source in OpenShift cluster
            app_name = openshift_backend.new_app(python_image,
                                                 source="https://github.com/openshift/django-ex.git",
                                                 project='myproject')
    
            try:
                # wait until service is ready to accept requests
                openshift_backend.wait_for_service(
                    app_name=app_name,
                    expected_output='Welcome to your Django application on OpenShift',
                    timeout=300)
            finally:
                openshift_backend.clean_project(app_name)

    Let’s run it and look at the logs:

    $ python3 examples/openshift/openshift_s2i_remote.py
    13:29:38.231 backend.py        INFO   conu has initiated, welcome to the party!
    13:29:38.231 backend.py        DEBUG  conu version: 0.5.0
    13:29:38.256 backend.py        INFO   conu has initiated, welcome to the party!
    13:29:38.256 backend.py        DEBUG  conu version: 0.5.0
    13:29:38.314 __init__.py       INFO   docker environment info: 'Client:\n Version:         1.13.1\n API version:     1.26\n Package version: docker-1.13.1-74.git6e3bb8e.el7.centos.x86_64\n Go version:      go1.10.3\n Git commit:      1556cce-unsupported\n Built:           Wed Aug  1 17:21:17 2018\n OS/Arch:         linux/amd64\n\nServer:\n Version:         1.13.1\n API version:     1.26 (minimum version 1.12)\n Package version: docker-1.13.1-74.git6e3bb8e.el7.centos.x86_64\n Go version:      go1.9.4\n Git commit:      6e3bb8e/1.13.1\n Built:           Tue Aug 21 15:23:37 2018\n OS/Arch:         linux/amd64\n Experimental:    false\n'
    13:29:38.326 backend.py        INFO   conu has initiated, welcome to the party!
    13:29:38.584 backend.py        INFO   conu has initiated, welcome to the party!
    13:29:38.656 backend.py        INFO   Login to 172.30.1.1:5000 succeed
    13:29:38.656 backend.py        INFO   conu has initiated, welcome to the party!
    13:29:38.673 image.py          INFO   The push refers to a repository [172.30.1.1:5000/myproject/python-36-centos7]
    13:29:38.689 image.py          INFO   Preparing
    13:29:38.689 image.py          INFO   Preparing
    13:29:38.689 image.py          INFO   Preparing
    13:29:38.690 image.py          INFO   Preparing
    13:29:38.690 image.py          INFO   Preparing
    13:29:38.690 image.py          INFO   Preparing
    13:29:38.690 image.py          INFO   Preparing
    13:29:38.690 image.py          INFO   Preparing
    13:29:38.690 image.py          INFO   Preparing
    13:29:38.700 image.py          INFO   Waiting
    13:29:38.701 image.py          INFO   Waiting
    13:29:38.701 image.py          INFO   Waiting
    13:29:38.701 image.py          INFO   Waiting
    13:29:38.747 image.py          INFO   Layer already exists
    13:29:38.747 image.py          INFO   Layer already exists
    13:29:38.753 image.py          INFO   Layer already exists
    13:29:38.754 image.py          INFO   Layer already exists
    13:29:38.772 image.py          INFO   Layer already exists
    13:29:38.807 image.py          INFO   Layer already exists
    13:29:38.807 image.py          INFO   Layer already exists
    13:29:38.807 image.py          INFO   Layer already exists
    13:29:38.807 image.py          INFO   Layer already exists
    13:29:39.065 image.py          INFO   latest: digest: sha256:51cf14c1d1491c5ab0e902c52740c22d4fff52f95111b97d195d12325a426350 size: 2210
    13:29:39.065 backend.py        INFO   Creating new app in project myproject
    13:29:39.558 backend.py        INFO   Waiting for service to get ready
    13:30:06.768 backend.py        INFO   Connection to service established and return expected output!
    13:30:07.729 backend.py        INFO   Deleting app
    13:30:09.504 backend.py        INFO   deploymentconfig "app-u4ow" deleted
    13:30:09.504 backend.py        INFO   buildconfig "app-u4ow" deleted
    13:30:09.504 backend.py        INFO   imagestream "app-u4ow" deleted
    13:30:09.504 backend.py        INFO   pod "app-u4ow-1-vltwq" deleted
    13:30:09.504 backend.py        INFO   service "app-u4ow" deleted
    
    

    Real examples

    Documentation

    For more info see our documentation at conu.readthedocs.io.

    How to release conu

    We are using awesome release-bot for new conu releases. If you want to make new release:

    • create new issue with title x.y.z release and wait for release bot to create new PR.
    • polish CHANGELOG.md and merge if tests are passing.
    • Sit down, relax and watch how release bot is doing the hard work.
    Visit original content creator repository https://github.com/user-cont/conu