I AM LISTENING TO
|
WAS ICH LIEBE
  • Englisch
  • Deutsch


BLOG FILTER



2. Mai 2023

7 Days of Docker

I am a huge Docker fan and run my own home and cloud server with it.

What is Docker?

Docker is a platform that allows developers to create, deploy, and run applications in containers. Containers are lightweight, portable, and self-sufficient environments that can run an application and all its dependencies, making it easier to manage and deploy applications across different environments. Docker provides tools and services for building, shipping, and running containers, as well as a registry for storing and sharing container images.

With Docker, developers can package their applications as containers and deploy them anywhere, whether it’s on a laptop, a server, or in the cloud. Docker has become a popular technology for DevOps teams and has revolutionized the way applications are developed and deployed.“

Why this article series?

I am always looking for new ways to document the tools I use. This might help others to find interesting projects to enhance their own work or hobby life :)

I will have multiple series of this kind. I am starting with Docker this week, as it is at the core / a hub for many things I do. I often testdrive things locally, before deploying them to the cloud.

I am not concentrating on the installation of Docker itself, there are so many articles about that out there. You will have no problem to find help articles or videos detailing it for your platform.

Docker Compose or CLI?

Docker Compose and Docker CLI (Command Line Interface) are two different tools provided by Docker, although they are often used together.

Docker CLI is a command-line interface tool that allows users to interact with Docker and manage Docker containers, images, and networks from the terminal. It provides a set of commands that can be used to create, start, stop, and manage Docker containers, as well as to build and push Docker images.

Docker Compose, on the other hand, is a tool for defining and running multi-container Docker applications. It allows users to define a set of services and their dependencies in a YAML file and then start and stop the entire application with a single command. Docker Compose also provides a way to manage the lifecycle of the containers as a group, including scaling up and down the number of containers.

I prefer the use of Docker Compose, as it makes it easy to replicate and tweak a setup between different servers.

CLI to Composer YAML

There are tools like $composerize, which allow you to easily transform a CLI command into a composer file. Also a nice way to easily combine multiple commands into a clean configuration.

Portainer – Using a webinterface for docker

Portainer is an open-source container management tool that provides a web-based user interface for managing Docker environments. With Portainer, users can easily deploy and manage containers, images, networks, and volumes using a graphical user interface (GUI) instead of using the Docker CLI. Portainer also provides features for monitoring container and system metrics, creating and managing container templates, and configuring and managing Docker Swarm clusters.

Portainer is designed to be easy to use and to provide a simple and intuitive interface for managing Docker environments. It supports multiple Docker hosts and allows users to switch between them easily from the GUI. Portainer also provides role-based access control (RBAC) to manage user access and permissions, making it suitable for use in team environments.

Portainer can be installed as a Docker container and can be used to manage both local and remote Docker environments. It is available in two versions: Portainer CE (Community Edition) and Portainer Business. Portainer CE is free and open-source, while Portainer Business provides additional features and support for enterprise users.

Portainer is my tool of choice, as it allows to create stacks. A stack is a collection of Docker services that are deployed and managed as a single entity. A stack is defined in a Compose file (in YAML format) that specifies the services and their configurations.

When a stack is deployed, Portainer creates the required containers, networks, and volumes and starts the services in the stack. Portainer also monitors the stack and its services, providing status updates and alerts in case of issues or failures.

Export a Docker compose-file

As I said, its important for me to easily transfer a single container or stack to another server. The stack itself can be easily copied and reused. But do we easily export the setup of a current single docker file into a docker-compose file?

docker-autocompose to the rescue! This docker image allows you to generate a docker-compose yaml definition from a docker container.

Export single or multiple containers

Export all containers

This has been a great tool to also quickly backup all relevant container information. Apart from the persistent data, the most important information to quickly restore a setup if needed.

Backup , backup … backup! Learned my lesson, when it comes to restoring docker setups ;) Its so easy to forget little tweaks you did to the setup of a docker container.

Starting tomorrow …

readmore

What is Übersicht?

„Übersicht“ is a German word that means „overview“ or „summary“ in English. The name of the software was chosen because it allows users to have a quick overview of various information on their desktop. It’s also a play on words, because in German the name of the software can be translated as „super sight“ which refers to the ability to have a lot of information at a glance.

Übersicht is a lightweight and powerful application that allows users to create and customize desktop widgets using web technologies such as HTML, CSS, and JavaScript. With Übersicht, you can create widgets that display information such as the weather, calendar events, system resource usage, and more. The widgets can be customized to display the information in any format and can be positioned anywhere on the desktop, allowing you to create a personalized and efficient workspace.

Übersicht widgets are created using a simple and user-friendly interface that allows you to preview and edit the widget’s code. The widgets are also highly customizable, allowing you to change the appearance and behavior of the widgets to suit your needs. Additionally, Übersicht widgets can be shared with other users, and there are a variety of widgets available for download from the developer’s website.

The application is open-source and free to use, and it’s also lightweight, it won’t affect your computer performance. Overall, Übersicht is a powerful and versatile tool for creating custom desktop widgets on macOS.

Custom Desktop Widgets / MenuBar Enhancements

There are several other tools similar to Übersicht that allow you to create custom desktop widgets. Some of the most popular alternatives include:

  1. Geektool (Mac): is a powerful and flexible tool for creating custom desktop widgets on macOS. It allows you to display information such as the weather, calendar events, system resource usage, and more.
    I used it for a while, but never really got into it any deeper. It has been a resource hog for some as well.
  2. xbar (Mac): is an open-source tool that  lets you put the output from any script/program in your macOS menu bar. This is a complete rewrite of BitBar in Go.
    This will also make into my workflow :)
  3. SwiftBar :Add custom menu bar programs on macOS in three easy steps: Write a shell script.Add it to SwiftBar … there is no 3rd step!
  4. Conky (Mac / Limnux) is a free, light-weight system monitor for X, that displays any kind of information on your desktop. It can also run on macOS, output to your console, a file, or even HTTP.
  5. Hologram Desktop (Mac / Free / InAppPurchases)
  6. WidgetWall (Mac / Paid) : Looks nice, but too limited for me.
  7. Beaconly (Mac / Free / InAppPurchases ): Beaconly is a flexible, easy to use data aggregating menu app that ties relevant information to you, beautifully one click-away in your macOs menu bar.
  8. Rainmeter: is a Windows-only tool similar to Übersicht. It allows users to create custom desktop widgets using a variety of pre-built skins or by creating your own skins using HTML, CSS, and JavaScript.
    This is the goto solution for any Windows user!

What are you using these for?

With many external systems in play, its always crucial to keep an eye on things. I have build nice dashboards, using Grafana, InfluxDB, NetData and Prometheus. But they are either displayed in a browser window or on a separate screen.

If you have 2 / 3 monitors or an ultra-wide screen, you have a lot of Desktop real-estate you can use.

That is something that I have been looking at for years, but only tried for a short period of time. This year I want to really build out desktop and menu widgets , that help me to get an even better overview of things and help reduce repetitive tasks.

I will share links to things I like and share access to the widgets I build myself or tweaked.

Übersicht – desktop widgets / working & planned

These are the current things that are in progress or planned.

  1. RSS Widget: This allows me to easily fetch the latest news from the websites I visit multiple times each day.
    You can already find a first version of the widget on Github, forked from Eric Dasque.

    I have two widgets currently setup on the left and right of my ultra-wide screen. Gathering information from all my Youtube subscriptions, tech websites and news outlets.

    Its using Go for the command line and i rewrote parts to make it completely template-based to allow flexible output variations.
    I have some other ideas, but those will make it into future versions. This is still based of the Classic widget architecture, but I also plan to move it to the JSX architecture.
  2. Weather widget for Openweather: Straight forward Openweather widget forked from Li Xueli. Displays the current weather and allows to expand to show the next 7 days.
    This is build on the new JSX architecture of Übersicht. I did a couple of tweaks and removed the geo-location. Changes will be shared soon.
  3. Fancy Clock / Date / Week
    I have a basic version working.
  4. Email: Building a widget that combines IMAP, Gmail and local Mail.
    I have a basic version working.
  5. Asana: Pull latest tasks.
    A basic version is already working.
  6. Grafana: Dashboard integration
  7. Netdata
  8. Glances
  9. Uptime Monitoring: Uptime Kuma / UptimeRobot / Statping
  10. Cloudflare: Stats
  11. MQTT / Node-Red / N8N

xbar – Extend Menu Bar / working & planned

Nothing to share yet ….

readmore

I will use this article to collect interesting tips and tricks about using the Linux cron. This is not so much about setting up a cron, but about little things I use or discovered!

What is a cron ?

The cron daemon is a long-running process that executes commands at specific dates and times. You can use this to schedule activities, either as one-time events or as recurring tasks.

What is the crontab?

For commands that need to be executed repeatedly (e.g., hourly, daily, or weekly), you can use the crontab command. The crontab command creates a crontab file containing commands and instructions for the cron daemon to execute.

Format is: MIN HOUR DOM MON DOW CMD
Minute field
Hour field
Day of month
Day of week
Command

Run every 5 minutes

Run yearly, monthly, weekly, daily or on reboot.
@yearly will run at 00:00 on Jan 1st for every year.
@monthly will run at 00:00 on 1st of every month.
@weekly will run at 00:00 on starting of every week.
@daily will run at 00:00 on every day.
@reboot  will run after the server has been rebooted


TIPS

1. Send cron output via email

2. Use a real cron for WordPress

A real cron does not rely on website activity and executes independently.

Do not forget to disable the virtual WordPress Cron in the wp-config.php!

3. Prevent Emails being sent, when cron executes > /dev/null 2>&1

4. Set Standard Variables

5. Output Redirection

TOOLS

  1. Crontab UI (NodeJS) – Easy way to edit your crontab visually. @Github
  2. Chronis ( >= PHP 7) – Chronis will help you define cron jobs using natural language / YAML and will generate the crontab files for you. @Github
  3. PHP Cron Expression Parser – Standard (V7) compliant crontab expression parser/validator with support for time zones. @Github
  4. PhpGt/Cron (PHP) – Define background jobs in standard crontab format and the Cron Runner will execute them when they are due. Jobs can be either normal scripts, or calls to static functions with automatic autoloading taken care of. @Github
  5. Cronicle (NodeJS) – A simple, distributed task scheduler and runner with a web based UI. @GitHub / Website

readmore

Paw is a full-featured HTTP client that lets you test the APIs you build or consume. It has a beautiful native OS X interface to compose requests, inspect server responses and generate client code out-of-the-box.

This is one of my go-to tools, when test-driving my API endpoints.

Paw for Mac

readmore

Really liking this, as it detaches the wireless connection from the lamp, that might fail at some point.

Light bulbs up to 40W are supported and will even be certified for outdoor usage.

emberlight provides Bluetooth, Wifi connectivity and a proximity sensor, all integrating into IFTTT and accessible through a REST Api.

emberlight

readmore

Structure opened its doors a couple of days ago.

Structure offers a simple and powerful IoT cloud platform for developing the next generation of connected experiences. They offer device management with robust data visualization that reacts in real-time.

They have a nice drag & drop workflow interface that allows you to forward data coming in, combine data or just store it.

I will be testing a builder kit with the platform, that includes the Adafruit Feather Huzzah, which offers native Wifi connectivity. My Raspberry Pi’s will also find their way into the system. The platform allows to consume REST Apis as well,  that will make it even more fun to build something unique.

If you are interested in IoT, you should really check it out. Its free :)

Structure / Adafruit Feather Huzzah

Enjoy coding …

readmore

„Home automation with Raspberry PI and Arduino using Node.js, MongoDB, HTML5 and Websockets“

  • Full access to the GPIO of the Raspberry Pi
  • Communication with an attached Arduino
  • Wake-on-LAN (not really hardware, but at least it wakes up hardware)
  • Stream your webcam via socket.io
  • Node.js, Socket.io, Expressjs, Requirejs
  • HTML5, CSS3 and Websockets
  • Jade templating
  • Responsive design

GitHub

readmore

Cylon.js is a JavaScript framework for robotics, physical computing, and the Internet of Things. It makes it incredibly easy to command robots and devices.

  • ARDrone
  • Arduino
  • Arduino YUN
  • Audio
  • Beaglebone Black
  • Bebop
  • BLE
  • Crazyflie
  • Digispark
  • Imp
  • Intel Galileo
  • Intel Edison
  • Intel IoT Analytics
  • Joystick
  • Keyboard
  • Leap Motion
  • M2X
  • MiP
  • MQTT
  • Nest
  • Neurosky
  • OpenCV
  • Particle
  • Pebble
  • Philips Hue
  • Pinoccio
  • PowerUp
  • Rapiro
  • Raspberry Pi
  • Salesforce
  • Skynet
  • Speech
  • Sphero
  • Sphero BLE
  • Tessel
  • WICED Sense

Cylon.js @ GitHub

readmore